htt.h 878 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. */
  231. #define HTT_CURRENT_VERSION_MAJOR 3
  232. #define HTT_CURRENT_VERSION_MINOR 109
  233. #define HTT_NUM_TX_FRAG_DESC 1024
  234. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  235. #define HTT_CHECK_SET_VAL(field, val) \
  236. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  237. /* macros to assist in sign-extending fields from HTT messages */
  238. #define HTT_SIGN_BIT_MASK(field) \
  239. ((field ## _M + (1 << field ## _S)) >> 1)
  240. #define HTT_SIGN_BIT(_val, field) \
  241. (_val & HTT_SIGN_BIT_MASK(field))
  242. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  243. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  244. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  245. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  246. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  247. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  248. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  249. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  250. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  251. /*
  252. * TEMPORARY:
  253. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  254. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  255. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  256. * updated.
  257. */
  258. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  259. /*
  260. * TEMPORARY:
  261. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  262. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  263. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  264. * updated.
  265. */
  266. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  267. /**
  268. * htt_dbg_stats_type -
  269. * bit positions for each stats type within a stats type bitmask
  270. * The bitmask contains 24 bits.
  271. */
  272. enum htt_dbg_stats_type {
  273. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  274. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  275. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  276. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  277. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  278. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  279. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  280. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  281. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  282. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  283. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  284. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  285. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  286. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  287. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  288. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  289. /* bits 16-23 currently reserved */
  290. /* keep this last */
  291. HTT_DBG_NUM_STATS
  292. };
  293. /*=== HTT option selection TLVs ===
  294. * Certain HTT messages have alternatives or options.
  295. * For such cases, the host and target need to agree on which option to use.
  296. * Option specification TLVs can be appended to the VERSION_REQ and
  297. * VERSION_CONF messages to select options other than the default.
  298. * These TLVs are entirely optional - if they are not provided, there is a
  299. * well-defined default for each option. If they are provided, they can be
  300. * provided in any order. Each TLV can be present or absent independent of
  301. * the presence / absence of other TLVs.
  302. *
  303. * The HTT option selection TLVs use the following format:
  304. * |31 16|15 8|7 0|
  305. * |---------------------------------+----------------+----------------|
  306. * | value (payload) | length | tag |
  307. * |-------------------------------------------------------------------|
  308. * The value portion need not be only 2 bytes; it can be extended by any
  309. * integer number of 4-byte units. The total length of the TLV, including
  310. * the tag and length fields, must be a multiple of 4 bytes. The length
  311. * field specifies the total TLV size in 4-byte units. Thus, the typical
  312. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  313. * field, would store 0x1 in its length field, to show that the TLV occupies
  314. * a single 4-byte unit.
  315. */
  316. /*--- TLV header format - applies to all HTT option TLVs ---*/
  317. enum HTT_OPTION_TLV_TAGS {
  318. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  319. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  320. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  321. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  322. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  323. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  324. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  325. };
  326. #define HTT_TCL_METADATA_VER_SZ 4
  327. PREPACK struct htt_option_tlv_header_t {
  328. A_UINT8 tag;
  329. A_UINT8 length;
  330. } POSTPACK;
  331. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  332. #define HTT_OPTION_TLV_TAG_S 0
  333. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  334. #define HTT_OPTION_TLV_LENGTH_S 8
  335. /*
  336. * value0 - 16 bit value field stored in word0
  337. * The TLV's value field may be longer than 2 bytes, in which case
  338. * the remainder of the value is stored in word1, word2, etc.
  339. */
  340. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  341. #define HTT_OPTION_TLV_VALUE0_S 16
  342. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_TAG_GET(word) \
  348. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  349. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  355. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  356. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  357. do { \
  358. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  359. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  360. } while (0)
  361. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  362. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  363. /*--- format of specific HTT option TLVs ---*/
  364. /*
  365. * HTT option TLV for specifying LL bus address size
  366. * Some chips require bus addresses used by the target to access buffers
  367. * within the host's memory to be 32 bits; others require bus addresses
  368. * used by the target to access buffers within the host's memory to be
  369. * 64 bits.
  370. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  371. * a suffix to the VERSION_CONF message to specify which bus address format
  372. * the target requires.
  373. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  374. * default to providing bus addresses to the target in 32-bit format.
  375. */
  376. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  377. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  379. };
  380. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  381. struct htt_option_tlv_header_t hdr;
  382. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  383. } POSTPACK;
  384. /*
  385. * HTT option TLV for specifying whether HL systems should indicate
  386. * over-the-air tx completion for individual frames, or should instead
  387. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  388. * requests an OTA tx completion for a particular tx frame.
  389. * This option does not apply to LL systems, where the TX_COMPL_IND
  390. * is mandatory.
  391. * This option is primarily intended for HL systems in which the tx frame
  392. * downloads over the host --> target bus are as slow as or slower than
  393. * the transmissions over the WLAN PHY. For cases where the bus is faster
  394. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  395. * and consquently will send one TX_COMPL_IND message that covers several
  396. * tx frames. For cases where the WLAN PHY is faster than the bus,
  397. * the target will end up transmitting very short A-MPDUs, and consequently
  398. * sending many TX_COMPL_IND messages, which each cover a very small number
  399. * of tx frames.
  400. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  401. * a suffix to the VERSION_REQ message to request whether the host desires to
  402. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  403. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  404. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  405. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  406. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  407. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  408. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  409. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  410. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  411. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  412. * TLV.
  413. */
  414. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  415. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  416. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  417. };
  418. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying how many tx queue groups the target
  424. * may establish.
  425. * This TLV specifies the maximum value the target may send in the
  426. * txq_group_id field of any TXQ_GROUP information elements sent by
  427. * the target to the host. This allows the host to pre-allocate an
  428. * appropriate number of tx queue group structs.
  429. *
  430. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  431. * a suffix to the VERSION_REQ message to specify whether the host supports
  432. * tx queue groups at all, and if so if there is any limit on the number of
  433. * tx queue groups that the host supports.
  434. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  435. * a suffix to the VERSION_CONF message. If the host has specified in the
  436. * VER_REQ message a limit on the number of tx queue groups the host can
  437. * supprt, the target shall limit its specification of the maximum tx groups
  438. * to be no larger than this host-specified limit.
  439. *
  440. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  441. * shall preallocate 4 tx queue group structs, and the target shall not
  442. * specify a txq_group_id larger than 3.
  443. */
  444. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  445. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  446. /*
  447. * values 1 through N specify the max number of tx queue groups
  448. * the sender supports
  449. */
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  451. };
  452. /* TEMPORARY backwards-compatibility alias for a typo fix -
  453. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  454. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  455. * to support the old name (with the typo) until all references to the
  456. * old name are replaced with the new name.
  457. */
  458. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  459. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  460. struct htt_option_tlv_header_t hdr;
  461. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  462. } POSTPACK;
  463. /*
  464. * HTT option TLV for specifying whether the target supports an extended
  465. * version of the HTT tx descriptor. If the target provides this TLV
  466. * and specifies in the TLV that the target supports an extended version
  467. * of the HTT tx descriptor, the target must check the "extension" bit in
  468. * the HTT tx descriptor, and if the extension bit is set, to expect a
  469. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  470. * descriptor. Furthermore, the target must provide room for the HTT
  471. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  472. * This option is intended for systems where the host needs to explicitly
  473. * control the transmission parameters such as tx power for individual
  474. * tx frames.
  475. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  476. * as a suffix to the VERSION_CONF message to explicitly specify whether
  477. * the target supports the HTT tx MSDU extension descriptor.
  478. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  479. * by the host as lack of target support for the HTT tx MSDU extension
  480. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  481. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  482. * the HTT tx MSDU extension descriptor.
  483. * The host is not required to provide the HTT tx MSDU extension descriptor
  484. * just because the target supports it; the target must check the
  485. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  486. * extension descriptor is present.
  487. */
  488. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  489. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  491. };
  492. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  493. struct htt_option_tlv_header_t hdr;
  494. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  495. } POSTPACK;
  496. /*
  497. * For the tcl data command V2 and higher support added a new
  498. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  499. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  500. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  501. * HTT option TLV for specifying which version of the TCL metadata struct
  502. * should be used:
  503. * V1 -> use htt_tx_tcl_metadata struct
  504. * V2 -> use htt_tx_tcl_metadata_v2 struct
  505. * Old FW will only support V1.
  506. * New FW will support V2. New FW will still support V1, at least during
  507. * a transition period.
  508. * Similarly, old host will only support V1, and new host will support V1 + V2.
  509. *
  510. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  511. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  512. * of TCL metadata the host supports. If the host doesn't provide a
  513. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  514. * is implicitly understood that the host only supports V1.
  515. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  516. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  517. * the host shall use. The target shall only select one of the versions
  518. * supported by the host. If the target doesn't provide a
  519. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  520. * is implicitly understood that the V1 TCL metadata shall be used.
  521. */
  522. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  523. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  524. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  525. };
  526. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  527. struct htt_option_tlv_header_t hdr;
  528. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  529. } POSTPACK;
  530. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  531. HTT_OPTION_TLV_VALUE0_SET(word, value)
  532. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  533. HTT_OPTION_TLV_VALUE0_GET(word)
  534. typedef struct {
  535. union {
  536. /* BIT [11 : 0] :- tag
  537. * BIT [23 : 12] :- length
  538. * BIT [31 : 24] :- reserved
  539. */
  540. A_UINT32 tag__length;
  541. /*
  542. * The following struct is not endian-portable.
  543. * It is suitable for use within the target, which is known to be
  544. * little-endian.
  545. * The host should use the above endian-portable macros to access
  546. * the tag and length bitfields in an endian-neutral manner.
  547. */
  548. struct {
  549. A_UINT32 tag : 12, /* BIT [11 : 0] */
  550. length : 12, /* BIT [23 : 12] */
  551. reserved : 8; /* BIT [31 : 24] */
  552. };
  553. };
  554. } htt_tlv_hdr_t;
  555. /** HTT stats TLV tag values */
  556. typedef enum {
  557. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  558. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  559. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  560. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  561. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  562. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  563. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  564. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  565. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  568. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  569. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  570. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  571. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  572. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  573. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  574. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  575. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  578. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  579. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  580. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  581. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  582. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  583. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  584. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  585. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  586. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  587. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  588. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  589. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  590. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  591. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  592. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  593. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  594. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  595. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  596. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  597. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  598. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  599. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  600. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  602. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  603. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  608. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  611. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  612. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  613. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  614. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  615. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  616. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  617. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  618. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  619. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  620. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  621. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  622. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  623. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  624. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  625. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  626. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  627. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  628. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  629. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  630. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  631. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  632. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  633. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  634. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  635. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  636. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  637. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  638. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  639. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  640. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  641. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  642. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  643. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  644. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  645. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  646. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  647. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  648. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  649. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  650. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  651. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  652. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  655. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  656. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  657. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  658. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  659. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  660. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  661. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  662. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  665. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  666. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  667. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  668. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  669. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  670. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  671. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  674. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  675. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  676. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  677. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  678. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  679. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  680. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  681. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  682. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  683. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  684. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  685. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  686. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  687. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  688. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  689. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  690. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  692. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  693. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  694. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  697. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  698. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  699. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  700. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  701. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  702. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  703. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  704. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  712. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  713. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  714. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  715. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  716. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  717. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  718. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  719. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  720. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  721. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  722. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  723. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  724. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  725. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  726. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v */
  727. HTT_STATS_MAX_TAG,
  728. } htt_stats_tlv_tag_t;
  729. /* retain deprecated enum name as an alias for the current enum name */
  730. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  731. #define HTT_STATS_TLV_TAG_M 0x00000fff
  732. #define HTT_STATS_TLV_TAG_S 0
  733. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  734. #define HTT_STATS_TLV_LENGTH_S 12
  735. #define HTT_STATS_TLV_TAG_GET(_var) \
  736. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  737. HTT_STATS_TLV_TAG_S)
  738. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  739. do { \
  740. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  741. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  742. } while (0)
  743. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  744. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  745. HTT_STATS_TLV_LENGTH_S)
  746. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  747. do { \
  748. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  749. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  750. } while (0)
  751. /*=== host -> target messages ===============================================*/
  752. enum htt_h2t_msg_type {
  753. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  754. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  755. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  756. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  757. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  758. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  759. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  760. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  761. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  762. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  763. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  764. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  765. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  766. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  767. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  768. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  769. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  770. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  771. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  772. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  773. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  774. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  775. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  776. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  777. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  778. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  779. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  780. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  781. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  782. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  783. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  784. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  785. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  786. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  787. /* keep this last */
  788. HTT_H2T_NUM_MSGS
  789. };
  790. /*
  791. * HTT host to target message type -
  792. * stored in bits 7:0 of the first word of the message
  793. */
  794. #define HTT_H2T_MSG_TYPE_M 0xff
  795. #define HTT_H2T_MSG_TYPE_S 0
  796. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  797. do { \
  798. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  799. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  800. } while (0)
  801. #define HTT_H2T_MSG_TYPE_GET(word) \
  802. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  803. /**
  804. * @brief host -> target version number request message definition
  805. *
  806. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  807. *
  808. *
  809. * |31 24|23 16|15 8|7 0|
  810. * |----------------+----------------+----------------+----------------|
  811. * | reserved | msg type |
  812. * |-------------------------------------------------------------------|
  813. * : option request TLV (optional) |
  814. * :...................................................................:
  815. *
  816. * The VER_REQ message may consist of a single 4-byte word, or may be
  817. * extended with TLVs that specify which HTT options the host is requesting
  818. * from the target.
  819. * The following option TLVs may be appended to the VER_REQ message:
  820. * - HL_SUPPRESS_TX_COMPL_IND
  821. * - HL_MAX_TX_QUEUE_GROUPS
  822. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  823. * may be appended to the VER_REQ message (but only one TLV of each type).
  824. *
  825. * Header fields:
  826. * - MSG_TYPE
  827. * Bits 7:0
  828. * Purpose: identifies this as a version number request message
  829. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  830. */
  831. #define HTT_VER_REQ_BYTES 4
  832. /* TBDXXX: figure out a reasonable number */
  833. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  834. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  835. /**
  836. * @brief HTT tx MSDU descriptor
  837. *
  838. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  839. *
  840. * @details
  841. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  842. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  843. * the target firmware needs for the FW's tx processing, particularly
  844. * for creating the HW msdu descriptor.
  845. * The same HTT tx descriptor is used for HL and LL systems, though
  846. * a few fields within the tx descriptor are used only by LL or
  847. * only by HL.
  848. * The HTT tx descriptor is defined in two manners: by a struct with
  849. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  850. * definitions.
  851. * The target should use the struct def, for simplicitly and clarity,
  852. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  853. * neutral. Specifically, the host shall use the get/set macros built
  854. * around the mask + shift defs.
  855. */
  856. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  857. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  858. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  859. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  860. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  861. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  862. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  863. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  864. #define HTT_TX_VDEV_ID_WORD 0
  865. #define HTT_TX_VDEV_ID_MASK 0x3f
  866. #define HTT_TX_VDEV_ID_SHIFT 16
  867. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  868. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  869. #define HTT_TX_MSDU_LEN_DWORD 1
  870. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  871. /*
  872. * HTT_VAR_PADDR macros
  873. * Allow physical / bus addresses to be either a single 32-bit value,
  874. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  875. */
  876. #define HTT_VAR_PADDR32(var_name) \
  877. A_UINT32 var_name
  878. #define HTT_VAR_PADDR64_LE(var_name) \
  879. struct { \
  880. /* little-endian: lo precedes hi */ \
  881. A_UINT32 lo; \
  882. A_UINT32 hi; \
  883. } var_name
  884. /*
  885. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  886. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  887. * addresses are stored in a XXX-bit field.
  888. * This macro is used to define both htt_tx_msdu_desc32_t and
  889. * htt_tx_msdu_desc64_t structs.
  890. */
  891. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  892. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  893. { \
  894. /* DWORD 0: flags and meta-data */ \
  895. A_UINT32 \
  896. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  897. \
  898. /* pkt_subtype - \
  899. * Detailed specification of the tx frame contents, extending the \
  900. * general specification provided by pkt_type. \
  901. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  902. * pkt_type | pkt_subtype \
  903. * ============================================================== \
  904. * 802.3 | bit 0:3 - Reserved \
  905. * | bit 4: 0x0 - Copy-Engine Classification Results \
  906. * | not appended to the HTT message \
  907. * | 0x1 - Copy-Engine Classification Results \
  908. * | appended to the HTT message in the \
  909. * | format: \
  910. * | [HTT tx desc, frame header, \
  911. * | CE classification results] \
  912. * | The CE classification results begin \
  913. * | at the next 4-byte boundary after \
  914. * | the frame header. \
  915. * ------------+------------------------------------------------- \
  916. * Eth2 | bit 0:3 - Reserved \
  917. * | bit 4: 0x0 - Copy-Engine Classification Results \
  918. * | not appended to the HTT message \
  919. * | 0x1 - Copy-Engine Classification Results \
  920. * | appended to the HTT message. \
  921. * | See the above specification of the \
  922. * | CE classification results location. \
  923. * ------------+------------------------------------------------- \
  924. * native WiFi | bit 0:3 - Reserved \
  925. * | bit 4: 0x0 - Copy-Engine Classification Results \
  926. * | not appended to the HTT message \
  927. * | 0x1 - Copy-Engine Classification Results \
  928. * | appended to the HTT message. \
  929. * | See the above specification of the \
  930. * | CE classification results location. \
  931. * ------------+------------------------------------------------- \
  932. * mgmt | 0x0 - 802.11 MAC header absent \
  933. * | 0x1 - 802.11 MAC header present \
  934. * ------------+------------------------------------------------- \
  935. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  936. * | 0x1 - 802.11 MAC header present \
  937. * | bit 1: 0x0 - allow aggregation \
  938. * | 0x1 - don't allow aggregation \
  939. * | bit 2: 0x0 - perform encryption \
  940. * | 0x1 - don't perform encryption \
  941. * | bit 3: 0x0 - perform tx classification / queuing \
  942. * | 0x1 - don't perform tx classification; \
  943. * | insert the frame into the "misc" \
  944. * | tx queue \
  945. * | bit 4: 0x0 - Copy-Engine Classification Results \
  946. * | not appended to the HTT message \
  947. * | 0x1 - Copy-Engine Classification Results \
  948. * | appended to the HTT message. \
  949. * | See the above specification of the \
  950. * | CE classification results location. \
  951. */ \
  952. pkt_subtype: 5, \
  953. \
  954. /* pkt_type - \
  955. * General specification of the tx frame contents. \
  956. * The htt_pkt_type enum should be used to specify and check the \
  957. * value of this field. \
  958. */ \
  959. pkt_type: 3, \
  960. \
  961. /* vdev_id - \
  962. * ID for the vdev that is sending this tx frame. \
  963. * For certain non-standard packet types, e.g. pkt_type == raw \
  964. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  965. * This field is used primarily for determining where to queue \
  966. * broadcast and multicast frames. \
  967. */ \
  968. vdev_id: 6, \
  969. /* ext_tid - \
  970. * The extended traffic ID. \
  971. * If the TID is unknown, the extended TID is set to \
  972. * HTT_TX_EXT_TID_INVALID. \
  973. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  974. * value of the QoS TID. \
  975. * If the tx frame is non-QoS data, then the extended TID is set to \
  976. * HTT_TX_EXT_TID_NON_QOS. \
  977. * If the tx frame is multicast or broadcast, then the extended TID \
  978. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  979. */ \
  980. ext_tid: 5, \
  981. \
  982. /* postponed - \
  983. * This flag indicates whether the tx frame has been downloaded to \
  984. * the target before but discarded by the target, and now is being \
  985. * downloaded again; or if this is a new frame that is being \
  986. * downloaded for the first time. \
  987. * This flag allows the target to determine the correct order for \
  988. * transmitting new vs. old frames. \
  989. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  990. * This flag only applies to HL systems, since in LL systems, \
  991. * the tx flow control is handled entirely within the target. \
  992. */ \
  993. postponed: 1, \
  994. \
  995. /* extension - \
  996. * This flag indicates whether a HTT tx MSDU extension descriptor \
  997. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  998. * \
  999. * 0x0 - no extension MSDU descriptor is present \
  1000. * 0x1 - an extension MSDU descriptor immediately follows the \
  1001. * regular MSDU descriptor \
  1002. */ \
  1003. extension: 1, \
  1004. \
  1005. /* cksum_offload - \
  1006. * This flag indicates whether checksum offload is enabled or not \
  1007. * for this frame. Target FW use this flag to turn on HW checksumming \
  1008. * 0x0 - No checksum offload \
  1009. * 0x1 - L3 header checksum only \
  1010. * 0x2 - L4 checksum only \
  1011. * 0x3 - L3 header checksum + L4 checksum \
  1012. */ \
  1013. cksum_offload: 2, \
  1014. \
  1015. /* tx_comp_req - \
  1016. * This flag indicates whether Tx Completion \
  1017. * from fw is required or not. \
  1018. * This flag is only relevant if tx completion is not \
  1019. * universally enabled. \
  1020. * For all LL systems, tx completion is mandatory, \
  1021. * so this flag will be irrelevant. \
  1022. * For HL systems tx completion is optional, but HL systems in which \
  1023. * the bus throughput exceeds the WLAN throughput will \
  1024. * probably want to always use tx completion, and thus \
  1025. * would not check this flag. \
  1026. * This flag is required when tx completions are not used universally, \
  1027. * but are still required for certain tx frames for which \
  1028. * an OTA delivery acknowledgment is needed by the host. \
  1029. * In practice, this would be for HL systems in which the \
  1030. * bus throughput is less than the WLAN throughput. \
  1031. * \
  1032. * 0x0 - Tx Completion Indication from Fw not required \
  1033. * 0x1 - Tx Completion Indication from Fw is required \
  1034. */ \
  1035. tx_compl_req: 1; \
  1036. \
  1037. \
  1038. /* DWORD 1: MSDU length and ID */ \
  1039. A_UINT32 \
  1040. len: 16, /* MSDU length, in bytes */ \
  1041. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1042. * and this id is used to calculate fragmentation \
  1043. * descriptor pointer inside the target based on \
  1044. * the base address, configured inside the target. \
  1045. */ \
  1046. \
  1047. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1048. /* frags_desc_ptr - \
  1049. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1050. * where the tx frame's fragments reside in memory. \
  1051. * This field only applies to LL systems, since in HL systems the \
  1052. * (degenerate single-fragment) fragmentation descriptor is created \
  1053. * within the target. \
  1054. */ \
  1055. _paddr__frags_desc_ptr_; \
  1056. \
  1057. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1058. /* \
  1059. * Peer ID : Target can use this value to know which peer-id packet \
  1060. * destined to. \
  1061. * It's intended to be specified by host in case of NAWDS. \
  1062. */ \
  1063. A_UINT16 peerid; \
  1064. \
  1065. /* \
  1066. * Channel frequency: This identifies the desired channel \
  1067. * frequency (in mhz) for tx frames. This is used by FW to help \
  1068. * determine when it is safe to transmit or drop frames for \
  1069. * off-channel operation. \
  1070. * The default value of zero indicates to FW that the corresponding \
  1071. * VDEV's home channel (if there is one) is the desired channel \
  1072. * frequency. \
  1073. */ \
  1074. A_UINT16 chanfreq; \
  1075. \
  1076. /* Reason reserved is commented is increasing the htt structure size \
  1077. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1078. * A_UINT32 reserved_dword3_bits0_31; \
  1079. */ \
  1080. } POSTPACK
  1081. /* define a htt_tx_msdu_desc32_t type */
  1082. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1083. /* define a htt_tx_msdu_desc64_t type */
  1084. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1085. /*
  1086. * Make htt_tx_msdu_desc_t be an alias for either
  1087. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1088. */
  1089. #if HTT_PADDR64
  1090. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1091. #else
  1092. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1093. #endif
  1094. /* decriptor information for Management frame*/
  1095. /*
  1096. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1097. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1098. */
  1099. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1100. extern A_UINT32 mgmt_hdr_len;
  1101. PREPACK struct htt_mgmt_tx_desc_t {
  1102. A_UINT32 msg_type;
  1103. #if HTT_PADDR64
  1104. A_UINT64 frag_paddr; /* DMAble address of the data */
  1105. #else
  1106. A_UINT32 frag_paddr; /* DMAble address of the data */
  1107. #endif
  1108. A_UINT32 desc_id; /* returned to host during completion
  1109. * to free the meory*/
  1110. A_UINT32 len; /* Fragment length */
  1111. A_UINT32 vdev_id; /* virtual device ID*/
  1112. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1113. } POSTPACK;
  1114. PREPACK struct htt_mgmt_tx_compl_ind {
  1115. A_UINT32 desc_id;
  1116. A_UINT32 status;
  1117. } POSTPACK;
  1118. /*
  1119. * This SDU header size comes from the summation of the following:
  1120. * 1. Max of:
  1121. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1122. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1123. * b. 802.11 header, for raw frames: 36 bytes
  1124. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1125. * QoS header, HT header)
  1126. * c. 802.3 header, for ethernet frames: 14 bytes
  1127. * (destination address, source address, ethertype / length)
  1128. * 2. Max of:
  1129. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1130. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1131. * 3. 802.1Q VLAN header: 4 bytes
  1132. * 4. LLC/SNAP header: 8 bytes
  1133. */
  1134. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1135. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1136. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1137. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1138. A_COMPILE_TIME_ASSERT(
  1139. htt_encap_hdr_size_max_check_nwifi,
  1140. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1141. A_COMPILE_TIME_ASSERT(
  1142. htt_encap_hdr_size_max_check_enet,
  1143. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1144. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1145. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1146. #define HTT_TX_HDR_SIZE_802_1Q 4
  1147. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1148. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1149. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1150. HTT_TX_HDR_SIZE_802_1Q + \
  1151. HTT_TX_HDR_SIZE_LLC_SNAP)
  1152. #define HTT_HL_TX_FRM_HDR_LEN \
  1153. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1154. #define HTT_LL_TX_FRM_HDR_LEN \
  1155. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1156. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1157. /* dword 0 */
  1158. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1159. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1160. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1161. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1162. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1163. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1164. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1165. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1166. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1167. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1168. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1169. #define HTT_TX_DESC_PKT_TYPE_S 13
  1170. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1171. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1172. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1173. #define HTT_TX_DESC_VDEV_ID_S 16
  1174. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1175. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1176. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1177. #define HTT_TX_DESC_EXT_TID_S 22
  1178. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1179. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1180. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1181. #define HTT_TX_DESC_POSTPONED_S 27
  1182. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1183. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1184. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1185. #define HTT_TX_DESC_EXTENSION_S 28
  1186. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1187. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1188. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1189. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1190. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1191. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1192. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1193. #define HTT_TX_DESC_TX_COMP_S 31
  1194. /* dword 1 */
  1195. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1196. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1197. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1198. #define HTT_TX_DESC_FRM_LEN_S 0
  1199. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1200. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1201. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1202. #define HTT_TX_DESC_FRM_ID_S 16
  1203. /* dword 2 */
  1204. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1205. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1206. /* for systems using 64-bit format for bus addresses */
  1207. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1208. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1209. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1211. /* for systems using 32-bit format for bus addresses */
  1212. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1213. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1214. /* dword 3 */
  1215. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1216. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1217. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1218. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1219. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1220. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1221. #if HTT_PADDR64
  1222. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1223. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1224. #else
  1225. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1226. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1227. #endif
  1228. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1229. #define HTT_TX_DESC_PEER_ID_S 0
  1230. /*
  1231. * TEMPORARY:
  1232. * The original definitions for the PEER_ID fields contained typos
  1233. * (with _DESC_PADDR appended to this PEER_ID field name).
  1234. * Retain deprecated original names for PEER_ID fields until all code that
  1235. * refers to them has been updated.
  1236. */
  1237. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1238. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1239. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1240. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1241. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1242. HTT_TX_DESC_PEER_ID_M
  1243. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1244. HTT_TX_DESC_PEER_ID_S
  1245. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1246. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1247. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1248. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1249. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1250. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1251. #if HTT_PADDR64
  1252. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1253. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1254. #else
  1255. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1256. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1257. #endif
  1258. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1259. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1260. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1261. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1262. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1263. do { \
  1264. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1265. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1266. } while (0)
  1267. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1268. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1269. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1270. do { \
  1271. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1272. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1273. } while (0)
  1274. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1275. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1276. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1279. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1280. } while (0)
  1281. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1282. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1283. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1287. } while (0)
  1288. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1289. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1290. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1294. } while (0)
  1295. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1296. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1297. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1298. do { \
  1299. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1300. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1301. } while (0)
  1302. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1303. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1304. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1305. do { \
  1306. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1307. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1308. } while (0)
  1309. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1310. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1311. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1314. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1315. } while (0)
  1316. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1317. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1318. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1319. do { \
  1320. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1321. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1322. } while (0)
  1323. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1324. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1325. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1329. } while (0)
  1330. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1331. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1332. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1333. do { \
  1334. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1335. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1336. } while (0)
  1337. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1338. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1339. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1340. do { \
  1341. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1342. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1343. } while (0)
  1344. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1345. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1346. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1347. do { \
  1348. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1349. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1350. } while (0)
  1351. /* enums used in the HTT tx MSDU extension descriptor */
  1352. enum {
  1353. htt_tx_guard_interval_regular = 0,
  1354. htt_tx_guard_interval_short = 1,
  1355. };
  1356. enum {
  1357. htt_tx_preamble_type_ofdm = 0,
  1358. htt_tx_preamble_type_cck = 1,
  1359. htt_tx_preamble_type_ht = 2,
  1360. htt_tx_preamble_type_vht = 3,
  1361. };
  1362. enum {
  1363. htt_tx_bandwidth_5MHz = 0,
  1364. htt_tx_bandwidth_10MHz = 1,
  1365. htt_tx_bandwidth_20MHz = 2,
  1366. htt_tx_bandwidth_40MHz = 3,
  1367. htt_tx_bandwidth_80MHz = 4,
  1368. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1369. };
  1370. /**
  1371. * @brief HTT tx MSDU extension descriptor
  1372. * @details
  1373. * If the target supports HTT tx MSDU extension descriptors, the host has
  1374. * the option of appending the following struct following the regular
  1375. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1376. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1377. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1378. * tx specs for each frame.
  1379. */
  1380. PREPACK struct htt_tx_msdu_desc_ext_t {
  1381. /* DWORD 0: flags */
  1382. A_UINT32
  1383. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1384. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1385. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1386. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1387. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1388. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1389. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1390. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1391. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1392. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1393. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1394. /* DWORD 1: tx power, tx rate, tx BW */
  1395. A_UINT32
  1396. /* pwr -
  1397. * Specify what power the tx frame needs to be transmitted at.
  1398. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1399. * The value needs to be appropriately sign-extended when extracting
  1400. * the value from the message and storing it in a variable that is
  1401. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1402. * automatically handles this sign-extension.)
  1403. * If the transmission uses multiple tx chains, this power spec is
  1404. * the total transmit power, assuming incoherent combination of
  1405. * per-chain power to produce the total power.
  1406. */
  1407. pwr: 8,
  1408. /* mcs_mask -
  1409. * Specify the allowable values for MCS index (modulation and coding)
  1410. * to use for transmitting the frame.
  1411. *
  1412. * For HT / VHT preamble types, this mask directly corresponds to
  1413. * the HT or VHT MCS indices that are allowed. For each bit N set
  1414. * within the mask, MCS index N is allowed for transmitting the frame.
  1415. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1416. * rates versus OFDM rates, so the host has the option of specifying
  1417. * that the target must transmit the frame with CCK or OFDM rates
  1418. * (not HT or VHT), but leaving the decision to the target whether
  1419. * to use CCK or OFDM.
  1420. *
  1421. * For CCK and OFDM, the bits within this mask are interpreted as
  1422. * follows:
  1423. * bit 0 -> CCK 1 Mbps rate is allowed
  1424. * bit 1 -> CCK 2 Mbps rate is allowed
  1425. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1426. * bit 3 -> CCK 11 Mbps rate is allowed
  1427. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1428. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1429. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1430. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1431. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1432. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1433. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1434. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1435. *
  1436. * The MCS index specification needs to be compatible with the
  1437. * bandwidth mask specification. For example, a MCS index == 9
  1438. * specification is inconsistent with a preamble type == VHT,
  1439. * Nss == 1, and channel bandwidth == 20 MHz.
  1440. *
  1441. * Furthermore, the host has only a limited ability to specify to
  1442. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1443. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1444. */
  1445. mcs_mask: 12,
  1446. /* nss_mask -
  1447. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1448. * Each bit in this mask corresponds to a Nss value:
  1449. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1450. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1451. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1452. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1453. * The values in the Nss mask must be suitable for the recipient, e.g.
  1454. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1455. * recipient which only supports 2x2 MIMO.
  1456. */
  1457. nss_mask: 4,
  1458. /* guard_interval -
  1459. * Specify a htt_tx_guard_interval enum value to indicate whether
  1460. * the transmission should use a regular guard interval or a
  1461. * short guard interval.
  1462. */
  1463. guard_interval: 1,
  1464. /* preamble_type_mask -
  1465. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1466. * may choose from for transmitting this frame.
  1467. * The bits in this mask correspond to the values in the
  1468. * htt_tx_preamble_type enum. For example, to allow the target
  1469. * to transmit the frame as either CCK or OFDM, this field would
  1470. * be set to
  1471. * (1 << htt_tx_preamble_type_ofdm) |
  1472. * (1 << htt_tx_preamble_type_cck)
  1473. */
  1474. preamble_type_mask: 4,
  1475. reserved1_31_29: 3; /* unused, set to 0x0 */
  1476. /* DWORD 2: tx chain mask, tx retries */
  1477. A_UINT32
  1478. /* chain_mask - specify which chains to transmit from */
  1479. chain_mask: 4,
  1480. /* retry_limit -
  1481. * Specify the maximum number of transmissions, including the
  1482. * initial transmission, to attempt before giving up if no ack
  1483. * is received.
  1484. * If the tx rate is specified, then all retries shall use the
  1485. * same rate as the initial transmission.
  1486. * If no tx rate is specified, the target can choose whether to
  1487. * retain the original rate during the retransmissions, or to
  1488. * fall back to a more robust rate.
  1489. */
  1490. retry_limit: 4,
  1491. /* bandwidth_mask -
  1492. * Specify what channel widths may be used for the transmission.
  1493. * A value of zero indicates "don't care" - the target may choose
  1494. * the transmission bandwidth.
  1495. * The bits within this mask correspond to the htt_tx_bandwidth
  1496. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1497. * The bandwidth_mask must be consistent with the preamble_type_mask
  1498. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1499. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1500. */
  1501. bandwidth_mask: 6,
  1502. reserved2_31_14: 18; /* unused, set to 0x0 */
  1503. /* DWORD 3: tx expiry time (TSF) LSBs */
  1504. A_UINT32 expire_tsf_lo;
  1505. /* DWORD 4: tx expiry time (TSF) MSBs */
  1506. A_UINT32 expire_tsf_hi;
  1507. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1508. } POSTPACK;
  1509. /* DWORD 0 */
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1530. /* DWORD 1 */
  1531. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1532. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1533. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1534. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1535. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1536. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1537. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1538. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1539. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1540. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1541. /* DWORD 2 */
  1542. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1543. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1544. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1545. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1546. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1547. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1548. /* DWORD 0 */
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1550. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1551. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1553. do { \
  1554. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1555. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1556. } while (0)
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1558. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1559. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1561. do { \
  1562. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1563. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1564. } while (0)
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1566. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1567. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1569. do { \
  1570. HTT_CHECK_SET_VAL( \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1572. ((_var) |= ((_val) \
  1573. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1574. } while (0)
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1576. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1577. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1579. do { \
  1580. HTT_CHECK_SET_VAL( \
  1581. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1582. ((_var) |= ((_val) \
  1583. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1587. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1592. } while (0)
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1595. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1596. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1599. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1600. } while (0)
  1601. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1602. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1603. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1604. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1607. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1608. } while (0)
  1609. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1610. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1611. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1612. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1613. do { \
  1614. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1615. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1616. } while (0)
  1617. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1618. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1619. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1620. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1621. do { \
  1622. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1623. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1624. } while (0)
  1625. /* DWORD 1 */
  1626. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1628. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1629. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1630. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1631. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1632. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1633. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1634. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1635. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1637. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1638. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1645. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1646. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1653. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1654. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1661. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1662. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1666. } while (0)
  1667. /* DWORD 2 */
  1668. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1670. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1671. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1675. } while (0)
  1676. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1677. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1678. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1679. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1680. do { \
  1681. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1682. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1683. } while (0)
  1684. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1685. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1686. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1687. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1688. do { \
  1689. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1690. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1691. } while (0)
  1692. typedef enum {
  1693. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1694. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1695. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1696. } htt_11ax_ltf_subtype_t;
  1697. typedef enum {
  1698. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1699. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1700. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1701. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1702. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1703. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1704. } htt_tx_ext2_preamble_type_t;
  1705. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1706. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1707. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1708. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1709. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1717. /**
  1718. * @brief HTT tx MSDU extension descriptor v2
  1719. * @details
  1720. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1721. * is received as tcl_exit_base->host_meta_info in firmware.
  1722. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1723. * are already part of tcl_exit_base.
  1724. */
  1725. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1726. /* DWORD 0: flags */
  1727. A_UINT32
  1728. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1729. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1730. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1731. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1732. valid_retries : 1, /* if set, tx retries spec is valid */
  1733. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1734. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1735. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1736. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1737. valid_key_flags : 1, /* if set, key flags is valid */
  1738. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1739. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1740. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1741. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1742. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1743. 1 = ENCRYPT,
  1744. 2 ~ 3 - Reserved */
  1745. /* retry_limit -
  1746. * Specify the maximum number of transmissions, including the
  1747. * initial transmission, to attempt before giving up if no ack
  1748. * is received.
  1749. * If the tx rate is specified, then all retries shall use the
  1750. * same rate as the initial transmission.
  1751. * If no tx rate is specified, the target can choose whether to
  1752. * retain the original rate during the retransmissions, or to
  1753. * fall back to a more robust rate.
  1754. */
  1755. retry_limit : 4,
  1756. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1757. * Valid only for 11ax preamble types HE_SU
  1758. * and HE_EXT_SU
  1759. */
  1760. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1761. * Valid only for 11ax preamble types HE_SU
  1762. * and HE_EXT_SU
  1763. */
  1764. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1765. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1766. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1767. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1768. */
  1769. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1770. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1771. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1772. * Use cases:
  1773. * Any time firmware uses TQM-BYPASS for Data
  1774. * TID, firmware expect host to set this bit.
  1775. */
  1776. /* DWORD 1: tx power, tx rate */
  1777. A_UINT32
  1778. power : 8, /* unit of the power field is 0.5 dbm
  1779. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1780. * signed value ranging from -64dbm to 63.5 dbm
  1781. */
  1782. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1783. * Setting more than one MCS isn't currently
  1784. * supported by the target (but is supported
  1785. * in the interface in case in the future
  1786. * the target supports specifications of
  1787. * a limited set of MCS values.
  1788. */
  1789. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1790. * Setting more than one Nss isn't currently
  1791. * supported by the target (but is supported
  1792. * in the interface in case in the future
  1793. * the target supports specifications of
  1794. * a limited set of Nss values.
  1795. */
  1796. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1797. update_peer_cache : 1; /* When set these custom values will be
  1798. * used for all packets, until the next
  1799. * update via this ext header.
  1800. * This is to make sure not all packets
  1801. * need to include this header.
  1802. */
  1803. /* DWORD 2: tx chain mask, tx retries */
  1804. A_UINT32
  1805. /* chain_mask - specify which chains to transmit from */
  1806. chain_mask : 8,
  1807. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1808. * TODO: Update Enum values for key_flags
  1809. */
  1810. /*
  1811. * Channel frequency: This identifies the desired channel
  1812. * frequency (in MHz) for tx frames. This is used by FW to help
  1813. * determine when it is safe to transmit or drop frames for
  1814. * off-channel operation.
  1815. * The default value of zero indicates to FW that the corresponding
  1816. * VDEV's home channel (if there is one) is the desired channel
  1817. * frequency.
  1818. */
  1819. chanfreq : 16;
  1820. /* DWORD 3: tx expiry time (TSF) LSBs */
  1821. A_UINT32 expire_tsf_lo;
  1822. /* DWORD 4: tx expiry time (TSF) MSBs */
  1823. A_UINT32 expire_tsf_hi;
  1824. /* DWORD 5: flags to control routing / processing of the MSDU */
  1825. A_UINT32
  1826. /* learning_frame
  1827. * When this flag is set, this frame will be dropped by FW
  1828. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1829. */
  1830. learning_frame : 1,
  1831. /* send_as_standalone
  1832. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1833. * i.e. with no A-MSDU or A-MPDU aggregation.
  1834. * The scope is extended to other use-cases.
  1835. */
  1836. send_as_standalone : 1,
  1837. /* is_host_opaque_valid
  1838. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1839. * with valid information.
  1840. */
  1841. is_host_opaque_valid : 1,
  1842. traffic_end_indication: 1,
  1843. rsvd0 : 28;
  1844. /* DWORD 6 : Host opaque cookie for special frames */
  1845. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1846. rsvd1 : 16;
  1847. /*
  1848. * This structure can be expanded further up to 40 bytes
  1849. * by adding further DWORDs as needed.
  1850. */
  1851. } POSTPACK;
  1852. /* DWORD 0 */
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1879. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1880. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1881. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1882. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1883. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1884. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1885. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1886. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1887. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1888. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1889. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1890. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1891. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1892. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1893. /* DWORD 1 */
  1894. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1895. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1896. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1897. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1898. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1899. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1900. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1901. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1902. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1903. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1904. /* DWORD 2 */
  1905. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1906. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1907. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1908. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1909. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1910. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1911. /* DWORD 5 */
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1918. /* DWORD 6 */
  1919. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1920. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1921. /* DWORD 0 */
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1923. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1924. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1944. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1945. } while (0)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1947. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1948. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1950. do { \
  1951. HTT_CHECK_SET_VAL( \
  1952. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1953. ((_var) |= ((_val) \
  1954. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1955. } while (0)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1957. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1958. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1963. } while (0)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1965. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1966. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1970. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1971. } while (0)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1973. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1974. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1976. do { \
  1977. HTT_CHECK_SET_VAL( \
  1978. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1979. ((_var) |= ((_val) \
  1980. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1981. } while (0)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1983. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1984. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1989. } while (0)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1991. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1992. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1993. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1997. } while (0)
  1998. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1999. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2000. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2001. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2005. } while (0)
  2006. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2007. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2008. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2009. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2013. } while (0)
  2014. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2015. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2016. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2017. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2018. do { \
  2019. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2020. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2021. } while (0)
  2022. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2023. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2024. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2025. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2026. do { \
  2027. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2028. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2029. } while (0)
  2030. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2031. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2032. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2033. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2034. do { \
  2035. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2036. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2037. } while (0)
  2038. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2039. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2040. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2041. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2042. do { \
  2043. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2044. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2045. } while (0)
  2046. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2047. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2048. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2049. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2050. do { \
  2051. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2052. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2053. } while (0)
  2054. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2055. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2056. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2057. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2061. } while (0)
  2062. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2069. } while (0)
  2070. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2077. } while (0)
  2078. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2079. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2080. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2081. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2085. } while (0)
  2086. /* DWORD 1 */
  2087. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2088. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2089. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2090. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2091. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2092. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2093. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2094. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2095. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2096. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2103. } while (0)
  2104. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2105. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2106. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2107. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2111. } while (0)
  2112. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2113. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2114. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2115. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2116. do { \
  2117. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2118. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2119. } while (0)
  2120. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2121. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2122. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2123. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2127. } while (0)
  2128. /* DWORD 2 */
  2129. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2130. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2131. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2132. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2133. do { \
  2134. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2135. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2136. } while (0)
  2137. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2138. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2139. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2140. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2141. do { \
  2142. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2143. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2144. } while (0)
  2145. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2146. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2147. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2148. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2149. do { \
  2150. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2151. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2152. } while (0)
  2153. /* DWORD 5 */
  2154. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2155. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2156. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2157. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2158. do { \
  2159. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2160. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2161. } while (0)
  2162. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2163. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2164. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2165. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2169. } while (0)
  2170. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2171. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2172. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2173. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2177. } while (0)
  2178. /* DWORD 6 */
  2179. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2180. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2181. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2182. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2186. } while (0)
  2187. typedef enum {
  2188. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2189. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2190. } htt_tcl_metadata_type;
  2191. /**
  2192. * @brief HTT TCL command number format
  2193. * @details
  2194. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2195. * available to firmware as tcl_exit_base->tcl_status_number.
  2196. * For regular / multicast packets host will send vdev and mac id and for
  2197. * NAWDS packets, host will send peer id.
  2198. * A_UINT32 is used to avoid endianness conversion problems.
  2199. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2200. */
  2201. typedef struct {
  2202. A_UINT32
  2203. type: 1, /* vdev_id based or peer_id based */
  2204. rsvd: 31;
  2205. } htt_tx_tcl_vdev_or_peer_t;
  2206. typedef struct {
  2207. A_UINT32
  2208. type: 1, /* vdev_id based or peer_id based */
  2209. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2210. vdev_id: 8,
  2211. pdev_id: 2,
  2212. host_inspected:1,
  2213. rsvd: 19;
  2214. } htt_tx_tcl_vdev_metadata;
  2215. typedef struct {
  2216. A_UINT32
  2217. type: 1, /* vdev_id based or peer_id based */
  2218. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2219. peer_id: 14,
  2220. rsvd: 16;
  2221. } htt_tx_tcl_peer_metadata;
  2222. PREPACK struct htt_tx_tcl_metadata {
  2223. union {
  2224. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2225. htt_tx_tcl_vdev_metadata vdev_meta;
  2226. htt_tx_tcl_peer_metadata peer_meta;
  2227. };
  2228. } POSTPACK;
  2229. /* DWORD 0 */
  2230. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2231. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2232. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2233. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2234. /* VDEV metadata */
  2235. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2236. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2237. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2238. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2239. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2240. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2241. /* PEER metadata */
  2242. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2243. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2244. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2245. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2246. HTT_TX_TCL_METADATA_TYPE_S)
  2247. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2248. do { \
  2249. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2250. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2251. } while (0)
  2252. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2253. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2254. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2255. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2256. do { \
  2257. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2258. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2259. } while (0)
  2260. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2261. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2262. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2263. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2264. do { \
  2265. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2266. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2267. } while (0)
  2268. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2269. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2270. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2271. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2275. } while (0)
  2276. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2277. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2278. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2279. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2283. } while (0)
  2284. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2285. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2286. HTT_TX_TCL_METADATA_PEER_ID_S)
  2287. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2291. } while (0)
  2292. /*------------------------------------------------------------------
  2293. * V2 Version of TCL Data Command
  2294. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2295. * MLO global_seq all flavours of TCL Data Cmd.
  2296. *-----------------------------------------------------------------*/
  2297. typedef enum {
  2298. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2299. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2300. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2301. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2302. } htt_tcl_metadata_type_v2;
  2303. /**
  2304. * @brief HTT TCL command number format
  2305. * @details
  2306. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2307. * available to firmware as tcl_exit_base->tcl_status_number.
  2308. * A_UINT32 is used to avoid endianness conversion problems.
  2309. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2310. */
  2311. typedef struct {
  2312. A_UINT32
  2313. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2314. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2315. vdev_id: 8,
  2316. pdev_id: 2,
  2317. host_inspected:1,
  2318. rsvd: 2,
  2319. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2320. } htt_tx_tcl_vdev_metadata_v2;
  2321. typedef struct {
  2322. A_UINT32
  2323. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2324. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2325. peer_id: 13,
  2326. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2327. } htt_tx_tcl_peer_metadata_v2;
  2328. typedef struct {
  2329. A_UINT32
  2330. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2331. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2332. svc_class_id: 8,
  2333. rsvd: 5,
  2334. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2335. } htt_tx_tcl_svc_class_id_metadata;
  2336. typedef struct {
  2337. A_UINT32
  2338. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2339. host_inspected: 1,
  2340. global_seq_no: 12,
  2341. rsvd: 1,
  2342. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2343. } htt_tx_tcl_global_seq_metadata;
  2344. PREPACK struct htt_tx_tcl_metadata_v2 {
  2345. union {
  2346. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2347. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2348. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2349. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2350. };
  2351. } POSTPACK;
  2352. /* DWORD 0 */
  2353. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2354. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2355. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2356. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2357. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2358. /* VDEV V2 metadata */
  2359. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2360. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2361. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2362. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2363. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2364. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2365. /* PEER V2 metadata */
  2366. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2367. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2368. /* SVC_CLASS_ID metadata */
  2369. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2370. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2371. /* Global Seq no metadata */
  2372. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2373. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2374. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2375. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2376. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2377. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2378. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2379. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2380. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2381. do { \
  2382. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2383. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2384. } while (0)
  2385. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2386. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2387. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2388. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2389. do { \
  2390. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2391. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2392. } while (0)
  2393. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2394. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2395. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2396. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2397. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2398. do { \
  2399. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2400. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2401. } while (0)
  2402. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2403. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2404. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2405. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2406. do { \
  2407. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2408. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2409. } while (0)
  2410. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2411. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2412. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2413. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2414. do { \
  2415. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2416. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2417. } while (0)
  2418. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2419. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2420. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2421. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2422. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2423. do { \
  2424. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2425. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2426. } while (0)
  2427. /*----- Get and Set V2 type field in Service Class fields ----*/
  2428. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2429. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2430. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2431. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2435. } while (0)
  2436. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2437. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2438. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2439. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2440. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2441. do { \
  2442. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2443. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2444. } while (0)
  2445. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2446. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2447. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2448. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2449. do { \
  2450. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2451. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2452. } while (0)
  2453. /*------------------------------------------------------------------
  2454. * End V2 Version of TCL Data Command
  2455. *-----------------------------------------------------------------*/
  2456. typedef enum {
  2457. HTT_TX_FW2WBM_TX_STATUS_OK,
  2458. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2459. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2460. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2461. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2462. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2463. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2464. HTT_TX_FW2WBM_TX_STATUS_MAX
  2465. } htt_tx_fw2wbm_tx_status_t;
  2466. typedef enum {
  2467. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2468. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2469. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2470. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2471. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2472. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2473. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2474. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2475. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2476. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2477. } htt_tx_fw2wbm_reinject_reason_t;
  2478. /**
  2479. * @brief HTT TX WBM Completion from firmware to host
  2480. * @details
  2481. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2482. * DWORD 3 and 4 for software based completions (Exception frames and
  2483. * TQM bypass frames)
  2484. * For software based completions, wbm_release_ring->release_source_module will
  2485. * be set to release_source_fw
  2486. */
  2487. PREPACK struct htt_tx_wbm_completion {
  2488. A_UINT32
  2489. sch_cmd_id: 24,
  2490. exception_frame: 1, /* If set, this packet was queued via exception path */
  2491. rsvd0_31_25: 7;
  2492. A_UINT32
  2493. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2494. * reception of an ACK or BA, this field indicates
  2495. * the RSSI of the received ACK or BA frame.
  2496. * When the frame is removed as result of a direct
  2497. * remove command from the SW, this field is set
  2498. * to 0x0 (which is never a valid value when real
  2499. * RSSI is available).
  2500. * Units: dB w.r.t noise floor
  2501. */
  2502. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2503. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2504. rsvd1_31_16: 16;
  2505. } POSTPACK;
  2506. /* DWORD 0 */
  2507. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2508. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2509. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2510. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2511. /* DWORD 1 */
  2512. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2513. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2514. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2515. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2516. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2517. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2518. /* DWORD 0 */
  2519. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2520. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2521. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2522. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2523. do { \
  2524. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2525. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2526. } while (0)
  2527. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2528. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2529. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2530. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2531. do { \
  2532. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2533. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2534. } while (0)
  2535. /* DWORD 1 */
  2536. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2537. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2538. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2539. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2540. do { \
  2541. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2542. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2543. } while (0)
  2544. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2545. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2546. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2547. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2548. do { \
  2549. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2550. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2551. } while (0)
  2552. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2553. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2554. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2555. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2556. do { \
  2557. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2558. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2559. } while (0)
  2560. /**
  2561. * @brief HTT TX WBM Completion from firmware to host
  2562. * @details
  2563. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2564. * (WBM) offload HW.
  2565. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2566. * For software based completions, release_source_module will
  2567. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2568. * struct wbm_release_ring and then switch to this after looking at
  2569. * release_source_module.
  2570. */
  2571. PREPACK struct htt_tx_wbm_completion_v2 {
  2572. A_UINT32
  2573. used_by_hw0; /* Refer to struct wbm_release_ring */
  2574. A_UINT32
  2575. used_by_hw1; /* Refer to struct wbm_release_ring */
  2576. A_UINT32
  2577. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2578. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2579. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2580. exception_frame: 1,
  2581. rsvd0: 12, /* For future use */
  2582. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2583. rsvd1: 1; /* For future use */
  2584. A_UINT32
  2585. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2586. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2587. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2588. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2589. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2590. */
  2591. A_UINT32
  2592. data1: 32;
  2593. A_UINT32
  2594. data2: 32;
  2595. A_UINT32
  2596. used_by_hw3; /* Refer to struct wbm_release_ring */
  2597. } POSTPACK;
  2598. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2599. /* DWORD 3 */
  2600. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2601. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2602. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2603. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2604. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2605. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2606. /* DWORD 3 */
  2607. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2608. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2609. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2610. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2611. do { \
  2612. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2613. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2614. } while (0)
  2615. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2616. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2617. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2618. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2619. do { \
  2620. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2621. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2622. } while (0)
  2623. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2624. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2625. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2626. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2627. do { \
  2628. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2629. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2630. } while (0)
  2631. /**
  2632. * @brief HTT TX WBM Completion from firmware to host (V3)
  2633. * @details
  2634. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2635. * (WBM) offload HW.
  2636. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2637. * For software based completions, release_source_module will
  2638. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2639. * struct wbm_release_ring and then switch to this after looking at
  2640. * release_source_module.
  2641. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2642. * by new generations of targets.
  2643. */
  2644. PREPACK struct htt_tx_wbm_completion_v3 {
  2645. A_UINT32
  2646. used_by_hw0; /* Refer to struct wbm_release_ring */
  2647. A_UINT32
  2648. used_by_hw1; /* Refer to struct wbm_release_ring */
  2649. A_UINT32
  2650. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2651. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2652. used_by_hw3: 15;
  2653. A_UINT32
  2654. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2655. exception_frame: 1,
  2656. rsvd0: 27; /* For future use */
  2657. A_UINT32
  2658. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2659. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2660. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2661. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2662. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2663. */
  2664. A_UINT32
  2665. data1: 32;
  2666. A_UINT32
  2667. data2: 32;
  2668. A_UINT32
  2669. rsvd1: 20,
  2670. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2671. } POSTPACK;
  2672. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2673. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2674. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2675. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2676. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2677. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2678. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2679. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2680. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2681. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2682. do { \
  2683. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2684. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2685. } while (0)
  2686. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2687. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2688. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2689. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2690. do { \
  2691. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2692. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2693. } while (0)
  2694. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2695. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2696. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2697. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2698. do { \
  2699. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2700. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2701. } while (0)
  2702. typedef enum {
  2703. TX_FRAME_TYPE_UNDEFINED = 0,
  2704. TX_FRAME_TYPE_EAPOL = 1,
  2705. } htt_tx_wbm_status_frame_type;
  2706. /**
  2707. * @brief HTT TX WBM transmit status from firmware to host
  2708. * @details
  2709. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2710. * (WBM) offload HW.
  2711. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2712. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2713. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2714. */
  2715. PREPACK struct htt_tx_wbm_transmit_status {
  2716. A_UINT32
  2717. sch_cmd_id: 24,
  2718. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2719. * reception of an ACK or BA, this field indicates
  2720. * the RSSI of the received ACK or BA frame.
  2721. * When the frame is removed as result of a direct
  2722. * remove command from the SW, this field is set
  2723. * to 0x0 (which is never a valid value when real
  2724. * RSSI is available).
  2725. * Units: dB w.r.t noise floor
  2726. */
  2727. A_UINT32
  2728. sw_peer_id: 16,
  2729. tid_num: 5,
  2730. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2731. * and tid_num fields contain valid data.
  2732. * If this "valid" flag is not set, the
  2733. * sw_peer_id and tid_num fields must be ignored.
  2734. */
  2735. mcast: 1,
  2736. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2737. * contains valid data.
  2738. */
  2739. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2740. reserved: 4;
  2741. A_UINT32
  2742. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2743. * packets in the wbm completion path
  2744. */
  2745. } POSTPACK;
  2746. /* DWORD 4 */
  2747. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2748. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2749. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2750. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2751. /* DWORD 5 */
  2752. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2753. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2754. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2755. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2756. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2757. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2758. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2759. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2760. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2761. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2762. /* DWORD 4 */
  2763. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2764. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2765. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2766. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2769. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2770. } while (0)
  2771. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2772. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2773. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2774. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2777. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2778. } while (0)
  2779. /* DWORD 5 */
  2780. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2781. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2782. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2783. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2784. do { \
  2785. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2786. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2787. } while (0)
  2788. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2789. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2790. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2791. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2792. do { \
  2793. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2794. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2795. } while (0)
  2796. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2797. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2798. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2799. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2800. do { \
  2801. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2802. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2803. } while (0)
  2804. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2805. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2806. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2807. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2808. do { \
  2809. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2810. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2811. } while (0)
  2812. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2813. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2814. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2815. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2816. do { \
  2817. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2818. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2819. } while (0)
  2820. /**
  2821. * @brief HTT TX WBM reinject status from firmware to host
  2822. * @details
  2823. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2824. * (WBM) offload HW.
  2825. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2826. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2827. */
  2828. PREPACK struct htt_tx_wbm_reinject_status {
  2829. A_UINT32
  2830. reserved0: 32;
  2831. A_UINT32
  2832. reserved1: 32;
  2833. A_UINT32
  2834. reserved2: 32;
  2835. } POSTPACK;
  2836. /**
  2837. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2838. * @details
  2839. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2840. * (WBM) offload HW.
  2841. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2842. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2843. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2844. * STA side.
  2845. */
  2846. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2847. A_UINT32
  2848. mec_sa_addr_31_0;
  2849. A_UINT32
  2850. mec_sa_addr_47_32: 16,
  2851. sa_ast_index: 16;
  2852. A_UINT32
  2853. vdev_id: 8,
  2854. reserved0: 24;
  2855. } POSTPACK;
  2856. /* DWORD 4 - mec_sa_addr_31_0 */
  2857. /* DWORD 5 */
  2858. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2859. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2860. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2861. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2862. /* DWORD 6 */
  2863. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2864. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2865. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2866. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2867. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2868. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2869. do { \
  2870. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2871. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2872. } while (0)
  2873. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2874. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2875. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2876. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2877. do { \
  2878. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2879. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2880. } while (0)
  2881. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2882. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2883. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2884. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2885. do { \
  2886. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2887. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2888. } while (0)
  2889. typedef enum {
  2890. TX_FLOW_PRIORITY_BE,
  2891. TX_FLOW_PRIORITY_HIGH,
  2892. TX_FLOW_PRIORITY_LOW,
  2893. } htt_tx_flow_priority_t;
  2894. typedef enum {
  2895. TX_FLOW_LATENCY_SENSITIVE,
  2896. TX_FLOW_LATENCY_INSENSITIVE,
  2897. } htt_tx_flow_latency_t;
  2898. typedef enum {
  2899. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2900. TX_FLOW_INTERACTIVE_TRAFFIC,
  2901. TX_FLOW_PERIODIC_TRAFFIC,
  2902. TX_FLOW_BURSTY_TRAFFIC,
  2903. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2904. } htt_tx_flow_traffic_pattern_t;
  2905. /**
  2906. * @brief HTT TX Flow search metadata format
  2907. * @details
  2908. * Host will set this metadata in flow table's flow search entry along with
  2909. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2910. * firmware and TQM ring if the flow search entry wins.
  2911. * This metadata is available to firmware in that first MSDU's
  2912. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2913. * to one of the available flows for specific tid and returns the tqm flow
  2914. * pointer as part of htt_tx_map_flow_info message.
  2915. */
  2916. PREPACK struct htt_tx_flow_metadata {
  2917. A_UINT32
  2918. rsvd0_1_0: 2,
  2919. tid: 4,
  2920. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2921. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2922. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2923. * Else choose final tid based on latency, priority.
  2924. */
  2925. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2926. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2927. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2928. } POSTPACK;
  2929. /* DWORD 0 */
  2930. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2931. #define HTT_TX_FLOW_METADATA_TID_S 2
  2932. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2933. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2934. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2935. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2936. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2937. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2938. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2939. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2940. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2941. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2942. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2943. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2944. /* DWORD 0 */
  2945. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2946. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2947. HTT_TX_FLOW_METADATA_TID_S)
  2948. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2949. do { \
  2950. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2951. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2952. } while (0)
  2953. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2954. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2955. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2956. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2957. do { \
  2958. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2959. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2960. } while (0)
  2961. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2962. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2963. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2964. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2965. do { \
  2966. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2967. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2968. } while (0)
  2969. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2970. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2971. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2972. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2973. do { \
  2974. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2975. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2976. } while (0)
  2977. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2978. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2979. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2980. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2981. do { \
  2982. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2983. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2984. } while (0)
  2985. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2986. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2987. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2988. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2989. do { \
  2990. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2991. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2992. } while (0)
  2993. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2994. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2995. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2996. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2997. do { \
  2998. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2999. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3000. } while (0)
  3001. /**
  3002. * @brief host -> target ADD WDS Entry
  3003. *
  3004. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3005. *
  3006. * @brief host -> target DELETE WDS Entry
  3007. *
  3008. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3009. *
  3010. * @details
  3011. * HTT wds entry from source port learning
  3012. * Host will learn wds entries from rx and send this message to firmware
  3013. * to enable firmware to configure/delete AST entries for wds clients.
  3014. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3015. * and when SA's entry is deleted, firmware removes this AST entry
  3016. *
  3017. * The message would appear as follows:
  3018. *
  3019. * |31 30|29 |17 16|15 8|7 0|
  3020. * |----------------+----------------+----------------+----------------|
  3021. * | rsvd0 |PDVID| vdev_id | msg_type |
  3022. * |-------------------------------------------------------------------|
  3023. * | sa_addr_31_0 |
  3024. * |-------------------------------------------------------------------|
  3025. * | | ta_peer_id | sa_addr_47_32 |
  3026. * |-------------------------------------------------------------------|
  3027. * Where PDVID = pdev_id
  3028. *
  3029. * The message is interpreted as follows:
  3030. *
  3031. * dword0 - b'0:7 - msg_type: This will be set to
  3032. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3033. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3034. *
  3035. * dword0 - b'8:15 - vdev_id
  3036. *
  3037. * dword0 - b'16:17 - pdev_id
  3038. *
  3039. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3040. *
  3041. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3042. *
  3043. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3044. *
  3045. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3046. */
  3047. PREPACK struct htt_wds_entry {
  3048. A_UINT32
  3049. msg_type: 8,
  3050. vdev_id: 8,
  3051. pdev_id: 2,
  3052. rsvd0: 14;
  3053. A_UINT32 sa_addr_31_0;
  3054. A_UINT32
  3055. sa_addr_47_32: 16,
  3056. ta_peer_id: 14,
  3057. rsvd2: 2;
  3058. } POSTPACK;
  3059. /* DWORD 0 */
  3060. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3061. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3062. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3063. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3064. /* DWORD 2 */
  3065. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3066. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3067. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3068. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3069. /* DWORD 0 */
  3070. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3071. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3072. HTT_WDS_ENTRY_VDEV_ID_S)
  3073. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3074. do { \
  3075. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3076. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3077. } while (0)
  3078. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3079. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3080. HTT_WDS_ENTRY_PDEV_ID_S)
  3081. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3082. do { \
  3083. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3084. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3085. } while (0)
  3086. /* DWORD 2 */
  3087. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3088. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3089. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3090. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3091. do { \
  3092. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3093. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3094. } while (0)
  3095. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3096. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3097. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3098. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3099. do { \
  3100. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3101. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3102. } while (0)
  3103. /**
  3104. * @brief MAC DMA rx ring setup specification
  3105. *
  3106. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3107. *
  3108. * @details
  3109. * To allow for dynamic rx ring reconfiguration and to avoid race
  3110. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3111. * it uses. Instead, it sends this message to the target, indicating how
  3112. * the rx ring used by the host should be set up and maintained.
  3113. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3114. * specifications.
  3115. *
  3116. * |31 16|15 8|7 0|
  3117. * |---------------------------------------------------------------|
  3118. * header: | reserved | num rings | msg type |
  3119. * |---------------------------------------------------------------|
  3120. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3121. #if HTT_PADDR64
  3122. * | FW_IDX shadow register physical address (bits 63:32) |
  3123. #endif
  3124. * |---------------------------------------------------------------|
  3125. * | rx ring base physical address (bits 31:0) |
  3126. #if HTT_PADDR64
  3127. * | rx ring base physical address (bits 63:32) |
  3128. #endif
  3129. * |---------------------------------------------------------------|
  3130. * | rx ring buffer size | rx ring length |
  3131. * |---------------------------------------------------------------|
  3132. * | FW_IDX initial value | enabled flags |
  3133. * |---------------------------------------------------------------|
  3134. * | MSDU payload offset | 802.11 header offset |
  3135. * |---------------------------------------------------------------|
  3136. * | PPDU end offset | PPDU start offset |
  3137. * |---------------------------------------------------------------|
  3138. * | MPDU end offset | MPDU start offset |
  3139. * |---------------------------------------------------------------|
  3140. * | MSDU end offset | MSDU start offset |
  3141. * |---------------------------------------------------------------|
  3142. * | frag info offset | rx attention offset |
  3143. * |---------------------------------------------------------------|
  3144. * payload 2, if present, has the same format as payload 1
  3145. * Header fields:
  3146. * - MSG_TYPE
  3147. * Bits 7:0
  3148. * Purpose: identifies this as an rx ring configuration message
  3149. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3150. * - NUM_RINGS
  3151. * Bits 15:8
  3152. * Purpose: indicates whether the host is setting up one rx ring or two
  3153. * Value: 1 or 2
  3154. * Payload:
  3155. * for systems using 64-bit format for bus addresses:
  3156. * - IDX_SHADOW_REG_PADDR_LO
  3157. * Bits 31:0
  3158. * Value: lower 4 bytes of physical address of the host's
  3159. * FW_IDX shadow register
  3160. * - IDX_SHADOW_REG_PADDR_HI
  3161. * Bits 31:0
  3162. * Value: upper 4 bytes of physical address of the host's
  3163. * FW_IDX shadow register
  3164. * - RING_BASE_PADDR_LO
  3165. * Bits 31:0
  3166. * Value: lower 4 bytes of physical address of the host's rx ring
  3167. * - RING_BASE_PADDR_HI
  3168. * Bits 31:0
  3169. * Value: uppper 4 bytes of physical address of the host's rx ring
  3170. * for systems using 32-bit format for bus addresses:
  3171. * - IDX_SHADOW_REG_PADDR
  3172. * Bits 31:0
  3173. * Value: physical address of the host's FW_IDX shadow register
  3174. * - RING_BASE_PADDR
  3175. * Bits 31:0
  3176. * Value: physical address of the host's rx ring
  3177. * - RING_LEN
  3178. * Bits 15:0
  3179. * Value: number of elements in the rx ring
  3180. * - RING_BUF_SZ
  3181. * Bits 31:16
  3182. * Value: size of the buffers referenced by the rx ring, in byte units
  3183. * - ENABLED_FLAGS
  3184. * Bits 15:0
  3185. * Value: 1-bit flags to show whether different rx fields are enabled
  3186. * bit 0: 802.11 header enabled (1) or disabled (0)
  3187. * bit 1: MSDU payload enabled (1) or disabled (0)
  3188. * bit 2: PPDU start enabled (1) or disabled (0)
  3189. * bit 3: PPDU end enabled (1) or disabled (0)
  3190. * bit 4: MPDU start enabled (1) or disabled (0)
  3191. * bit 5: MPDU end enabled (1) or disabled (0)
  3192. * bit 6: MSDU start enabled (1) or disabled (0)
  3193. * bit 7: MSDU end enabled (1) or disabled (0)
  3194. * bit 8: rx attention enabled (1) or disabled (0)
  3195. * bit 9: frag info enabled (1) or disabled (0)
  3196. * bit 10: unicast rx enabled (1) or disabled (0)
  3197. * bit 11: multicast rx enabled (1) or disabled (0)
  3198. * bit 12: ctrl rx enabled (1) or disabled (0)
  3199. * bit 13: mgmt rx enabled (1) or disabled (0)
  3200. * bit 14: null rx enabled (1) or disabled (0)
  3201. * bit 15: phy data rx enabled (1) or disabled (0)
  3202. * - IDX_INIT_VAL
  3203. * Bits 31:16
  3204. * Purpose: Specify the initial value for the FW_IDX.
  3205. * Value: the number of buffers initially present in the host's rx ring
  3206. * - OFFSET_802_11_HDR
  3207. * Bits 15:0
  3208. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3209. * - OFFSET_MSDU_PAYLOAD
  3210. * Bits 31:16
  3211. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3212. * - OFFSET_PPDU_START
  3213. * Bits 15:0
  3214. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3215. * - OFFSET_PPDU_END
  3216. * Bits 31:16
  3217. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3218. * - OFFSET_MPDU_START
  3219. * Bits 15:0
  3220. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3221. * - OFFSET_MPDU_END
  3222. * Bits 31:16
  3223. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3224. * - OFFSET_MSDU_START
  3225. * Bits 15:0
  3226. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3227. * - OFFSET_MSDU_END
  3228. * Bits 31:16
  3229. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3230. * - OFFSET_RX_ATTN
  3231. * Bits 15:0
  3232. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3233. * - OFFSET_FRAG_INFO
  3234. * Bits 31:16
  3235. * Value: offset in QUAD-bytes of frag info table
  3236. */
  3237. /* header fields */
  3238. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3239. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3240. /* payload fields */
  3241. /* for systems using a 64-bit format for bus addresses */
  3242. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3243. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3244. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3245. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3246. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3247. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3248. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3249. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3250. /* for systems using a 32-bit format for bus addresses */
  3251. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3252. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3253. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3254. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3255. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3256. #define HTT_RX_RING_CFG_LEN_S 0
  3257. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3258. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3259. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3260. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3261. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3262. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3263. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3264. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3265. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3266. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3267. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3268. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3269. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3270. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3271. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3272. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3273. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3274. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3275. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3276. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3277. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3278. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3279. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3280. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3281. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3282. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3283. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3284. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3285. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3286. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3287. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3288. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3289. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3290. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3291. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3292. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3293. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3294. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3295. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3296. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3297. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3298. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3299. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3300. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3301. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3302. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3303. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3304. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3305. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3306. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3307. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3308. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3309. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3310. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3311. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3312. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3313. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3314. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3315. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3316. #if HTT_PADDR64
  3317. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3318. #else
  3319. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3320. #endif
  3321. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3322. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3323. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3324. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3325. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3328. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3329. } while (0)
  3330. /* degenerate case for 32-bit fields */
  3331. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3332. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3333. ((_var) = (_val))
  3334. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3335. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3336. ((_var) = (_val))
  3337. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3338. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3339. ((_var) = (_val))
  3340. /* degenerate case for 32-bit fields */
  3341. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3342. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3343. ((_var) = (_val))
  3344. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3345. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3346. ((_var) = (_val))
  3347. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3348. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3349. ((_var) = (_val))
  3350. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3351. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3352. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3353. do { \
  3354. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3355. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3356. } while (0)
  3357. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3358. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3359. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3360. do { \
  3361. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3362. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3363. } while (0)
  3364. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3365. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3366. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3367. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3368. do { \
  3369. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3370. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3371. } while (0)
  3372. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3373. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3374. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3375. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3376. do { \
  3377. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3378. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3379. } while (0)
  3380. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3381. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3382. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3383. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3384. do { \
  3385. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3386. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3387. } while (0)
  3388. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3389. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3390. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3391. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3392. do { \
  3393. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3394. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3395. } while (0)
  3396. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3397. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3398. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3399. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3400. do { \
  3401. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3402. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3403. } while (0)
  3404. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3405. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3406. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3407. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3408. do { \
  3409. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3410. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3411. } while (0)
  3412. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3413. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3414. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3415. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3416. do { \
  3417. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3418. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3419. } while (0)
  3420. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3421. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3422. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3423. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3424. do { \
  3425. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3426. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3427. } while (0)
  3428. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3429. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3430. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3431. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3432. do { \
  3433. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3434. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3435. } while (0)
  3436. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3437. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3438. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3439. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3440. do { \
  3441. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3442. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3443. } while (0)
  3444. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3445. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3446. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3447. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3448. do { \
  3449. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3450. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3451. } while (0)
  3452. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3453. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3454. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3455. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3456. do { \
  3457. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3458. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3459. } while (0)
  3460. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3461. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3462. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3463. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3464. do { \
  3465. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3466. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3467. } while (0)
  3468. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3469. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3470. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3471. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3472. do { \
  3473. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3474. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3475. } while (0)
  3476. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3477. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3478. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3479. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3480. do { \
  3481. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3482. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3483. } while (0)
  3484. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3485. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3486. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3487. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3488. do { \
  3489. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3490. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3491. } while (0)
  3492. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3493. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3494. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3495. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3496. do { \
  3497. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3498. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3499. } while (0)
  3500. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3501. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3502. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3503. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3504. do { \
  3505. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3506. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3507. } while (0)
  3508. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3509. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3510. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3511. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3512. do { \
  3513. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3514. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3515. } while (0)
  3516. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3517. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3518. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3519. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3522. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3523. } while (0)
  3524. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3525. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3526. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3527. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3528. do { \
  3529. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3530. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3531. } while (0)
  3532. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3533. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3534. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3535. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3538. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3539. } while (0)
  3540. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3541. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3542. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3543. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3546. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3547. } while (0)
  3548. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3549. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3550. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3551. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3554. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3555. } while (0)
  3556. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3557. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3558. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3559. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3562. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3563. } while (0)
  3564. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3565. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3566. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3567. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3570. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3571. } while (0)
  3572. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3573. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3574. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3575. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3578. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3579. } while (0)
  3580. /**
  3581. * @brief host -> target FW statistics retrieve
  3582. *
  3583. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3584. *
  3585. * @details
  3586. * The following field definitions describe the format of the HTT host
  3587. * to target FW stats retrieve message. The message specifies the type of
  3588. * stats host wants to retrieve.
  3589. *
  3590. * |31 24|23 16|15 8|7 0|
  3591. * |-----------------------------------------------------------|
  3592. * | stats types request bitmask | msg type |
  3593. * |-----------------------------------------------------------|
  3594. * | stats types reset bitmask | reserved |
  3595. * |-----------------------------------------------------------|
  3596. * | stats type | config value |
  3597. * |-----------------------------------------------------------|
  3598. * | cookie LSBs |
  3599. * |-----------------------------------------------------------|
  3600. * | cookie MSBs |
  3601. * |-----------------------------------------------------------|
  3602. * Header fields:
  3603. * - MSG_TYPE
  3604. * Bits 7:0
  3605. * Purpose: identifies this is a stats upload request message
  3606. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3607. * - UPLOAD_TYPES
  3608. * Bits 31:8
  3609. * Purpose: identifies which types of FW statistics to upload
  3610. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3611. * - RESET_TYPES
  3612. * Bits 31:8
  3613. * Purpose: identifies which types of FW statistics to reset
  3614. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3615. * - CFG_VAL
  3616. * Bits 23:0
  3617. * Purpose: give an opaque configuration value to the specified stats type
  3618. * Value: stats-type specific configuration value
  3619. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3620. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3621. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3622. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3623. * - CFG_STAT_TYPE
  3624. * Bits 31:24
  3625. * Purpose: specify which stats type (if any) the config value applies to
  3626. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3627. * a valid configuration specification
  3628. * - COOKIE_LSBS
  3629. * Bits 31:0
  3630. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3631. * message with its preceding host->target stats request message.
  3632. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3633. * - COOKIE_MSBS
  3634. * Bits 31:0
  3635. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3636. * message with its preceding host->target stats request message.
  3637. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3638. */
  3639. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3640. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3641. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3642. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3643. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3644. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3645. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3646. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3647. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3648. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3649. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3650. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3651. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3652. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3653. do { \
  3654. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3655. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3656. } while (0)
  3657. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3658. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3659. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3660. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3661. do { \
  3662. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3663. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3664. } while (0)
  3665. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3666. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3667. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3668. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3669. do { \
  3670. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3671. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3672. } while (0)
  3673. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3674. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3675. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3676. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3677. do { \
  3678. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3679. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3680. } while (0)
  3681. /**
  3682. * @brief host -> target HTT out-of-band sync request
  3683. *
  3684. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3685. *
  3686. * @details
  3687. * The HTT SYNC tells the target to suspend processing of subsequent
  3688. * HTT host-to-target messages until some other target agent locally
  3689. * informs the target HTT FW that the current sync counter is equal to
  3690. * or greater than (in a modulo sense) the sync counter specified in
  3691. * the SYNC message.
  3692. * This allows other host-target components to synchronize their operation
  3693. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3694. * security key has been downloaded to and activated by the target.
  3695. * In the absence of any explicit synchronization counter value
  3696. * specification, the target HTT FW will use zero as the default current
  3697. * sync value.
  3698. *
  3699. * |31 24|23 16|15 8|7 0|
  3700. * |-----------------------------------------------------------|
  3701. * | reserved | sync count | msg type |
  3702. * |-----------------------------------------------------------|
  3703. * Header fields:
  3704. * - MSG_TYPE
  3705. * Bits 7:0
  3706. * Purpose: identifies this as a sync message
  3707. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3708. * - SYNC_COUNT
  3709. * Bits 15:8
  3710. * Purpose: specifies what sync value the HTT FW will wait for from
  3711. * an out-of-band specification to resume its operation
  3712. * Value: in-band sync counter value to compare against the out-of-band
  3713. * counter spec.
  3714. * The HTT target FW will suspend its host->target message processing
  3715. * as long as
  3716. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3717. */
  3718. #define HTT_H2T_SYNC_MSG_SZ 4
  3719. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3720. #define HTT_H2T_SYNC_COUNT_S 8
  3721. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3722. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3723. HTT_H2T_SYNC_COUNT_S)
  3724. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3725. do { \
  3726. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3727. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3728. } while (0)
  3729. /**
  3730. * @brief host -> target HTT aggregation configuration
  3731. *
  3732. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3733. */
  3734. #define HTT_AGGR_CFG_MSG_SZ 4
  3735. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3736. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3737. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3738. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3739. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3740. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3741. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3742. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3743. do { \
  3744. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3745. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3746. } while (0)
  3747. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3748. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3749. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3750. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3751. do { \
  3752. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3753. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3754. } while (0)
  3755. /**
  3756. * @brief host -> target HTT configure max amsdu info per vdev
  3757. *
  3758. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3759. *
  3760. * @details
  3761. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3762. *
  3763. * |31 21|20 16|15 8|7 0|
  3764. * |-----------------------------------------------------------|
  3765. * | reserved | vdev id | max amsdu | msg type |
  3766. * |-----------------------------------------------------------|
  3767. * Header fields:
  3768. * - MSG_TYPE
  3769. * Bits 7:0
  3770. * Purpose: identifies this as a aggr cfg ex message
  3771. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3772. * - MAX_NUM_AMSDU_SUBFRM
  3773. * Bits 15:8
  3774. * Purpose: max MSDUs per A-MSDU
  3775. * - VDEV_ID
  3776. * Bits 20:16
  3777. * Purpose: ID of the vdev to which this limit is applied
  3778. */
  3779. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3780. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3781. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3782. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3783. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3784. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3785. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3786. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3787. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3788. do { \
  3789. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3790. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3791. } while (0)
  3792. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3793. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3794. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3795. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3796. do { \
  3797. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3798. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3799. } while (0)
  3800. /**
  3801. * @brief HTT WDI_IPA Config Message
  3802. *
  3803. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3804. *
  3805. * @details
  3806. * The HTT WDI_IPA config message is created/sent by host at driver
  3807. * init time. It contains information about data structures used on
  3808. * WDI_IPA TX and RX path.
  3809. * TX CE ring is used for pushing packet metadata from IPA uC
  3810. * to WLAN FW
  3811. * TX Completion ring is used for generating TX completions from
  3812. * WLAN FW to IPA uC
  3813. * RX Indication ring is used for indicating RX packets from FW
  3814. * to IPA uC
  3815. * RX Ring2 is used as either completion ring or as second
  3816. * indication ring. when Ring2 is used as completion ring, IPA uC
  3817. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3818. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3819. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3820. * indicated in RX Indication ring. Please see WDI_IPA specification
  3821. * for more details.
  3822. * |31 24|23 16|15 8|7 0|
  3823. * |----------------+----------------+----------------+----------------|
  3824. * | tx pkt pool size | Rsvd | msg_type |
  3825. * |-------------------------------------------------------------------|
  3826. * | tx comp ring base (bits 31:0) |
  3827. #if HTT_PADDR64
  3828. * | tx comp ring base (bits 63:32) |
  3829. #endif
  3830. * |-------------------------------------------------------------------|
  3831. * | tx comp ring size |
  3832. * |-------------------------------------------------------------------|
  3833. * | tx comp WR_IDX physical address (bits 31:0) |
  3834. #if HTT_PADDR64
  3835. * | tx comp WR_IDX physical address (bits 63:32) |
  3836. #endif
  3837. * |-------------------------------------------------------------------|
  3838. * | tx CE WR_IDX physical address (bits 31:0) |
  3839. #if HTT_PADDR64
  3840. * | tx CE WR_IDX physical address (bits 63:32) |
  3841. #endif
  3842. * |-------------------------------------------------------------------|
  3843. * | rx indication ring base (bits 31:0) |
  3844. #if HTT_PADDR64
  3845. * | rx indication ring base (bits 63:32) |
  3846. #endif
  3847. * |-------------------------------------------------------------------|
  3848. * | rx indication ring size |
  3849. * |-------------------------------------------------------------------|
  3850. * | rx ind RD_IDX physical address (bits 31:0) |
  3851. #if HTT_PADDR64
  3852. * | rx ind RD_IDX physical address (bits 63:32) |
  3853. #endif
  3854. * |-------------------------------------------------------------------|
  3855. * | rx ind WR_IDX physical address (bits 31:0) |
  3856. #if HTT_PADDR64
  3857. * | rx ind WR_IDX physical address (bits 63:32) |
  3858. #endif
  3859. * |-------------------------------------------------------------------|
  3860. * |-------------------------------------------------------------------|
  3861. * | rx ring2 base (bits 31:0) |
  3862. #if HTT_PADDR64
  3863. * | rx ring2 base (bits 63:32) |
  3864. #endif
  3865. * |-------------------------------------------------------------------|
  3866. * | rx ring2 size |
  3867. * |-------------------------------------------------------------------|
  3868. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3869. #if HTT_PADDR64
  3870. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3871. #endif
  3872. * |-------------------------------------------------------------------|
  3873. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3874. #if HTT_PADDR64
  3875. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3876. #endif
  3877. * |-------------------------------------------------------------------|
  3878. *
  3879. * Header fields:
  3880. * Header fields:
  3881. * - MSG_TYPE
  3882. * Bits 7:0
  3883. * Purpose: Identifies this as WDI_IPA config message
  3884. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3885. * - TX_PKT_POOL_SIZE
  3886. * Bits 15:0
  3887. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3888. * WDI_IPA TX path
  3889. * For systems using 32-bit format for bus addresses:
  3890. * - TX_COMP_RING_BASE_ADDR
  3891. * Bits 31:0
  3892. * Purpose: TX Completion Ring base address in DDR
  3893. * - TX_COMP_RING_SIZE
  3894. * Bits 31:0
  3895. * Purpose: TX Completion Ring size (must be power of 2)
  3896. * - TX_COMP_WR_IDX_ADDR
  3897. * Bits 31:0
  3898. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3899. * updates the Write Index for WDI_IPA TX completion ring
  3900. * - TX_CE_WR_IDX_ADDR
  3901. * Bits 31:0
  3902. * Purpose: DDR address where IPA uC
  3903. * updates the WR Index for TX CE ring
  3904. * (needed for fusion platforms)
  3905. * - RX_IND_RING_BASE_ADDR
  3906. * Bits 31:0
  3907. * Purpose: RX Indication Ring base address in DDR
  3908. * - RX_IND_RING_SIZE
  3909. * Bits 31:0
  3910. * Purpose: RX Indication Ring size
  3911. * - RX_IND_RD_IDX_ADDR
  3912. * Bits 31:0
  3913. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3914. * RX indication ring
  3915. * - RX_IND_WR_IDX_ADDR
  3916. * Bits 31:0
  3917. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3918. * updates the Write Index for WDI_IPA RX indication ring
  3919. * - RX_RING2_BASE_ADDR
  3920. * Bits 31:0
  3921. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3922. * - RX_RING2_SIZE
  3923. * Bits 31:0
  3924. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3925. * - RX_RING2_RD_IDX_ADDR
  3926. * Bits 31:0
  3927. * Purpose: If Second RX ring is Indication ring, DDR address where
  3928. * IPA uC updates the Read Index for Ring2.
  3929. * If Second RX ring is completion ring, this is NOT used
  3930. * - RX_RING2_WR_IDX_ADDR
  3931. * Bits 31:0
  3932. * Purpose: If Second RX ring is Indication ring, DDR address where
  3933. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3934. * If second RX ring is completion ring, DDR address where
  3935. * IPA uC updates the Write Index for Ring 2.
  3936. * For systems using 64-bit format for bus addresses:
  3937. * - TX_COMP_RING_BASE_ADDR_LO
  3938. * Bits 31:0
  3939. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3940. * - TX_COMP_RING_BASE_ADDR_HI
  3941. * Bits 31:0
  3942. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3943. * - TX_COMP_RING_SIZE
  3944. * Bits 31:0
  3945. * Purpose: TX Completion Ring size (must be power of 2)
  3946. * - TX_COMP_WR_IDX_ADDR_LO
  3947. * Bits 31:0
  3948. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3949. * Lower 4 bytes of DDR address where WIFI FW
  3950. * updates the Write Index for WDI_IPA TX completion ring
  3951. * - TX_COMP_WR_IDX_ADDR_HI
  3952. * Bits 31:0
  3953. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3954. * Higher 4 bytes of DDR address where WIFI FW
  3955. * updates the Write Index for WDI_IPA TX completion ring
  3956. * - TX_CE_WR_IDX_ADDR_LO
  3957. * Bits 31:0
  3958. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3959. * updates the WR Index for TX CE ring
  3960. * (needed for fusion platforms)
  3961. * - TX_CE_WR_IDX_ADDR_HI
  3962. * Bits 31:0
  3963. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3964. * updates the WR Index for TX CE ring
  3965. * (needed for fusion platforms)
  3966. * - RX_IND_RING_BASE_ADDR_LO
  3967. * Bits 31:0
  3968. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3969. * - RX_IND_RING_BASE_ADDR_HI
  3970. * Bits 31:0
  3971. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3972. * - RX_IND_RING_SIZE
  3973. * Bits 31:0
  3974. * Purpose: RX Indication Ring size
  3975. * - RX_IND_RD_IDX_ADDR_LO
  3976. * Bits 31:0
  3977. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3978. * for WDI_IPA RX indication ring
  3979. * - RX_IND_RD_IDX_ADDR_HI
  3980. * Bits 31:0
  3981. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3982. * for WDI_IPA RX indication ring
  3983. * - RX_IND_WR_IDX_ADDR_LO
  3984. * Bits 31:0
  3985. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3986. * Lower 4 bytes of DDR address where WIFI FW
  3987. * updates the Write Index for WDI_IPA RX indication ring
  3988. * - RX_IND_WR_IDX_ADDR_HI
  3989. * Bits 31:0
  3990. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3991. * Higher 4 bytes of DDR address where WIFI FW
  3992. * updates the Write Index for WDI_IPA RX indication ring
  3993. * - RX_RING2_BASE_ADDR_LO
  3994. * Bits 31:0
  3995. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3996. * - RX_RING2_BASE_ADDR_HI
  3997. * Bits 31:0
  3998. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3999. * - RX_RING2_SIZE
  4000. * Bits 31:0
  4001. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4002. * - RX_RING2_RD_IDX_ADDR_LO
  4003. * Bits 31:0
  4004. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4005. * DDR address where IPA uC updates the Read Index for Ring2.
  4006. * If Second RX ring is completion ring, this is NOT used
  4007. * - RX_RING2_RD_IDX_ADDR_HI
  4008. * Bits 31:0
  4009. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4010. * DDR address where IPA uC updates the Read Index for Ring2.
  4011. * If Second RX ring is completion ring, this is NOT used
  4012. * - RX_RING2_WR_IDX_ADDR_LO
  4013. * Bits 31:0
  4014. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4015. * DDR address where WIFI FW updates the Write Index
  4016. * for WDI_IPA RX ring2
  4017. * If second RX ring is completion ring, lower 4 bytes of
  4018. * DDR address where IPA uC updates the Write Index for Ring 2.
  4019. * - RX_RING2_WR_IDX_ADDR_HI
  4020. * Bits 31:0
  4021. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4022. * DDR address where WIFI FW updates the Write Index
  4023. * for WDI_IPA RX ring2
  4024. * If second RX ring is completion ring, higher 4 bytes of
  4025. * DDR address where IPA uC updates the Write Index for Ring 2.
  4026. */
  4027. #if HTT_PADDR64
  4028. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4029. #else
  4030. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4031. #endif
  4032. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4033. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4034. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4035. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4036. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4038. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4048. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4050. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4052. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4054. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4056. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4058. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4068. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4070. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4094. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4095. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4096. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4097. do { \
  4098. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4099. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4100. } while (0)
  4101. /* for systems using 32-bit format for bus addr */
  4102. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4103. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4104. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4105. do { \
  4106. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4107. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4108. } while (0)
  4109. /* for systems using 64-bit format for bus addr */
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4111. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4112. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4115. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4116. } while (0)
  4117. /* for systems using 64-bit format for bus addr */
  4118. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4119. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4120. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4123. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4124. } while (0)
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4126. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4130. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4131. } while (0)
  4132. /* for systems using 32-bit format for bus addr */
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4134. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4135. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4138. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4139. } while (0)
  4140. /* for systems using 64-bit format for bus addr */
  4141. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4142. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4143. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4146. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4147. } while (0)
  4148. /* for systems using 64-bit format for bus addr */
  4149. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4150. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4151. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4154. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4155. } while (0)
  4156. /* for systems using 32-bit format for bus addr */
  4157. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4158. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4159. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4162. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4163. } while (0)
  4164. /* for systems using 64-bit format for bus addr */
  4165. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4166. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4167. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4170. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4171. } while (0)
  4172. /* for systems using 64-bit format for bus addr */
  4173. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4174. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4175. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4178. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4179. } while (0)
  4180. /* for systems using 32-bit format for bus addr */
  4181. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4182. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4183. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4184. do { \
  4185. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4186. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4187. } while (0)
  4188. /* for systems using 64-bit format for bus addr */
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4190. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4191. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4194. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4195. } while (0)
  4196. /* for systems using 64-bit format for bus addr */
  4197. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4198. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4199. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4202. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4203. } while (0)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4205. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4206. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4209. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4210. } while (0)
  4211. /* for systems using 32-bit format for bus addr */
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4213. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4214. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4217. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4218. } while (0)
  4219. /* for systems using 64-bit format for bus addr */
  4220. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4221. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4223. do { \
  4224. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4225. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4226. } while (0)
  4227. /* for systems using 64-bit format for bus addr */
  4228. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4229. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4230. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4233. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4234. } while (0)
  4235. /* for systems using 32-bit format for bus addr */
  4236. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4237. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4238. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4241. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4242. } while (0)
  4243. /* for systems using 64-bit format for bus addr */
  4244. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4245. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4246. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4249. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4250. } while (0)
  4251. /* for systems using 64-bit format for bus addr */
  4252. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4253. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4254. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4255. do { \
  4256. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4257. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4258. } while (0)
  4259. /* for systems using 32-bit format for bus addr */
  4260. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4261. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4262. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4263. do { \
  4264. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4265. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4266. } while (0)
  4267. /* for systems using 64-bit format for bus addr */
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4269. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4270. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4273. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4274. } while (0)
  4275. /* for systems using 64-bit format for bus addr */
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4277. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4278. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4281. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4282. } while (0)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4284. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4288. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4289. } while (0)
  4290. /* for systems using 32-bit format for bus addr */
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4292. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4293. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4296. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4297. } while (0)
  4298. /* for systems using 64-bit format for bus addr */
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4300. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4301. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4304. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4305. } while (0)
  4306. /* for systems using 64-bit format for bus addr */
  4307. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4308. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4309. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4310. do { \
  4311. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4312. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4313. } while (0)
  4314. /* for systems using 32-bit format for bus addr */
  4315. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4316. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4317. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4318. do { \
  4319. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4320. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4321. } while (0)
  4322. /* for systems using 64-bit format for bus addr */
  4323. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4324. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4325. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4328. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4329. } while (0)
  4330. /* for systems using 64-bit format for bus addr */
  4331. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4332. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4333. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4336. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4337. } while (0)
  4338. /*
  4339. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4340. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4341. * addresses are stored in a XXX-bit field.
  4342. * This macro is used to define both htt_wdi_ipa_config32_t and
  4343. * htt_wdi_ipa_config64_t structs.
  4344. */
  4345. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4346. _paddr__tx_comp_ring_base_addr_, \
  4347. _paddr__tx_comp_wr_idx_addr_, \
  4348. _paddr__tx_ce_wr_idx_addr_, \
  4349. _paddr__rx_ind_ring_base_addr_, \
  4350. _paddr__rx_ind_rd_idx_addr_, \
  4351. _paddr__rx_ind_wr_idx_addr_, \
  4352. _paddr__rx_ring2_base_addr_,\
  4353. _paddr__rx_ring2_rd_idx_addr_,\
  4354. _paddr__rx_ring2_wr_idx_addr_) \
  4355. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4356. { \
  4357. /* DWORD 0: flags and meta-data */ \
  4358. A_UINT32 \
  4359. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4360. reserved: 8, \
  4361. tx_pkt_pool_size: 16;\
  4362. /* DWORD 1 */\
  4363. _paddr__tx_comp_ring_base_addr_;\
  4364. /* DWORD 2 (or 3)*/\
  4365. A_UINT32 tx_comp_ring_size;\
  4366. /* DWORD 3 (or 4)*/\
  4367. _paddr__tx_comp_wr_idx_addr_;\
  4368. /* DWORD 4 (or 6)*/\
  4369. _paddr__tx_ce_wr_idx_addr_;\
  4370. /* DWORD 5 (or 8)*/\
  4371. _paddr__rx_ind_ring_base_addr_;\
  4372. /* DWORD 6 (or 10)*/\
  4373. A_UINT32 rx_ind_ring_size;\
  4374. /* DWORD 7 (or 11)*/\
  4375. _paddr__rx_ind_rd_idx_addr_;\
  4376. /* DWORD 8 (or 13)*/\
  4377. _paddr__rx_ind_wr_idx_addr_;\
  4378. /* DWORD 9 (or 15)*/\
  4379. _paddr__rx_ring2_base_addr_;\
  4380. /* DWORD 10 (or 17) */\
  4381. A_UINT32 rx_ring2_size;\
  4382. /* DWORD 11 (or 18) */\
  4383. _paddr__rx_ring2_rd_idx_addr_;\
  4384. /* DWORD 12 (or 20) */\
  4385. _paddr__rx_ring2_wr_idx_addr_;\
  4386. } POSTPACK
  4387. /* define a htt_wdi_ipa_config32_t type */
  4388. 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));
  4389. /* define a htt_wdi_ipa_config64_t type */
  4390. 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));
  4391. #if HTT_PADDR64
  4392. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4393. #else
  4394. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4395. #endif
  4396. enum htt_wdi_ipa_op_code {
  4397. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4398. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4399. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4400. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4401. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4402. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4403. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4404. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4405. /* keep this last */
  4406. HTT_WDI_IPA_OPCODE_MAX
  4407. };
  4408. /**
  4409. * @brief HTT WDI_IPA Operation Request Message
  4410. *
  4411. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4412. *
  4413. * @details
  4414. * HTT WDI_IPA Operation Request message is sent by host
  4415. * to either suspend or resume WDI_IPA TX or RX path.
  4416. * |31 24|23 16|15 8|7 0|
  4417. * |----------------+----------------+----------------+----------------|
  4418. * | op_code | Rsvd | msg_type |
  4419. * |-------------------------------------------------------------------|
  4420. *
  4421. * Header fields:
  4422. * - MSG_TYPE
  4423. * Bits 7:0
  4424. * Purpose: Identifies this as WDI_IPA Operation Request message
  4425. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4426. * - OP_CODE
  4427. * Bits 31:16
  4428. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4429. * value: = enum htt_wdi_ipa_op_code
  4430. */
  4431. PREPACK struct htt_wdi_ipa_op_request_t
  4432. {
  4433. /* DWORD 0: flags and meta-data */
  4434. A_UINT32
  4435. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4436. reserved: 8,
  4437. op_code: 16;
  4438. } POSTPACK;
  4439. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4440. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4441. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4442. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4443. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4444. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4445. do { \
  4446. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4447. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4448. } while (0)
  4449. /*
  4450. * @brief host -> target HTT_MSI_SETUP message
  4451. *
  4452. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4453. *
  4454. * @details
  4455. * After target is booted up, host can send MSI setup message so that
  4456. * target sets up HW registers based on setup message.
  4457. *
  4458. * The message would appear as follows:
  4459. * |31 24|23 16|15|14 8|7 0|
  4460. * |---------------+-----------------+-----------------+-----------------|
  4461. * | reserved | msi_type | pdev_id | msg_type |
  4462. * |---------------------------------------------------------------------|
  4463. * | msi_addr_lo |
  4464. * |---------------------------------------------------------------------|
  4465. * | msi_addr_hi |
  4466. * |---------------------------------------------------------------------|
  4467. * | msi_data |
  4468. * |---------------------------------------------------------------------|
  4469. *
  4470. * The message is interpreted as follows:
  4471. * dword0 - b'0:7 - msg_type: This will be set to
  4472. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4473. * b'8:15 - pdev_id:
  4474. * 0 (for rings at SOC/UMAC level),
  4475. * 1/2/3 mac id (for rings at LMAC level)
  4476. * b'16:23 - msi_type: identify which msi registers need to be setup
  4477. * more details can be got from enum htt_msi_setup_type
  4478. * b'24:31 - reserved
  4479. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4480. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4481. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4482. */
  4483. PREPACK struct htt_msi_setup_t {
  4484. A_UINT32 msg_type: 8,
  4485. pdev_id: 8,
  4486. msi_type: 8,
  4487. reserved: 8;
  4488. A_UINT32 msi_addr_lo;
  4489. A_UINT32 msi_addr_hi;
  4490. A_UINT32 msi_data;
  4491. } POSTPACK;
  4492. enum htt_msi_setup_type {
  4493. HTT_PPDU_END_MSI_SETUP_TYPE,
  4494. /* Insert new types here*/
  4495. };
  4496. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4497. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4498. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4499. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4500. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4501. HTT_MSI_SETUP_PDEV_ID_S)
  4502. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4503. do { \
  4504. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4505. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4506. } while (0)
  4507. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4508. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4509. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4510. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4511. HTT_MSI_SETUP_MSI_TYPE_S)
  4512. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4513. do { \
  4514. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4515. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4516. } while (0)
  4517. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4518. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4519. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4520. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4521. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4522. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4523. do { \
  4524. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4525. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4526. } while (0)
  4527. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4528. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4529. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4530. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4531. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4532. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4533. do { \
  4534. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4535. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4536. } while (0)
  4537. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4538. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4539. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4540. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4541. HTT_MSI_SETUP_MSI_DATA_S)
  4542. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4543. do { \
  4544. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4545. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4546. } while (0)
  4547. /*
  4548. * @brief host -> target HTT_SRING_SETUP message
  4549. *
  4550. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4551. *
  4552. * @details
  4553. * After target is booted up, Host can send SRING setup message for
  4554. * each host facing LMAC SRING. Target setups up HW registers based
  4555. * on setup message and confirms back to Host if response_required is set.
  4556. * Host should wait for confirmation message before sending new SRING
  4557. * setup message
  4558. *
  4559. * The message would appear as follows:
  4560. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4561. * |--------------- +-----------------+-----------------+-----------------|
  4562. * | ring_type | ring_id | pdev_id | msg_type |
  4563. * |----------------------------------------------------------------------|
  4564. * | ring_base_addr_lo |
  4565. * |----------------------------------------------------------------------|
  4566. * | ring_base_addr_hi |
  4567. * |----------------------------------------------------------------------|
  4568. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4569. * |----------------------------------------------------------------------|
  4570. * | ring_head_offset32_remote_addr_lo |
  4571. * |----------------------------------------------------------------------|
  4572. * | ring_head_offset32_remote_addr_hi |
  4573. * |----------------------------------------------------------------------|
  4574. * | ring_tail_offset32_remote_addr_lo |
  4575. * |----------------------------------------------------------------------|
  4576. * | ring_tail_offset32_remote_addr_hi |
  4577. * |----------------------------------------------------------------------|
  4578. * | ring_msi_addr_lo |
  4579. * |----------------------------------------------------------------------|
  4580. * | ring_msi_addr_hi |
  4581. * |----------------------------------------------------------------------|
  4582. * | ring_msi_data |
  4583. * |----------------------------------------------------------------------|
  4584. * | intr_timer_th |IM| intr_batch_counter_th |
  4585. * |----------------------------------------------------------------------|
  4586. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4587. * |----------------------------------------------------------------------|
  4588. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4589. * |----------------------------------------------------------------------|
  4590. * Where
  4591. * IM = sw_intr_mode
  4592. * RR = response_required
  4593. * PTCF = prefetch_timer_cfg
  4594. * IP = IPA drop flag
  4595. *
  4596. * The message is interpreted as follows:
  4597. * dword0 - b'0:7 - msg_type: This will be set to
  4598. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4599. * b'8:15 - pdev_id:
  4600. * 0 (for rings at SOC/UMAC level),
  4601. * 1/2/3 mac id (for rings at LMAC level)
  4602. * b'16:23 - ring_id: identify which ring is to setup,
  4603. * more details can be got from enum htt_srng_ring_id
  4604. * b'24:31 - ring_type: identify type of host rings,
  4605. * more details can be got from enum htt_srng_ring_type
  4606. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4607. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4608. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4609. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4610. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4611. * SW_TO_HW_RING.
  4612. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4613. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4614. * Lower 32 bits of memory address of the remote variable
  4615. * storing the 4-byte word offset that identifies the head
  4616. * element within the ring.
  4617. * (The head offset variable has type A_UINT32.)
  4618. * Valid for HW_TO_SW and SW_TO_SW rings.
  4619. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4620. * Upper 32 bits of memory address of the remote variable
  4621. * storing the 4-byte word offset that identifies the head
  4622. * element within the ring.
  4623. * (The head offset variable has type A_UINT32.)
  4624. * Valid for HW_TO_SW and SW_TO_SW rings.
  4625. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4626. * Lower 32 bits of memory address of the remote variable
  4627. * storing the 4-byte word offset that identifies the tail
  4628. * element within the ring.
  4629. * (The tail offset variable has type A_UINT32.)
  4630. * Valid for HW_TO_SW and SW_TO_SW rings.
  4631. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4632. * Upper 32 bits of memory address of the remote variable
  4633. * storing the 4-byte word offset that identifies the tail
  4634. * element within the ring.
  4635. * (The tail offset variable has type A_UINT32.)
  4636. * Valid for HW_TO_SW and SW_TO_SW rings.
  4637. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4638. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4639. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4640. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4641. * dword10 - b'0:31 - ring_msi_data: MSI data
  4642. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4643. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4644. * dword11 - b'0:14 - intr_batch_counter_th:
  4645. * batch counter threshold is in units of 4-byte words.
  4646. * HW internally maintains and increments batch count.
  4647. * (see SRING spec for detail description).
  4648. * When batch count reaches threshold value, an interrupt
  4649. * is generated by HW.
  4650. * b'15 - sw_intr_mode:
  4651. * This configuration shall be static.
  4652. * Only programmed at power up.
  4653. * 0: generate pulse style sw interrupts
  4654. * 1: generate level style sw interrupts
  4655. * b'16:31 - intr_timer_th:
  4656. * The timer init value when timer is idle or is
  4657. * initialized to start downcounting.
  4658. * In 8us units (to cover a range of 0 to 524 ms)
  4659. * dword12 - b'0:15 - intr_low_threshold:
  4660. * Used only by Consumer ring to generate ring_sw_int_p.
  4661. * Ring entries low threshold water mark, that is used
  4662. * in combination with the interrupt timer as well as
  4663. * the the clearing of the level interrupt.
  4664. * b'16:18 - prefetch_timer_cfg:
  4665. * Used only by Consumer ring to set timer mode to
  4666. * support Application prefetch handling.
  4667. * The external tail offset/pointer will be updated
  4668. * at following intervals:
  4669. * 3'b000: (Prefetch feature disabled; used only for debug)
  4670. * 3'b001: 1 usec
  4671. * 3'b010: 4 usec
  4672. * 3'b011: 8 usec (default)
  4673. * 3'b100: 16 usec
  4674. * Others: Reserverd
  4675. * b'19 - response_required:
  4676. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4677. * b'20 - ipa_drop_flag:
  4678. Indicates that host will config ipa drop threshold percentage
  4679. * b'21:31 - reserved: reserved for future use
  4680. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4681. * b'8:15 - ipa drop high threshold percentage:
  4682. * b'16:31 - Reserved
  4683. */
  4684. PREPACK struct htt_sring_setup_t {
  4685. A_UINT32 msg_type: 8,
  4686. pdev_id: 8,
  4687. ring_id: 8,
  4688. ring_type: 8;
  4689. A_UINT32 ring_base_addr_lo;
  4690. A_UINT32 ring_base_addr_hi;
  4691. A_UINT32 ring_size: 16,
  4692. ring_entry_size: 8,
  4693. ring_misc_cfg_flag: 8;
  4694. A_UINT32 ring_head_offset32_remote_addr_lo;
  4695. A_UINT32 ring_head_offset32_remote_addr_hi;
  4696. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4697. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4698. A_UINT32 ring_msi_addr_lo;
  4699. A_UINT32 ring_msi_addr_hi;
  4700. A_UINT32 ring_msi_data;
  4701. A_UINT32 intr_batch_counter_th: 15,
  4702. sw_intr_mode: 1,
  4703. intr_timer_th: 16;
  4704. A_UINT32 intr_low_threshold: 16,
  4705. prefetch_timer_cfg: 3,
  4706. response_required: 1,
  4707. ipa_drop_flag: 1,
  4708. reserved1: 11;
  4709. A_UINT32 ipa_drop_low_threshold: 8,
  4710. ipa_drop_high_threshold: 8,
  4711. reserved: 16;
  4712. } POSTPACK;
  4713. enum htt_srng_ring_type {
  4714. HTT_HW_TO_SW_RING = 0,
  4715. HTT_SW_TO_HW_RING,
  4716. HTT_SW_TO_SW_RING,
  4717. /* Insert new ring types above this line */
  4718. };
  4719. enum htt_srng_ring_id {
  4720. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4721. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4722. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4723. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4724. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4725. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4726. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4727. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4728. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4729. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4730. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4731. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4732. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4733. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4734. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4735. /* Add Other SRING which can't be directly configured by host software above this line */
  4736. };
  4737. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4738. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4739. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4740. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4741. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4742. HTT_SRING_SETUP_PDEV_ID_S)
  4743. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4744. do { \
  4745. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4746. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4747. } while (0)
  4748. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4749. #define HTT_SRING_SETUP_RING_ID_S 16
  4750. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4751. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4752. HTT_SRING_SETUP_RING_ID_S)
  4753. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4754. do { \
  4755. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4756. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4757. } while (0)
  4758. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4759. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4760. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4761. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4762. HTT_SRING_SETUP_RING_TYPE_S)
  4763. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4764. do { \
  4765. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4766. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4767. } while (0)
  4768. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4769. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4770. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4771. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4772. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4773. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4774. do { \
  4775. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4776. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4777. } while (0)
  4778. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4779. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4780. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4781. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4782. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4783. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4784. do { \
  4785. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4786. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4787. } while (0)
  4788. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4789. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4790. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4791. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4792. HTT_SRING_SETUP_RING_SIZE_S)
  4793. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4794. do { \
  4795. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4796. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4797. } while (0)
  4798. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4799. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4800. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4801. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4802. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4803. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4804. do { \
  4805. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4806. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4807. } while (0)
  4808. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4809. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4810. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4811. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4812. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4813. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4814. do { \
  4815. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4816. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4817. } while (0)
  4818. /* This control bit is applicable to only Producer, which updates Ring ID field
  4819. * of each descriptor before pushing into the ring.
  4820. * 0: updates ring_id(default)
  4821. * 1: ring_id updating disabled */
  4822. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4823. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4825. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4826. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4827. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4828. do { \
  4829. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4830. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4831. } while (0)
  4832. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4833. * of each descriptor before pushing into the ring.
  4834. * 0: updates Loopcnt(default)
  4835. * 1: Loopcnt updating disabled */
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4839. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4840. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4842. do { \
  4843. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4844. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4845. } while (0)
  4846. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4847. * into security_id port of GXI/AXI. */
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4851. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4852. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4854. do { \
  4855. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4856. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4857. } while (0)
  4858. /* During MSI write operation, SRNG drives value of this register bit into
  4859. * swap bit of GXI/AXI. */
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4863. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4864. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4866. do { \
  4867. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4868. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4869. } while (0)
  4870. /* During Pointer write operation, SRNG drives value of this register bit into
  4871. * swap bit of GXI/AXI. */
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4875. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4876. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4878. do { \
  4879. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4880. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4881. } while (0)
  4882. /* During any data or TLV write operation, SRNG drives value of this register
  4883. * bit into swap bit of GXI/AXI. */
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4887. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4888. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4890. do { \
  4891. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4892. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4893. } while (0)
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4896. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4897. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4898. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4899. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4900. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4901. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4902. do { \
  4903. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4904. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4905. } while (0)
  4906. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4907. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4908. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4909. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4910. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4911. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4912. do { \
  4913. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4914. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4915. } while (0)
  4916. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4917. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4918. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4919. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4920. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4921. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4922. do { \
  4923. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4924. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4925. } while (0)
  4926. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4927. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4928. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4929. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4930. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4931. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4932. do { \
  4933. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4934. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4935. } while (0)
  4936. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4937. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4938. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4939. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4940. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4941. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4942. do { \
  4943. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4944. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4945. } while (0)
  4946. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4947. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4948. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4949. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4950. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4951. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4952. do { \
  4953. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4954. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4955. } while (0)
  4956. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4957. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4958. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4959. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4960. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4961. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4962. do { \
  4963. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4964. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4965. } while (0)
  4966. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4967. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4968. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4969. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4970. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4971. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4972. do { \
  4973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4974. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4975. } while (0)
  4976. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4977. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4978. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4979. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4980. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4981. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4982. do { \
  4983. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4984. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4985. } while (0)
  4986. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4987. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4988. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4989. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4990. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4991. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4992. do { \
  4993. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4994. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4995. } while (0)
  4996. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4997. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4998. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4999. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5000. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5001. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5002. do { \
  5003. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5004. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5005. } while (0)
  5006. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5007. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5008. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5009. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5010. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5011. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5012. do { \
  5013. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5014. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5015. } while (0)
  5016. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5017. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5018. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5019. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5020. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5021. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5022. do { \
  5023. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5024. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5025. } while (0)
  5026. /**
  5027. * @brief host -> target RX ring selection config message
  5028. *
  5029. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5030. *
  5031. * @details
  5032. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5033. * configure RXDMA rings.
  5034. * The configuration is per ring based and includes both packet subtypes
  5035. * and PPDU/MPDU TLVs.
  5036. *
  5037. * The message would appear as follows:
  5038. *
  5039. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5040. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5041. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5042. * |-------------------------------------------------------------------|
  5043. * | rsvd2 | ring_buffer_size |
  5044. * |-------------------------------------------------------------------|
  5045. * | packet_type_enable_flags_0 |
  5046. * |-------------------------------------------------------------------|
  5047. * | packet_type_enable_flags_1 |
  5048. * |-------------------------------------------------------------------|
  5049. * | packet_type_enable_flags_2 |
  5050. * |-------------------------------------------------------------------|
  5051. * | packet_type_enable_flags_3 |
  5052. * |-------------------------------------------------------------------|
  5053. * | tlv_filter_in_flags |
  5054. * |-------------------------------------------------------------------|
  5055. * | rx_header_offset | rx_packet_offset |
  5056. * |-------------------------------------------------------------------|
  5057. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5058. * |-------------------------------------------------------------------|
  5059. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5060. * |-------------------------------------------------------------------|
  5061. * | rsvd3 | rx_attention_offset |
  5062. * |-------------------------------------------------------------------|
  5063. * | rsvd4 | mo| fp| rx_drop_threshold |
  5064. * | |ndp|ndp| |
  5065. * |-------------------------------------------------------------------|
  5066. * Where:
  5067. * PS = pkt_swap
  5068. * SS = status_swap
  5069. * OV = rx_offsets_valid
  5070. * DT = drop_thresh_valid
  5071. * The message is interpreted as follows:
  5072. * dword0 - b'0:7 - msg_type: This will be set to
  5073. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5074. * b'8:15 - pdev_id:
  5075. * 0 (for rings at SOC/UMAC level),
  5076. * 1/2/3 mac id (for rings at LMAC level)
  5077. * b'16:23 - ring_id : Identify the ring to configure.
  5078. * More details can be got from enum htt_srng_ring_id
  5079. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5080. * BUF_RING_CFG_0 defs within HW .h files,
  5081. * e.g. wmac_top_reg_seq_hwioreg.h
  5082. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5083. * BUF_RING_CFG_0 defs within HW .h files,
  5084. * e.g. wmac_top_reg_seq_hwioreg.h
  5085. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5086. * configuration fields are valid
  5087. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5088. * rx_drop_threshold field is valid
  5089. * b'28 - rx_mon_global_en: Enable/Disable global register
  5090. 8 configuration in Rx monitor module.
  5091. * b'29:31 - rsvd1: reserved for future use
  5092. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5093. * in byte units.
  5094. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5095. * b'16:18 - config_length_mgmt (MGMT):
  5096. * Represents the length of mpdu bytes for mgmt pkt.
  5097. * valid values:
  5098. * 001 - 64bytes
  5099. * 010 - 128bytes
  5100. * 100 - 256bytes
  5101. * 111 - Full mpdu bytes
  5102. * b'19:21 - config_length_ctrl (CTRL):
  5103. * Represents the length of mpdu bytes for ctrl pkt.
  5104. * valid values:
  5105. * 001 - 64bytes
  5106. * 010 - 128bytes
  5107. * 100 - 256bytes
  5108. * 111 - Full mpdu bytes
  5109. * b'22:24 - config_length_data (DATA):
  5110. * Represents the length of mpdu bytes for data pkt.
  5111. * valid values:
  5112. * 001 - 64bytes
  5113. * 010 - 128bytes
  5114. * 100 - 256bytes
  5115. * 111 - Full mpdu bytes
  5116. * b'25:26 - rx_hdr_len:
  5117. * Specifies the number of bytes of recvd packet to copy
  5118. * into the rx_hdr tlv.
  5119. * supported values for now by host:
  5120. * 01 - 64bytes
  5121. * 10 - 128bytes
  5122. * 11 - 256bytes
  5123. * default - 128 bytes
  5124. * b'27:31 - rsvd2: Reserved for future use
  5125. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5126. * Enable MGMT packet from 0b0000 to 0b1001
  5127. * bits from low to high: FP, MD, MO - 3 bits
  5128. * FP: Filter_Pass
  5129. * MD: Monitor_Direct
  5130. * MO: Monitor_Other
  5131. * 10 mgmt subtypes * 3 bits -> 30 bits
  5132. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5133. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5134. * Enable MGMT packet from 0b1010 to 0b1111
  5135. * bits from low to high: FP, MD, MO - 3 bits
  5136. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5137. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5138. * Enable CTRL packet from 0b0000 to 0b1001
  5139. * bits from low to high: FP, MD, MO - 3 bits
  5140. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5141. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5142. * Enable CTRL packet from 0b1010 to 0b1111,
  5143. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5144. * bits from low to high: FP, MD, MO - 3 bits
  5145. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5146. * dword6 - b'0:31 - tlv_filter_in_flags:
  5147. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5148. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5149. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5150. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5151. * A value of 0 will be considered as ignore this config.
  5152. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5153. * e.g. wmac_top_reg_seq_hwioreg.h
  5154. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5155. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5156. * A value of 0 will be considered as ignore this config.
  5157. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5158. * e.g. wmac_top_reg_seq_hwioreg.h
  5159. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5160. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5161. * A value of 0 will be considered as ignore this config.
  5162. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5163. * e.g. wmac_top_reg_seq_hwioreg.h
  5164. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5165. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5166. * A value of 0 will be considered as ignore this config.
  5167. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5168. * e.g. wmac_top_reg_seq_hwioreg.h
  5169. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5170. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5171. * A value of 0 will be considered as ignore this config.
  5172. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5173. * e.g. wmac_top_reg_seq_hwioreg.h
  5174. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5175. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5176. * A value of 0 will be considered as ignore this config.
  5177. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5178. * e.g. wmac_top_reg_seq_hwioreg.h
  5179. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5180. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5181. * A value of 0 will be considered as ignore this config.
  5182. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5183. * e.g. wmac_top_reg_seq_hwioreg.h
  5184. * - b'16:31 - rsvd3 for future use
  5185. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5186. * to source rings. Consumer drops packets if the available
  5187. * words in the ring falls below the configured threshold
  5188. * value.
  5189. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5190. * by host. 1 -> subscribed
  5191. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5192. * by host. 1 -> subscribed
  5193. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5194. * subscribed by host. 1 -> subscribed
  5195. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5196. * selection for the FP PHY ERR status tlv.
  5197. * 0 - wbm2rxdma_buf_source_ring
  5198. * 1 - fw2rxdma_buf_source_ring
  5199. * 2 - sw2rxdma_buf_source_ring
  5200. * 3 - no_buffer_ring
  5201. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5202. * selection for the FP PHY ERR status tlv.
  5203. * 0 - rxdma_release_ring
  5204. * 1 - rxdma2fw_ring
  5205. * 2 - rxdma2sw_ring
  5206. * 3 - rxdma2reo_ring
  5207. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5208. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5209. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5210. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5211. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5212. * 0: MSDU level logging
  5213. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5214. * 0: MSDU level logging
  5215. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5216. * 0: MSDU level logging
  5217. * - b'23 - word_mask_compaction: enable/disable word mask for
  5218. * mpdu/msdu start/end tlvs
  5219. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5220. * manager override
  5221. * - b'25:28 - rbm_override_val: return buffer manager override value
  5222. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5223. * which have to be posted to host from phy.
  5224. * Corresponding to errors defined in
  5225. * phyrx_abort_request_reason enums 0 to 31.
  5226. * Refer to RXPCU register definition header files for the
  5227. * phyrx_abort_request_reason enum definition.
  5228. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5229. * errors which have to be posted to host from phy.
  5230. * Corresponding to errors defined in
  5231. * phyrx_abort_request_reason enums 32 to 63.
  5232. * Refer to RXPCU register definition header files for the
  5233. * phyrx_abort_request_reason enum definition.
  5234. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5235. * applicable if word mask enabled
  5236. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5237. * applicable if word mask enabled
  5238. * - b'19:31 - rsvd7
  5239. * dword15- b'0:16 - rx_msdu_end_word_mask
  5240. * - b'17:31 - rsvd5
  5241. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5242. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5243. * buffer
  5244. * 1: RX_PKT TLV logging at specified offset for the
  5245. * subsequent buffer
  5246. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5247. */
  5248. PREPACK struct htt_rx_ring_selection_cfg_t {
  5249. A_UINT32 msg_type: 8,
  5250. pdev_id: 8,
  5251. ring_id: 8,
  5252. status_swap: 1,
  5253. pkt_swap: 1,
  5254. rx_offsets_valid: 1,
  5255. drop_thresh_valid: 1,
  5256. rx_mon_global_en: 1,
  5257. rsvd1: 3;
  5258. A_UINT32 ring_buffer_size: 16,
  5259. config_length_mgmt:3,
  5260. config_length_ctrl:3,
  5261. config_length_data:3,
  5262. rx_hdr_len: 2,
  5263. rsvd2: 5;
  5264. A_UINT32 packet_type_enable_flags_0;
  5265. A_UINT32 packet_type_enable_flags_1;
  5266. A_UINT32 packet_type_enable_flags_2;
  5267. A_UINT32 packet_type_enable_flags_3;
  5268. A_UINT32 tlv_filter_in_flags;
  5269. A_UINT32 rx_packet_offset: 16,
  5270. rx_header_offset: 16;
  5271. A_UINT32 rx_mpdu_end_offset: 16,
  5272. rx_mpdu_start_offset: 16;
  5273. A_UINT32 rx_msdu_end_offset: 16,
  5274. rx_msdu_start_offset: 16;
  5275. A_UINT32 rx_attn_offset: 16,
  5276. rsvd3: 16;
  5277. A_UINT32 rx_drop_threshold: 10,
  5278. fp_ndp: 1,
  5279. mo_ndp: 1,
  5280. fp_phy_err: 1,
  5281. fp_phy_err_buf_src: 2,
  5282. fp_phy_err_buf_dest: 2,
  5283. pkt_type_enable_msdu_or_mpdu_logging:3,
  5284. dma_mpdu_mgmt: 1,
  5285. dma_mpdu_ctrl: 1,
  5286. dma_mpdu_data: 1,
  5287. word_mask_compaction_enable:1,
  5288. rbm_override_enable: 1,
  5289. rbm_override_val: 4,
  5290. rsvd4: 3;
  5291. A_UINT32 phy_err_mask;
  5292. A_UINT32 phy_err_mask_cont;
  5293. A_UINT32 rx_mpdu_start_word_mask:16,
  5294. rx_mpdu_end_word_mask: 3,
  5295. rsvd7: 13;
  5296. A_UINT32 rx_msdu_end_word_mask: 17,
  5297. rsvd5: 15;
  5298. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5299. rx_pkt_tlv_offset: 15,
  5300. rsvd6: 16;
  5301. } POSTPACK;
  5302. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5303. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5304. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5305. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5306. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5307. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5308. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5309. do { \
  5310. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5311. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5312. } while (0)
  5313. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5314. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5315. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5316. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5317. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5318. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5319. do { \
  5320. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5321. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5322. } while (0)
  5323. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5324. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5325. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5326. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5327. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5328. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5329. do { \
  5330. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5331. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5332. } while (0)
  5333. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5334. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5335. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5336. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5337. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5338. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5339. do { \
  5340. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5341. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5342. } while (0)
  5343. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5344. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5345. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5346. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5347. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5348. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5349. do { \
  5350. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5351. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5352. } while (0)
  5353. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5354. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5355. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5356. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5357. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5358. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5359. do { \
  5360. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5361. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5362. } while (0)
  5363. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5364. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5365. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5366. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5367. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5368. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5369. do { \
  5370. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5371. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5372. } while (0)
  5373. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5374. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5375. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5376. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5377. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5378. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5379. do { \
  5380. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5381. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5382. } while (0)
  5383. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5384. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5385. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5386. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5387. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5388. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5389. do { \
  5390. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5391. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5392. } while (0)
  5393. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5394. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5395. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5396. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5397. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5398. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5399. do { \
  5400. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5401. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5402. } while (0)
  5403. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5404. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5405. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5406. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5407. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5408. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5411. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5412. } while (0)
  5413. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5414. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5415. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5416. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5417. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5421. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5422. } while(0)
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5426. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5427. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5431. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5432. } while (0)
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5436. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5437. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5441. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5442. } while (0)
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5446. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5447. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5451. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5452. } while (0)
  5453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5456. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5457. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5461. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5462. } while (0)
  5463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5466. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5467. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5471. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5472. } while (0)
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5474. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5475. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5476. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5477. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5481. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5482. } while (0)
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5484. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5485. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5486. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5487. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5489. do { \
  5490. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5491. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5492. } while (0)
  5493. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5494. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5495. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5496. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5497. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5498. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5501. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5502. } while (0)
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5504. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5505. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5506. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5507. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5511. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5512. } while (0)
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5514. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5515. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5516. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5517. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5521. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5522. } while (0)
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5526. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5527. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5531. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5532. } while (0)
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5534. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5535. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5536. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5537. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5541. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5542. } while (0)
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5546. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5547. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5552. } while (0)
  5553. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5554. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5555. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5556. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5557. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5558. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5562. } while (0)
  5563. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5564. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5565. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5566. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5567. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5568. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5572. } while (0)
  5573. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5574. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5575. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5576. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5577. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5578. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5582. } while (0)
  5583. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5584. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5585. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5586. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5587. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5588. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5592. } while (0)
  5593. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5594. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5595. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5596. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5597. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5598. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5602. } while (0)
  5603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5606. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5607. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5612. } while (0)
  5613. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5614. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5615. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5616. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5617. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5618. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5622. } while (0)
  5623. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5624. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5625. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5626. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5627. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5628. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5632. } while (0)
  5633. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5634. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5635. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5636. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5637. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5638. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5639. do { \
  5640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5642. } while (0)
  5643. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5644. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5645. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5646. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5647. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5648. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5649. do { \
  5650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5652. } while (0)
  5653. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5654. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5655. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5656. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5657. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5658. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5659. do { \
  5660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5662. } while (0)
  5663. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5664. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5665. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5666. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5667. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5668. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5669. do { \
  5670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5672. } while (0)
  5673. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5674. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5675. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5676. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5677. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5678. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5679. do { \
  5680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5682. } while (0)
  5683. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5684. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5685. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5686. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5687. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5688. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5689. do { \
  5690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5692. } while (0)
  5693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5695. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5696. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5697. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5699. do { \
  5700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5702. } while (0)
  5703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5704. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5705. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5706. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5707. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5708. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5709. do { \
  5710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5712. } while (0)
  5713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5715. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5716. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5717. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5719. do { \
  5720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5722. } while (0)
  5723. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5724. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5725. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5726. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5727. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5728. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5729. do { \
  5730. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5731. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5732. } while (0)
  5733. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5734. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5735. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5736. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5737. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5738. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5739. do { \
  5740. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5741. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5742. } while (0)
  5743. /*
  5744. * Subtype based MGMT frames enable bits.
  5745. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5746. */
  5747. /* association request */
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5754. /* association response */
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5761. /* Reassociation request */
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5768. /* Reassociation response */
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5775. /* Probe request */
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5782. /* Probe response */
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5789. /* Timing Advertisement */
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5796. /* Reserved */
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5803. /* Beacon */
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5810. /* ATIM */
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5817. /* Disassociation */
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5824. /* Authentication */
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5831. /* Deauthentication */
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5838. /* Action */
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5845. /* Action No Ack */
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5852. /* Reserved */
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5859. /*
  5860. * Subtype based CTRL frames enable bits.
  5861. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5862. */
  5863. /* Reserved */
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5870. /* Reserved */
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5877. /* Reserved */
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5884. /* Reserved */
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5891. /* Reserved */
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5898. /* Reserved */
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5905. /* Reserved */
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5912. /* Control Wrapper */
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5919. /* Block Ack Request */
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5926. /* Block Ack*/
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5933. /* PS-POLL */
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5940. /* RTS */
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5947. /* CTS */
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5954. /* ACK */
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5961. /* CF-END */
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5968. /* CF-END + CF-ACK */
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5975. /* Multicast data */
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5982. /* Unicast data */
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5989. /* NULL data */
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5997. do { \
  5998. HTT_CHECK_SET_VAL(httsym, value); \
  5999. (word) |= (value) << httsym##_S; \
  6000. } while (0)
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6002. (((word) & httsym##_M) >> httsym##_S)
  6003. #define htt_rx_ring_pkt_enable_subtype_set( \
  6004. word, flag, mode, type, subtype, val) \
  6005. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6006. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6007. #define htt_rx_ring_pkt_enable_subtype_get( \
  6008. word, flag, mode, type, subtype) \
  6009. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6010. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6011. /* Definition to filter in TLVs */
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6040. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6041. do { \
  6042. HTT_CHECK_SET_VAL(httsym, enable); \
  6043. (word) |= (enable) << httsym##_S; \
  6044. } while (0)
  6045. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6046. (((word) & httsym##_M) >> httsym##_S)
  6047. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6048. HTT_RX_RING_TLV_ENABLE_SET( \
  6049. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6050. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6051. HTT_RX_RING_TLV_ENABLE_GET( \
  6052. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6053. /**
  6054. * @brief host -> target TX monitor config message
  6055. *
  6056. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6057. *
  6058. * @details
  6059. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6060. * configure RXDMA rings.
  6061. * The configuration is per ring based and includes both packet types
  6062. * and PPDU/MPDU TLVs.
  6063. *
  6064. * The message would appear as follows:
  6065. *
  6066. * |31 26|25|24|23 22|21|20|19|18 16|15|14|13|12|11|10|9|8|7|6|5|4|3|2 0|
  6067. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6068. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6069. * |-----------+--------+--------+-----+------------------------------------|
  6070. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6071. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6072. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6073. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6074. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6075. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6076. * |------------------------------------------------------------------------|
  6077. * | tlv_filter_mask_in0 |
  6078. * |------------------------------------------------------------------------|
  6079. * | tlv_filter_mask_in1 |
  6080. * |------------------------------------------------------------------------|
  6081. * | tlv_filter_mask_in2 |
  6082. * |------------------------------------------------------------------------|
  6083. * | tlv_filter_mask_in3 |
  6084. * |-----------------+-----------------+---------------------+--------------|
  6085. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6086. * |------------------------------------------------------------------------|
  6087. * | pcu_ppdu_setup_word_mask |
  6088. * |--------------------+--+--+--+-----+---------------------+--------------|
  6089. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6090. * |------------------------------------------------------------------------|
  6091. *
  6092. * Where:
  6093. * PS = pkt_swap
  6094. * SS = status_swap
  6095. * The message is interpreted as follows:
  6096. * dword0 - b'0:7 - msg_type: This will be set to
  6097. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6098. * b'8:15 - pdev_id:
  6099. * 0 (for rings at SOC level),
  6100. * 1/2/3 mac id (for rings at LMAC level)
  6101. * b'16:23 - ring_id : Identify the ring to configure.
  6102. * More details can be got from enum htt_srng_ring_id
  6103. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6104. * BUF_RING_CFG_0 defs within HW .h files,
  6105. * e.g. wmac_top_reg_seq_hwioreg.h
  6106. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6107. * BUF_RING_CFG_0 defs within HW .h files,
  6108. * e.g. wmac_top_reg_seq_hwioreg.h
  6109. * b'26 - tx_mon_global_en: Enable/Disable global register
  6110. * configuration in Tx monitor module.
  6111. * b'27:31 - rsvd1: reserved for future use
  6112. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6113. * in byte units.
  6114. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6115. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6116. * 64, 128, 256.
  6117. * If all 3 bits are set config length is > 256.
  6118. * if val is '0', then ignore this field.
  6119. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6120. * 64, 128, 256.
  6121. * If all 3 bits are set config length is > 256.
  6122. * if val is '0', then ignore this field.
  6123. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6124. * 64, 128, 256.
  6125. * If all 3 bits are set config length is > 256.
  6126. * If val is '0', then ignore this field.
  6127. * - b'25:31 - rsvd2: Reserved for future use
  6128. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6129. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6130. * If packet_type_enable_flags is '1' for MGMT type,
  6131. * monitor will ignore this bit and allow this TLV.
  6132. * If packet_type_enable_flags is '0' for MGMT type,
  6133. * monitor will use this bit to enable/disable logging
  6134. * of this TLV.
  6135. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6136. * If packet_type_enable_flags is '1' for CTRL type,
  6137. * monitor will ignore this bit and allow this TLV.
  6138. * If packet_type_enable_flags is '0' for CTRL type,
  6139. * monitor will use this bit to enable/disable logging
  6140. * of this TLV.
  6141. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6142. * If packet_type_enable_flags is '1' for DATA type,
  6143. * monitor will ignore this bit and allow this TLV.
  6144. * If packet_type_enable_flags is '0' for DATA type,
  6145. * monitor will use this bit to enable/disable logging
  6146. * of this TLV.
  6147. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6148. * If packet_type_enable_flags is '1' for MGMT type,
  6149. * monitor will ignore this bit and allow this TLV.
  6150. * If packet_type_enable_flags is '0' for MGMT type,
  6151. * monitor will use this bit to enable/disable logging
  6152. * of this TLV.
  6153. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6154. * If packet_type_enable_flags is '1' for CTRL type,
  6155. * monitor will ignore this bit and allow this TLV.
  6156. * If packet_type_enable_flags is '0' for CTRL type,
  6157. * monitor will use this bit to enable/disable logging
  6158. * of this TLV.
  6159. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6160. * If packet_type_enable_flags is '1' for DATA type,
  6161. * monitor will ignore this bit and allow this TLV.
  6162. * If packet_type_enable_flags is '0' for DATA type,
  6163. * monitor will use this bit to enable/disable logging
  6164. * of this TLV.
  6165. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6166. * If packet_type_enable_flags is '1' for MGMT type,
  6167. * monitor will ignore this bit and allow this TLV.
  6168. * If packet_type_enable_flags is '0' for MGMT type,
  6169. * monitor will use this bit to enable/disable logging
  6170. * of this TLV.
  6171. * If filter_in_TX_MPDU_START = 1 it is recommended
  6172. * to set this bit.
  6173. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6174. * If packet_type_enable_flags is '1' for CTRL type,
  6175. * monitor will ignore this bit and allow this TLV.
  6176. * If packet_type_enable_flags is '0' for CTRL type,
  6177. * monitor will use this bit to enable/disable logging
  6178. * of this TLV.
  6179. * If filter_in_TX_MPDU_START = 1 it is recommended
  6180. * to set this bit.
  6181. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6182. * If packet_type_enable_flags is '1' for DATA type,
  6183. * monitor will ignore this bit and allow this TLV.
  6184. * If packet_type_enable_flags is '0' for DATA type,
  6185. * monitor will use this bit to enable/disable logging
  6186. * of this TLV.
  6187. * If filter_in_TX_MPDU_START = 1 it is recommended
  6188. * to set this bit.
  6189. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6190. * If packet_type_enable_flags is '1' for MGMT type,
  6191. * monitor will ignore this bit and allow this TLV.
  6192. * If packet_type_enable_flags is '0' for MGMT type,
  6193. * monitor will use this bit to enable/disable logging
  6194. * of this TLV.
  6195. * If filter_in_TX_MSDU_START = 1 it is recommended
  6196. * to set this bit.
  6197. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6198. * If packet_type_enable_flags is '1' for CTRL type,
  6199. * monitor will ignore this bit and allow this TLV.
  6200. * If packet_type_enable_flags is '0' for CTRL type,
  6201. * monitor will use this bit to enable/disable logging
  6202. * of this TLV.
  6203. * If filter_in_TX_MSDU_START = 1 it is recommended
  6204. * to set this bit.
  6205. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6206. * If packet_type_enable_flags is '1' for DATA type,
  6207. * monitor will ignore this bit and allow this TLV.
  6208. * If packet_type_enable_flags is '0' for DATA type,
  6209. * monitor will use this bit to enable/disable logging
  6210. * of this TLV.
  6211. * If filter_in_TX_MSDU_START = 1 it is recommended
  6212. * to set this bit.
  6213. * b'15:31 - rsvd3: Reserved for future use
  6214. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6215. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6216. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6217. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6218. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6219. * - b'8:15 - tx_peer_entry_word_mask:
  6220. * - b'16:23 - tx_queue_ext_word_mask:
  6221. * - b'24:31 - tx_msdu_start_word_mask:
  6222. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6223. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6224. * - b'8:15 - rxpcu_user_setup_word_mask:
  6225. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6226. * MGMT, CTRL, DATA
  6227. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6228. * 0 -> MSDU level logging is enabled
  6229. * (valid only if bit is set in
  6230. * pkt_type_enable_msdu_or_mpdu_logging)
  6231. * 1 -> MPDU level logging is enabled
  6232. * (valid only if bit is set in
  6233. * pkt_type_enable_msdu_or_mpdu_logging)
  6234. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6235. * 0 -> MSDU level logging is enabled
  6236. * (valid only if bit is set in
  6237. * pkt_type_enable_msdu_or_mpdu_logging)
  6238. * 1 -> MPDU level logging is enabled
  6239. * (valid only if bit is set in
  6240. * pkt_type_enable_msdu_or_mpdu_logging)
  6241. * - b'21 - dma_mpdu_data(D) : For DATA
  6242. * 0 -> MSDU level logging is enabled
  6243. * (valid only if bit is set in
  6244. * pkt_type_enable_msdu_or_mpdu_logging)
  6245. * 1 -> MPDU level logging is enabled
  6246. * (valid only if bit is set in
  6247. * pkt_type_enable_msdu_or_mpdu_logging)
  6248. * - b'22:31 - rsvd4 for future use
  6249. */
  6250. PREPACK struct htt_tx_monitor_cfg_t {
  6251. A_UINT32 msg_type: 8,
  6252. pdev_id: 8,
  6253. ring_id: 8,
  6254. status_swap: 1,
  6255. pkt_swap: 1,
  6256. tx_mon_global_en: 1,
  6257. rsvd1: 5;
  6258. A_UINT32 ring_buffer_size: 16,
  6259. config_length_mgmt: 3,
  6260. config_length_ctrl: 3,
  6261. config_length_data: 3,
  6262. rsvd2: 7;
  6263. A_UINT32 pkt_type_enable_flags: 3,
  6264. filter_in_tx_mpdu_start_mgmt: 1,
  6265. filter_in_tx_mpdu_start_ctrl: 1,
  6266. filter_in_tx_mpdu_start_data: 1,
  6267. filter_in_tx_msdu_start_mgmt: 1,
  6268. filter_in_tx_msdu_start_ctrl: 1,
  6269. filter_in_tx_msdu_start_data: 1,
  6270. filter_in_tx_mpdu_end_mgmt: 1,
  6271. filter_in_tx_mpdu_end_ctrl: 1,
  6272. filter_in_tx_mpdu_end_data: 1,
  6273. filter_in_tx_msdu_end_mgmt: 1,
  6274. filter_in_tx_msdu_end_ctrl: 1,
  6275. filter_in_tx_msdu_end_data: 1,
  6276. rsvd3: 17;
  6277. A_UINT32 tlv_filter_mask_in0;
  6278. A_UINT32 tlv_filter_mask_in1;
  6279. A_UINT32 tlv_filter_mask_in2;
  6280. A_UINT32 tlv_filter_mask_in3;
  6281. A_UINT32 tx_fes_setup_word_mask: 8,
  6282. tx_peer_entry_word_mask: 8,
  6283. tx_queue_ext_word_mask: 8,
  6284. tx_msdu_start_word_mask: 8;
  6285. A_UINT32 pcu_ppdu_setup_word_mask;
  6286. A_UINT32 tx_mpdu_start_word_mask: 8,
  6287. rxpcu_user_setup_word_mask: 8,
  6288. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6289. dma_mpdu_mgmt: 1,
  6290. dma_mpdu_ctrl: 1,
  6291. dma_mpdu_data: 1,
  6292. rsvd4: 10;
  6293. } POSTPACK;
  6294. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6295. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6296. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6297. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6298. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6299. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6300. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6301. do { \
  6302. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6303. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6304. } while (0)
  6305. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6306. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6307. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6308. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6309. HTT_TX_MONITOR_CFG_RING_ID_S)
  6310. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6311. do { \
  6312. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6313. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6314. } while (0)
  6315. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6316. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6317. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6318. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6319. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6320. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6323. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6324. } while (0)
  6325. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6326. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6327. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6328. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6329. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6330. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6331. do { \
  6332. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6333. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6334. } while (0)
  6335. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6336. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6337. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6338. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6339. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6340. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6341. do { \
  6342. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6343. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6344. } while (0)
  6345. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6346. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6347. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6348. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6349. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6350. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6351. do { \
  6352. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6353. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6354. } while (0)
  6355. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6356. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6357. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6358. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6359. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6360. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6361. do { \
  6362. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6363. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6364. } while (0)
  6365. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6366. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6367. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6368. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6369. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6370. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6373. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6374. } while (0)
  6375. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6376. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6377. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6378. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6379. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6380. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6383. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6384. } while (0)
  6385. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6386. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6387. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6388. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6389. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6390. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6391. do { \
  6392. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6393. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6394. } while (0)
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6396. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6397. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6398. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6399. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6401. do { \
  6402. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6403. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6404. } while (0)
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6408. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6409. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6411. do { \
  6412. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6413. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6414. } while (0)
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6418. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6419. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6423. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6424. } while (0)
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6426. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6428. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6429. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6430. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6431. do { \
  6432. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6433. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6434. } while (0)
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6438. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6439. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6441. do { \
  6442. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6443. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6444. } while (0)
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6448. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6449. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6451. do { \
  6452. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6453. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6454. } while (0)
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6456. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6458. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6459. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6460. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6463. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6464. } while (0)
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6466. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6468. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6469. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6470. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6473. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6474. } while (0)
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6476. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6478. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6479. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6480. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6481. do { \
  6482. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6483. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6484. } while (0)
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6486. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6488. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6489. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6490. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6491. do { \
  6492. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6493. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6494. } while (0)
  6495. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6496. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6498. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6499. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6500. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6503. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6504. } while (0)
  6505. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6506. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6508. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6509. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6510. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6513. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6514. } while (0)
  6515. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6516. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6517. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6519. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6520. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6526. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6527. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6529. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6530. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6536. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6537. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6539. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6540. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6544. } while (0)
  6545. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6546. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6547. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6548. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6549. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6550. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6553. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6554. } while (0)
  6555. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6556. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6557. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6558. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6559. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6560. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6563. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6564. } while (0)
  6565. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6566. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6567. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6568. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6569. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6570. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6573. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6574. } while (0)
  6575. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6576. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6577. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6578. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6579. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6580. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6583. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6584. } while (0)
  6585. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6586. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6587. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6588. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6589. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6590. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6593. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6594. } while (0)
  6595. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6596. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6597. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6598. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6599. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6600. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6603. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6604. } while (0)
  6605. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6606. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6607. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6608. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6609. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6610. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6613. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6614. } while (0)
  6615. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6616. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6617. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6618. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6619. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6620. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6621. do { \
  6622. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6623. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6624. } while (0)
  6625. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6626. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6627. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6628. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6629. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6630. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6633. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6634. } while (0)
  6635. /*
  6636. * pkt_type_enable_flags
  6637. */
  6638. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6642. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6643. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6644. /*
  6645. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6646. */
  6647. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6648. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6649. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6650. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6651. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6652. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6653. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6654. do { \
  6655. HTT_CHECK_SET_VAL(httsym, value); \
  6656. (word) |= (value) << httsym##_S; \
  6657. } while (0)
  6658. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6659. (((word) & httsym##_M) >> httsym##_S)
  6660. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6661. * type -> MGMT, CTRL, DATA*/
  6662. #define htt_tx_ring_pkt_type_set( \
  6663. word, mode, type, val) \
  6664. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6665. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6666. #define htt_tx_ring_pkt_type_get( \
  6667. word, mode, type) \
  6668. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6669. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6670. /* Definition to filter in TLVs */
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6735. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6736. do { \
  6737. HTT_CHECK_SET_VAL(httsym, enable); \
  6738. (word) |= (enable) << httsym##_S; \
  6739. } while (0)
  6740. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6741. (((word) & httsym##_M) >> httsym##_S)
  6742. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6743. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6744. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6745. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6746. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6747. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6812. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6813. do { \
  6814. HTT_CHECK_SET_VAL(httsym, enable); \
  6815. (word) |= (enable) << httsym##_S; \
  6816. } while (0)
  6817. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6818. (((word) & httsym##_M) >> httsym##_S)
  6819. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6820. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6821. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6822. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6823. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6824. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6889. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6890. do { \
  6891. HTT_CHECK_SET_VAL(httsym, enable); \
  6892. (word) |= (enable) << httsym##_S; \
  6893. } while (0)
  6894. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6895. (((word) & httsym##_M) >> httsym##_S)
  6896. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6897. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6898. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6899. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6900. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6901. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6946. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6947. do { \
  6948. HTT_CHECK_SET_VAL(httsym, enable); \
  6949. (word) |= (enable) << httsym##_S; \
  6950. } while (0)
  6951. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6952. (((word) & httsym##_M) >> httsym##_S)
  6953. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6954. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6955. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6956. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6957. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6958. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6959. /**
  6960. * @brief host --> target Receive Flow Steering configuration message definition
  6961. *
  6962. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6963. *
  6964. * host --> target Receive Flow Steering configuration message definition.
  6965. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6966. * The reason for this is we want RFS to be configured and ready before MAC
  6967. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6968. *
  6969. * |31 24|23 16|15 9|8|7 0|
  6970. * |----------------+----------------+----------------+----------------|
  6971. * | reserved |E| msg type |
  6972. * |-------------------------------------------------------------------|
  6973. * Where E = RFS enable flag
  6974. *
  6975. * The RFS_CONFIG message consists of a single 4-byte word.
  6976. *
  6977. * Header fields:
  6978. * - MSG_TYPE
  6979. * Bits 7:0
  6980. * Purpose: identifies this as a RFS config msg
  6981. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6982. * - RFS_CONFIG
  6983. * Bit 8
  6984. * Purpose: Tells target whether to enable (1) or disable (0)
  6985. * flow steering feature when sending rx indication messages to host
  6986. */
  6987. #define HTT_H2T_RFS_CONFIG_M 0x100
  6988. #define HTT_H2T_RFS_CONFIG_S 8
  6989. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6990. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6991. HTT_H2T_RFS_CONFIG_S)
  6992. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6993. do { \
  6994. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6995. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6996. } while (0)
  6997. #define HTT_RFS_CFG_REQ_BYTES 4
  6998. /**
  6999. * @brief host -> target FW extended statistics request
  7000. *
  7001. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7002. *
  7003. * @details
  7004. * The following field definitions describe the format of the HTT host
  7005. * to target FW extended stats retrieve message.
  7006. * The message specifies the type of stats the host wants to retrieve.
  7007. *
  7008. * |31 24|23 16|15 8|7 0|
  7009. * |-----------------------------------------------------------|
  7010. * | reserved | stats type | pdev_mask | msg type |
  7011. * |-----------------------------------------------------------|
  7012. * | config param [0] |
  7013. * |-----------------------------------------------------------|
  7014. * | config param [1] |
  7015. * |-----------------------------------------------------------|
  7016. * | config param [2] |
  7017. * |-----------------------------------------------------------|
  7018. * | config param [3] |
  7019. * |-----------------------------------------------------------|
  7020. * | reserved |
  7021. * |-----------------------------------------------------------|
  7022. * | cookie LSBs |
  7023. * |-----------------------------------------------------------|
  7024. * | cookie MSBs |
  7025. * |-----------------------------------------------------------|
  7026. * Header fields:
  7027. * - MSG_TYPE
  7028. * Bits 7:0
  7029. * Purpose: identifies this is a extended stats upload request message
  7030. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7031. * - PDEV_MASK
  7032. * Bits 8:15
  7033. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7034. * Value: This is a overloaded field, refer to usage and interpretation of
  7035. * PDEV in interface document.
  7036. * Bit 8 : Reserved for SOC stats
  7037. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7038. * Indicates MACID_MASK in DBS
  7039. * - STATS_TYPE
  7040. * Bits 23:16
  7041. * Purpose: identifies which FW statistics to upload
  7042. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7043. * - Reserved
  7044. * Bits 31:24
  7045. * - CONFIG_PARAM [0]
  7046. * Bits 31:0
  7047. * Purpose: give an opaque configuration value to the specified stats type
  7048. * Value: stats-type specific configuration value
  7049. * Refer to htt_stats.h for interpretation for each stats sub_type
  7050. * - CONFIG_PARAM [1]
  7051. * Bits 31:0
  7052. * Purpose: give an opaque configuration value to the specified stats type
  7053. * Value: stats-type specific configuration value
  7054. * Refer to htt_stats.h for interpretation for each stats sub_type
  7055. * - CONFIG_PARAM [2]
  7056. * Bits 31:0
  7057. * Purpose: give an opaque configuration value to the specified stats type
  7058. * Value: stats-type specific configuration value
  7059. * Refer to htt_stats.h for interpretation for each stats sub_type
  7060. * - CONFIG_PARAM [3]
  7061. * Bits 31:0
  7062. * Purpose: give an opaque configuration value to the specified stats type
  7063. * Value: stats-type specific configuration value
  7064. * Refer to htt_stats.h for interpretation for each stats sub_type
  7065. * - Reserved [31:0] for future use.
  7066. * - COOKIE_LSBS
  7067. * Bits 31:0
  7068. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7069. * message with its preceding host->target stats request message.
  7070. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7071. * - COOKIE_MSBS
  7072. * Bits 31:0
  7073. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7074. * message with its preceding host->target stats request message.
  7075. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7076. */
  7077. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7078. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7079. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7080. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7081. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7082. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7083. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7084. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7085. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7086. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7087. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7088. do { \
  7089. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7090. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7091. } while (0)
  7092. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7093. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7094. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7095. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7096. do { \
  7097. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7098. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7099. } while (0)
  7100. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7101. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7102. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7103. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7104. do { \
  7105. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7106. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7107. } while (0)
  7108. /**
  7109. * @brief host -> target FW streaming statistics request
  7110. *
  7111. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7112. *
  7113. * @details
  7114. * The following field definitions describe the format of the HTT host
  7115. * to target message that requests the target to start or stop producing
  7116. * ongoing stats of the specified type.
  7117. *
  7118. * |31|30 |23 16|15 8|7 0|
  7119. * |-----------------------------------------------------------|
  7120. * |EN| reserved | stats type | reserved | msg type |
  7121. * |-----------------------------------------------------------|
  7122. * | config param [0] |
  7123. * |-----------------------------------------------------------|
  7124. * | config param [1] |
  7125. * |-----------------------------------------------------------|
  7126. * | config param [2] |
  7127. * |-----------------------------------------------------------|
  7128. * | config param [3] |
  7129. * |-----------------------------------------------------------|
  7130. * Where:
  7131. * - EN is an enable/disable flag
  7132. * Header fields:
  7133. * - MSG_TYPE
  7134. * Bits 7:0
  7135. * Purpose: identifies this is a streaming stats upload request message
  7136. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7137. * - STATS_TYPE
  7138. * Bits 23:16
  7139. * Purpose: identifies which FW statistics to upload
  7140. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7141. * Only the htt_dbg_ext_stats_type values identified as streaming
  7142. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7143. * - ENABLE
  7144. * Bit 31
  7145. * Purpose: enable/disable the target's ongoing stats of the specified type
  7146. * Value:
  7147. * 0 - disable ongoing production of the specified stats type
  7148. * 1 - enable ongoing production of the specified stats type
  7149. * - CONFIG_PARAM [0]
  7150. * Bits 31:0
  7151. * Purpose: give an opaque configuration value to the specified stats type
  7152. * Value: stats-type specific configuration value
  7153. * Refer to htt_stats.h for interpretation for each stats sub_type
  7154. * - CONFIG_PARAM [1]
  7155. * Bits 31:0
  7156. * Purpose: give an opaque configuration value to the specified stats type
  7157. * Value: stats-type specific configuration value
  7158. * Refer to htt_stats.h for interpretation for each stats sub_type
  7159. * - CONFIG_PARAM [2]
  7160. * Bits 31:0
  7161. * Purpose: give an opaque configuration value to the specified stats type
  7162. * Value: stats-type specific configuration value
  7163. * Refer to htt_stats.h for interpretation for each stats sub_type
  7164. * - CONFIG_PARAM [3]
  7165. * Bits 31:0
  7166. * Purpose: give an opaque configuration value to the specified stats type
  7167. * Value: stats-type specific configuration value
  7168. * Refer to htt_stats.h for interpretation for each stats sub_type
  7169. */
  7170. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7171. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7172. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7173. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7174. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7175. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7176. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7177. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7178. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7179. do { \
  7180. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7181. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7182. } while (0)
  7183. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7184. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7185. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7186. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7187. do { \
  7188. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7189. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7190. } while (0)
  7191. /**
  7192. * @brief host -> target FW PPDU_STATS request message
  7193. *
  7194. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7195. *
  7196. * @details
  7197. * The following field definitions describe the format of the HTT host
  7198. * to target FW for PPDU_STATS_CFG msg.
  7199. * The message allows the host to configure the PPDU_STATS_IND messages
  7200. * produced by the target.
  7201. *
  7202. * |31 24|23 16|15 8|7 0|
  7203. * |-----------------------------------------------------------|
  7204. * | REQ bit mask | pdev_mask | msg type |
  7205. * |-----------------------------------------------------------|
  7206. * Header fields:
  7207. * - MSG_TYPE
  7208. * Bits 7:0
  7209. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7210. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7211. * - PDEV_MASK
  7212. * Bits 8:15
  7213. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7214. * Value: This is a overloaded field, refer to usage and interpretation of
  7215. * PDEV in interface document.
  7216. * Bit 8 : Reserved for SOC stats
  7217. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7218. * Indicates MACID_MASK in DBS
  7219. * - REQ_TLV_BIT_MASK
  7220. * Bits 16:31
  7221. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7222. * needs to be included in the target's PPDU_STATS_IND messages.
  7223. * Value: refer htt_ppdu_stats_tlv_tag_t
  7224. *
  7225. */
  7226. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7227. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7228. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7229. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7230. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7231. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7232. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7233. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7234. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7235. do { \
  7236. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7237. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7238. } while (0)
  7239. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7240. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7241. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7242. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7243. do { \
  7244. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7245. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7246. } while (0)
  7247. /**
  7248. * @brief Host-->target HTT RX FSE setup message
  7249. *
  7250. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7251. *
  7252. * @details
  7253. * Through this message, the host will provide details of the flow tables
  7254. * in host DDR along with hash keys.
  7255. * This message can be sent per SOC or per PDEV, which is differentiated
  7256. * by pdev id values.
  7257. * The host will allocate flow search table and sends table size,
  7258. * physical DMA address of flow table, and hash keys to firmware to
  7259. * program into the RXOLE FSE HW block.
  7260. *
  7261. * The following field definitions describe the format of the RX FSE setup
  7262. * message sent from the host to target
  7263. *
  7264. * Header fields:
  7265. * dword0 - b'7:0 - msg_type: This will be set to
  7266. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7267. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7268. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7269. * pdev's LMAC ring.
  7270. * b'31:16 - reserved : Reserved for future use
  7271. * dword1 - b'19:0 - number of records: This field indicates the number of
  7272. * entries in the flow table. For example: 8k number of
  7273. * records is equivalent to
  7274. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7275. * b'27:20 - max search: This field specifies the skid length to FSE
  7276. * parser HW module whenever match is not found at the
  7277. * exact index pointed by hash.
  7278. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7279. * Refer htt_ip_da_sa_prefix below for more details.
  7280. * b'31:30 - reserved: Reserved for future use
  7281. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7282. * table allocated by host in DDR
  7283. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7284. * table allocated by host in DDR
  7285. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7286. * entry hashing
  7287. *
  7288. *
  7289. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7290. * |---------------------------------------------------------------|
  7291. * | reserved | pdev_id | MSG_TYPE |
  7292. * |---------------------------------------------------------------|
  7293. * |resvd|IPDSA| max_search | Number of records |
  7294. * |---------------------------------------------------------------|
  7295. * | base address lo |
  7296. * |---------------------------------------------------------------|
  7297. * | base address high |
  7298. * |---------------------------------------------------------------|
  7299. * | toeplitz key 31_0 |
  7300. * |---------------------------------------------------------------|
  7301. * | toeplitz key 63_32 |
  7302. * |---------------------------------------------------------------|
  7303. * | toeplitz key 95_64 |
  7304. * |---------------------------------------------------------------|
  7305. * | toeplitz key 127_96 |
  7306. * |---------------------------------------------------------------|
  7307. * | toeplitz key 159_128 |
  7308. * |---------------------------------------------------------------|
  7309. * | toeplitz key 191_160 |
  7310. * |---------------------------------------------------------------|
  7311. * | toeplitz key 223_192 |
  7312. * |---------------------------------------------------------------|
  7313. * | toeplitz key 255_224 |
  7314. * |---------------------------------------------------------------|
  7315. * | toeplitz key 287_256 |
  7316. * |---------------------------------------------------------------|
  7317. * | reserved | toeplitz key 314_288(26:0 bits) |
  7318. * |---------------------------------------------------------------|
  7319. * where:
  7320. * IPDSA = ip_da_sa
  7321. */
  7322. /**
  7323. * @brief: htt_ip_da_sa_prefix
  7324. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7325. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7326. * documentation per RFC3849
  7327. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7328. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7329. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7330. */
  7331. enum htt_ip_da_sa_prefix {
  7332. HTT_RX_IPV6_20010db8,
  7333. HTT_RX_IPV4_MAPPED_IPV6,
  7334. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7335. HTT_RX_IPV6_64FF9B,
  7336. };
  7337. /**
  7338. * @brief Host-->target HTT RX FISA configure and enable
  7339. *
  7340. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7341. *
  7342. * @details
  7343. * The host will send this command down to configure and enable the FISA
  7344. * operational params.
  7345. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7346. * register.
  7347. * Should configure both the MACs.
  7348. *
  7349. * dword0 - b'7:0 - msg_type:
  7350. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7351. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7352. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7353. * pdev's LMAC ring.
  7354. * b'31:16 - reserved : Reserved for future use
  7355. *
  7356. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7357. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7358. * packets. 1 flow search will be skipped
  7359. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7360. * tcp,udp packets
  7361. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7362. * calculation
  7363. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7364. * calculation
  7365. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7366. * calculation
  7367. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7368. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7369. * length
  7370. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7371. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7372. * length
  7373. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7374. * num jump
  7375. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7376. * num jump
  7377. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7378. * data type switch has happend for MPDU Sequence num jump
  7379. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7380. * for MPDU Sequence num jump
  7381. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7382. * for decrypt errors
  7383. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7384. * while aggregating a msdu
  7385. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7386. * The aggregation is done until (number of MSDUs aggregated
  7387. * < LIMIT + 1)
  7388. * b'31:18 - Reserved
  7389. *
  7390. * fisa_control_value - 32bit value FW can write to register
  7391. *
  7392. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7393. * Threshold value for FISA timeout (units are microseconds).
  7394. * When the global timestamp exceeds this threshold, FISA
  7395. * aggregation will be restarted.
  7396. * A value of 0 means timeout is disabled.
  7397. * Compare the threshold register with timestamp field in
  7398. * flow entry to generate timeout for the flow.
  7399. *
  7400. * |31 18 |17 16|15 8|7 0|
  7401. * |-------------------------------------------------------------|
  7402. * | reserved | pdev_mask | msg type |
  7403. * |-------------------------------------------------------------|
  7404. * | reserved | FISA_CTRL |
  7405. * |-------------------------------------------------------------|
  7406. * | FISA_TIMEOUT_THRESH |
  7407. * |-------------------------------------------------------------|
  7408. */
  7409. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7410. A_UINT32 msg_type:8,
  7411. pdev_id:8,
  7412. reserved0:16;
  7413. /**
  7414. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7415. * [17:0]
  7416. */
  7417. union {
  7418. /*
  7419. * fisa_control_bits structure is deprecated.
  7420. * Please use fisa_control_bits_v2 going forward.
  7421. */
  7422. struct {
  7423. A_UINT32 fisa_enable: 1,
  7424. ipsec_skip_search: 1,
  7425. nontcp_skip_search: 1,
  7426. add_ipv4_fixed_hdr_len: 1,
  7427. add_ipv6_fixed_hdr_len: 1,
  7428. add_tcp_fixed_hdr_len: 1,
  7429. add_udp_hdr_len: 1,
  7430. chksum_cum_ip_len_en: 1,
  7431. disable_tid_check: 1,
  7432. disable_ta_check: 1,
  7433. disable_qos_check: 1,
  7434. disable_raw_check: 1,
  7435. disable_decrypt_err_check: 1,
  7436. disable_msdu_drop_check: 1,
  7437. fisa_aggr_limit: 4,
  7438. reserved: 14;
  7439. } fisa_control_bits;
  7440. struct {
  7441. A_UINT32 fisa_enable: 1,
  7442. fisa_aggr_limit: 4,
  7443. reserved: 27;
  7444. } fisa_control_bits_v2;
  7445. A_UINT32 fisa_control_value;
  7446. } u_fisa_control;
  7447. /**
  7448. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7449. * timeout threshold for aggregation. Unit in usec.
  7450. * [31:0]
  7451. */
  7452. A_UINT32 fisa_timeout_threshold;
  7453. } POSTPACK;
  7454. /* DWord 0: pdev-ID */
  7455. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7456. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7457. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7458. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7459. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7460. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7461. do { \
  7462. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7463. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7464. } while (0)
  7465. /* Dword 1: fisa_control_value fisa config */
  7466. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7467. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7468. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7469. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7470. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7471. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7472. do { \
  7473. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7474. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7475. } while (0)
  7476. /* Dword 1: fisa_control_value ipsec_skip_search */
  7477. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7478. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7479. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7480. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7481. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7482. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7483. do { \
  7484. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7485. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7486. } while (0)
  7487. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7488. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7489. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7490. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7491. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7492. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7493. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7494. do { \
  7495. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7496. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7497. } while (0)
  7498. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7499. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7500. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7501. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7502. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7503. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7504. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7505. do { \
  7506. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7507. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7508. } while (0)
  7509. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7510. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7511. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7512. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7513. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7514. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7515. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7516. do { \
  7517. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7518. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7519. } while (0)
  7520. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7521. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7522. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7523. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7524. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7525. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7526. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7527. do { \
  7528. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7529. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7530. } while (0)
  7531. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7532. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7533. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7534. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7535. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7536. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7537. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7538. do { \
  7539. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7540. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7541. } while (0)
  7542. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7543. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7544. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7545. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7546. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7547. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7548. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7549. do { \
  7550. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7551. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7552. } while (0)
  7553. /* Dword 1: fisa_control_value disable_tid_check */
  7554. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7555. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7556. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7557. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7558. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7559. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7560. do { \
  7561. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7562. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7563. } while (0)
  7564. /* Dword 1: fisa_control_value disable_ta_check */
  7565. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7566. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7567. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7568. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7569. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7570. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7571. do { \
  7572. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7573. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7574. } while (0)
  7575. /* Dword 1: fisa_control_value disable_qos_check */
  7576. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7577. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7578. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7579. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7580. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7581. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7582. do { \
  7583. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7584. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7585. } while (0)
  7586. /* Dword 1: fisa_control_value disable_raw_check */
  7587. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7588. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7589. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7590. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7591. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7592. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7593. do { \
  7594. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7595. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7596. } while (0)
  7597. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7598. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7599. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7600. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7601. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7602. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7603. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7604. do { \
  7605. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7606. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7607. } while (0)
  7608. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7609. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7610. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7611. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7612. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7613. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7614. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7615. do { \
  7616. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7617. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7618. } while (0)
  7619. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7620. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7621. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7622. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7623. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7624. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7625. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7626. do { \
  7627. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7628. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7629. } while (0)
  7630. /* Dword 1: fisa_control_value fisa config */
  7631. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7632. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7633. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7634. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7635. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7636. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7637. do { \
  7638. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7639. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7640. } while (0)
  7641. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7642. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7643. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7644. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7645. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7646. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7647. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7648. do { \
  7649. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7650. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7651. } while (0)
  7652. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7653. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7654. pdev_id:8,
  7655. reserved0:16;
  7656. A_UINT32 num_records:20,
  7657. max_search:8,
  7658. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7659. reserved1:2;
  7660. A_UINT32 base_addr_lo;
  7661. A_UINT32 base_addr_hi;
  7662. A_UINT32 toeplitz31_0;
  7663. A_UINT32 toeplitz63_32;
  7664. A_UINT32 toeplitz95_64;
  7665. A_UINT32 toeplitz127_96;
  7666. A_UINT32 toeplitz159_128;
  7667. A_UINT32 toeplitz191_160;
  7668. A_UINT32 toeplitz223_192;
  7669. A_UINT32 toeplitz255_224;
  7670. A_UINT32 toeplitz287_256;
  7671. A_UINT32 toeplitz314_288:27,
  7672. reserved2:5;
  7673. } POSTPACK;
  7674. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7675. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7676. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7677. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7678. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7679. /* DWORD 0: Pdev ID */
  7680. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7681. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7682. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7683. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7684. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7685. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7686. do { \
  7687. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7688. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7689. } while (0)
  7690. /* DWORD 1:num of records */
  7691. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7692. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7693. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7694. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7695. HTT_RX_FSE_SETUP_NUM_REC_S)
  7696. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7697. do { \
  7698. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7699. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7700. } while (0)
  7701. /* DWORD 1:max_search */
  7702. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7703. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7704. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7705. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7706. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7707. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7708. do { \
  7709. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7710. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7711. } while (0)
  7712. /* DWORD 1:ip_da_sa prefix */
  7713. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7714. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7715. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7716. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7717. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7718. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7719. do { \
  7720. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7721. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7722. } while (0)
  7723. /* DWORD 2: Base Address LO */
  7724. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7725. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7726. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7727. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7728. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7729. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7730. do { \
  7731. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7732. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7733. } while (0)
  7734. /* DWORD 3: Base Address High */
  7735. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7736. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7737. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7738. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7739. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7740. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7743. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7744. } while (0)
  7745. /* DWORD 4-12: Hash Value */
  7746. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7747. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7748. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7749. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7750. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7751. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7754. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7755. } while (0)
  7756. /* DWORD 13: Hash Value 314:288 bits */
  7757. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7758. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7759. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7760. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7761. do { \
  7762. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7763. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7764. } while (0)
  7765. /**
  7766. * @brief Host-->target HTT RX FSE operation message
  7767. *
  7768. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7769. *
  7770. * @details
  7771. * The host will send this Flow Search Engine (FSE) operation message for
  7772. * every flow add/delete operation.
  7773. * The FSE operation includes FSE full cache invalidation or individual entry
  7774. * invalidation.
  7775. * This message can be sent per SOC or per PDEV which is differentiated
  7776. * by pdev id values.
  7777. *
  7778. * |31 16|15 8|7 1|0|
  7779. * |-------------------------------------------------------------|
  7780. * | reserved | pdev_id | MSG_TYPE |
  7781. * |-------------------------------------------------------------|
  7782. * | reserved | operation |I|
  7783. * |-------------------------------------------------------------|
  7784. * | ip_src_addr_31_0 |
  7785. * |-------------------------------------------------------------|
  7786. * | ip_src_addr_63_32 |
  7787. * |-------------------------------------------------------------|
  7788. * | ip_src_addr_95_64 |
  7789. * |-------------------------------------------------------------|
  7790. * | ip_src_addr_127_96 |
  7791. * |-------------------------------------------------------------|
  7792. * | ip_dst_addr_31_0 |
  7793. * |-------------------------------------------------------------|
  7794. * | ip_dst_addr_63_32 |
  7795. * |-------------------------------------------------------------|
  7796. * | ip_dst_addr_95_64 |
  7797. * |-------------------------------------------------------------|
  7798. * | ip_dst_addr_127_96 |
  7799. * |-------------------------------------------------------------|
  7800. * | l4_dst_port | l4_src_port |
  7801. * | (32-bit SPI incase of IPsec) |
  7802. * |-------------------------------------------------------------|
  7803. * | reserved | l4_proto |
  7804. * |-------------------------------------------------------------|
  7805. *
  7806. * where I is 1-bit ipsec_valid.
  7807. *
  7808. * The following field definitions describe the format of the RX FSE operation
  7809. * message sent from the host to target for every add/delete flow entry to flow
  7810. * table.
  7811. *
  7812. * Header fields:
  7813. * dword0 - b'7:0 - msg_type: This will be set to
  7814. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7815. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7816. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7817. * specified pdev's LMAC ring.
  7818. * b'31:16 - reserved : Reserved for future use
  7819. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7820. * (Internet Protocol Security).
  7821. * IPsec describes the framework for providing security at
  7822. * IP layer. IPsec is defined for both versions of IP:
  7823. * IPV4 and IPV6.
  7824. * Please refer to htt_rx_flow_proto enumeration below for
  7825. * more info.
  7826. * ipsec_valid = 1 for IPSEC packets
  7827. * ipsec_valid = 0 for IP Packets
  7828. * b'7:1 - operation: This indicates types of FSE operation.
  7829. * Refer to htt_rx_fse_operation enumeration:
  7830. * 0 - No Cache Invalidation required
  7831. * 1 - Cache invalidate only one entry given by IP
  7832. * src/dest address at DWORD[2:9]
  7833. * 2 - Complete FSE Cache Invalidation
  7834. * 3 - FSE Disable
  7835. * 4 - FSE Enable
  7836. * b'31:8 - reserved: Reserved for future use
  7837. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7838. * for per flow addition/deletion
  7839. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7840. * and the subsequent 3 A_UINT32 will be padding bytes.
  7841. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7842. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7843. * from 0 to 65535 but only 0 to 1023 are designated as
  7844. * well-known ports. Refer to [RFC1700] for more details.
  7845. * This field is valid only if
  7846. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7847. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7848. * range from 0 to 65535 but only 0 to 1023 are designated
  7849. * as well-known ports. Refer to [RFC1700] for more details.
  7850. * This field is valid only if
  7851. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7852. * - SPI (31:0): Security Parameters Index is an
  7853. * identification tag added to the header while using IPsec
  7854. * for tunneling the IP traffici.
  7855. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7856. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7857. * Assigned Internet Protocol Numbers.
  7858. * l4_proto numbers for standard protocol like UDP/TCP
  7859. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7860. * l4_proto = 17 for UDP etc.
  7861. * b'31:8 - reserved: Reserved for future use.
  7862. *
  7863. */
  7864. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7865. A_UINT32 msg_type:8,
  7866. pdev_id:8,
  7867. reserved0:16;
  7868. A_UINT32 ipsec_valid:1,
  7869. operation:7,
  7870. reserved1:24;
  7871. A_UINT32 ip_src_addr_31_0;
  7872. A_UINT32 ip_src_addr_63_32;
  7873. A_UINT32 ip_src_addr_95_64;
  7874. A_UINT32 ip_src_addr_127_96;
  7875. A_UINT32 ip_dest_addr_31_0;
  7876. A_UINT32 ip_dest_addr_63_32;
  7877. A_UINT32 ip_dest_addr_95_64;
  7878. A_UINT32 ip_dest_addr_127_96;
  7879. union {
  7880. A_UINT32 spi;
  7881. struct {
  7882. A_UINT32 l4_src_port:16,
  7883. l4_dest_port:16;
  7884. } ip;
  7885. } u;
  7886. A_UINT32 l4_proto:8,
  7887. reserved:24;
  7888. } POSTPACK;
  7889. /**
  7890. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7891. *
  7892. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7893. *
  7894. * @details
  7895. * The host will send this Full monitor mode register configuration message.
  7896. * This message can be sent per SOC or per PDEV which is differentiated
  7897. * by pdev id values.
  7898. *
  7899. * |31 16|15 11|10 8|7 3|2|1|0|
  7900. * |-------------------------------------------------------------|
  7901. * | reserved | pdev_id | MSG_TYPE |
  7902. * |-------------------------------------------------------------|
  7903. * | reserved |Release Ring |N|Z|E|
  7904. * |-------------------------------------------------------------|
  7905. *
  7906. * where E is 1-bit full monitor mode enable/disable.
  7907. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7908. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7909. *
  7910. * The following field definitions describe the format of the full monitor
  7911. * mode configuration message sent from the host to target for each pdev.
  7912. *
  7913. * Header fields:
  7914. * dword0 - b'7:0 - msg_type: This will be set to
  7915. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7916. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7917. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7918. * specified pdev's LMAC ring.
  7919. * b'31:16 - reserved : Reserved for future use.
  7920. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7921. * monitor mode rxdma register is to be enabled or disabled.
  7922. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7923. * additional descriptors at ppdu end for zero mpdus
  7924. * enabled or disabled.
  7925. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7926. * additional descriptors at ppdu end for non zero mpdus
  7927. * enabled or disabled.
  7928. * b'10:3 - release_ring: This indicates the destination ring
  7929. * selection for the descriptor at the end of PPDU
  7930. * 0 - REO ring select
  7931. * 1 - FW ring select
  7932. * 2 - SW ring select
  7933. * 3 - Release ring select
  7934. * Refer to htt_rx_full_mon_release_ring.
  7935. * b'31:11 - reserved for future use
  7936. */
  7937. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7938. A_UINT32 msg_type:8,
  7939. pdev_id:8,
  7940. reserved0:16;
  7941. A_UINT32 full_monitor_mode_enable:1,
  7942. addnl_descs_zero_mpdus_end:1,
  7943. addnl_descs_non_zero_mpdus_end:1,
  7944. release_ring:8,
  7945. reserved1:21;
  7946. } POSTPACK;
  7947. /**
  7948. * Enumeration for full monitor mode destination ring select
  7949. * 0 - REO destination ring select
  7950. * 1 - FW destination ring select
  7951. * 2 - SW destination ring select
  7952. * 3 - Release destination ring select
  7953. */
  7954. enum htt_rx_full_mon_release_ring {
  7955. HTT_RX_MON_RING_REO,
  7956. HTT_RX_MON_RING_FW,
  7957. HTT_RX_MON_RING_SW,
  7958. HTT_RX_MON_RING_RELEASE,
  7959. };
  7960. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7961. /* DWORD 0: Pdev ID */
  7962. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7963. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7964. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7965. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7966. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7967. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7970. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7971. } while (0)
  7972. /* DWORD 1:ENABLE */
  7973. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7974. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7975. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7976. do { \
  7977. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7978. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7979. } while (0)
  7980. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7981. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7982. /* DWORD 1:ZERO_MPDU */
  7983. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7984. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7985. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7986. do { \
  7987. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7988. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7989. } while (0)
  7990. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7991. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7992. /* DWORD 1:NON_ZERO_MPDU */
  7993. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7994. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7995. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7996. do { \
  7997. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7998. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7999. } while (0)
  8000. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8001. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8002. /* DWORD 1:RELEASE_RINGS */
  8003. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8004. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8005. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8006. do { \
  8007. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8008. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8009. } while (0)
  8010. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8011. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8012. /**
  8013. * Enumeration for IP Protocol or IPSEC Protocol
  8014. * IPsec describes the framework for providing security at IP layer.
  8015. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8016. */
  8017. enum htt_rx_flow_proto {
  8018. HTT_RX_FLOW_IP_PROTO,
  8019. HTT_RX_FLOW_IPSEC_PROTO,
  8020. };
  8021. /**
  8022. * Enumeration for FSE Cache Invalidation
  8023. * 0 - No Cache Invalidation required
  8024. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8025. * 2 - Complete FSE Cache Invalidation
  8026. * 3 - FSE Disable
  8027. * 4 - FSE Enable
  8028. */
  8029. enum htt_rx_fse_operation {
  8030. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8031. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8032. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8033. HTT_RX_FSE_DISABLE,
  8034. HTT_RX_FSE_ENABLE,
  8035. };
  8036. /* DWORD 0: Pdev ID */
  8037. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8038. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8039. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8040. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8041. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8042. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8043. do { \
  8044. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8045. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8046. } while (0)
  8047. /* DWORD 1:IP PROTO or IPSEC */
  8048. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8049. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8050. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8051. do { \
  8052. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8053. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8054. } while (0)
  8055. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8056. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8057. /* DWORD 1:FSE Operation */
  8058. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8059. #define HTT_RX_FSE_OPERATION_S 1
  8060. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8061. do { \
  8062. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8063. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8064. } while (0)
  8065. #define HTT_RX_FSE_OPERATION_GET(word) \
  8066. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8067. /* DWORD 2-9:IP Address */
  8068. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8069. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8070. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8071. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8072. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8073. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8074. do { \
  8075. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8076. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8077. } while (0)
  8078. /* DWORD 10:Source Port Number */
  8079. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8080. #define HTT_RX_FSE_SOURCEPORT_S 0
  8081. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8082. do { \
  8083. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8084. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8085. } while (0)
  8086. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8087. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8088. /* DWORD 11:Destination Port Number */
  8089. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8090. #define HTT_RX_FSE_DESTPORT_S 16
  8091. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8092. do { \
  8093. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8094. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8095. } while (0)
  8096. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8097. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8098. /* DWORD 10-11:SPI (In case of IPSEC) */
  8099. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8100. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8101. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8102. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8103. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8104. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8105. do { \
  8106. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8107. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8108. } while (0)
  8109. /* DWORD 12:L4 PROTO */
  8110. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8111. #define HTT_RX_FSE_L4_PROTO_S 0
  8112. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8113. do { \
  8114. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8115. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8116. } while (0)
  8117. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8118. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8119. /**
  8120. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8121. *
  8122. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8123. *
  8124. * |31 24|23 |15 8|7 2|1|0|
  8125. * |----------------+----------------+----------------+----------------|
  8126. * | reserved | pdev_id | msg_type |
  8127. * |---------------------------------+----------------+----------------|
  8128. * | reserved |E|F|
  8129. * |---------------------------------+----------------+----------------|
  8130. * Where E = Configure the target to provide the 3-tuple hash value in
  8131. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8132. * F = Configure the target to provide the 3-tuple hash value in
  8133. * flow_id_toeplitz field of rx_msdu_start tlv
  8134. *
  8135. * The following field definitions describe the format of the 3 tuple hash value
  8136. * message sent from the host to target as part of initialization sequence.
  8137. *
  8138. * Header fields:
  8139. * dword0 - b'7:0 - msg_type: This will be set to
  8140. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8141. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8142. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8143. * specified pdev's LMAC ring.
  8144. * b'31:16 - reserved : Reserved for future use
  8145. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8146. * b'1 - toeplitz_hash_2_or_4_field_enable
  8147. * b'31:2 - reserved : Reserved for future use
  8148. * ---------+------+----------------------------------------------------------
  8149. * bit1 | bit0 | Functionality
  8150. * ---------+------+----------------------------------------------------------
  8151. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8152. * | | in flow_id_toeplitz field
  8153. * ---------+------+----------------------------------------------------------
  8154. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8155. * | | in toeplitz_hash_2_or_4 field
  8156. * ---------+------+----------------------------------------------------------
  8157. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8158. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8159. * ---------+------+----------------------------------------------------------
  8160. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8161. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8162. * | | toeplitz_hash_2_or_4 field
  8163. *----------------------------------------------------------------------------
  8164. */
  8165. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8166. A_UINT32 msg_type :8,
  8167. pdev_id :8,
  8168. reserved0 :16;
  8169. A_UINT32 flow_id_toeplitz_field_enable :1,
  8170. toeplitz_hash_2_or_4_field_enable :1,
  8171. reserved1 :30;
  8172. } POSTPACK;
  8173. /* DWORD0 : pdev_id configuration Macros */
  8174. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8175. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8176. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8177. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8178. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8179. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8180. do { \
  8181. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8182. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8183. } while (0)
  8184. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8185. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8186. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8187. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8188. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8189. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8190. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8191. do { \
  8192. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8193. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8194. } while (0)
  8195. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8196. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8197. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8198. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8199. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8200. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8201. do { \
  8202. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8203. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8204. } while (0)
  8205. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8206. /**
  8207. * @brief host --> target Host PA Address Size
  8208. *
  8209. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8210. *
  8211. * @details
  8212. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8213. * provide the physical start address and size of each of the memory
  8214. * areas within host DDR that the target FW may need to access.
  8215. *
  8216. * For example, the host can use this message to allow the target FW
  8217. * to set up access to the host's pools of TQM link descriptors.
  8218. * The message would appear as follows:
  8219. *
  8220. * |31 24|23 16|15 8|7 0|
  8221. * |----------------+----------------+----------------+----------------|
  8222. * | reserved | num_entries | msg_type |
  8223. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8224. * | mem area 0 size |
  8225. * |----------------+----------------+----------------+----------------|
  8226. * | mem area 0 physical_address_lo |
  8227. * |----------------+----------------+----------------+----------------|
  8228. * | mem area 0 physical_address_hi |
  8229. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8230. * | mem area 1 size |
  8231. * |----------------+----------------+----------------+----------------|
  8232. * | mem area 1 physical_address_lo |
  8233. * |----------------+----------------+----------------+----------------|
  8234. * | mem area 1 physical_address_hi |
  8235. * |----------------+----------------+----------------+----------------|
  8236. * ...
  8237. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8238. * | mem area N size |
  8239. * |----------------+----------------+----------------+----------------|
  8240. * | mem area N physical_address_lo |
  8241. * |----------------+----------------+----------------+----------------|
  8242. * | mem area N physical_address_hi |
  8243. * |----------------+----------------+----------------+----------------|
  8244. *
  8245. * The message is interpreted as follows:
  8246. * dword0 - b'0:7 - msg_type: This will be set to
  8247. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8248. * b'8:15 - number_entries: Indicated the number of host memory
  8249. * areas specified within the remainder of the message
  8250. * b'16:31 - reserved.
  8251. * dword1 - b'0:31 - memory area 0 size in bytes
  8252. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8253. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8254. * and similar for memory area 1 through memory area N.
  8255. */
  8256. PREPACK struct htt_h2t_host_paddr_size {
  8257. A_UINT32 msg_type: 8,
  8258. num_entries: 8,
  8259. reserved: 16;
  8260. } POSTPACK;
  8261. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8262. A_UINT32 size;
  8263. A_UINT32 physical_address_lo;
  8264. A_UINT32 physical_address_hi;
  8265. } POSTPACK;
  8266. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8267. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8268. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8269. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8270. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8271. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8272. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8273. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8274. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8275. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8276. do { \
  8277. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8278. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8279. } while (0)
  8280. /**
  8281. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8282. *
  8283. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8284. *
  8285. * @details
  8286. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8287. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8288. *
  8289. * The message would appear as follows:
  8290. *
  8291. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8292. * |---------------------------------+---+---+----------+-+-----------|
  8293. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8294. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8295. *
  8296. *
  8297. * The message is interpreted as follows:
  8298. * dword0 - b'0:7 - msg_type: This will be set to
  8299. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8300. * b'8 - override bit to drive MSDUs to PPE ring
  8301. * b'9:13 - REO destination ring indication
  8302. * b'14 - Multi buffer msdu override enable bit
  8303. * b'15 - Intra BSS override
  8304. * b'16 - Decap raw override
  8305. * b'17 - Decap Native wifi override
  8306. * b'18 - IP frag override
  8307. * b'19:31 - reserved
  8308. */
  8309. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8310. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8311. override: 1,
  8312. reo_destination_indication: 5,
  8313. multi_buffer_msdu_override_en: 1,
  8314. intra_bss_override: 1,
  8315. decap_raw_override: 1,
  8316. decap_nwifi_override: 1,
  8317. ip_frag_override: 1,
  8318. reserved: 13;
  8319. } POSTPACK;
  8320. /* DWORD 0: Override */
  8321. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8322. #define HTT_PPE_CFG_OVERRIDE_S 8
  8323. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8324. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8325. HTT_PPE_CFG_OVERRIDE_S)
  8326. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8327. do { \
  8328. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8329. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8330. } while (0)
  8331. /* DWORD 0: REO Destination Indication*/
  8332. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8333. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8334. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8335. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8336. HTT_PPE_CFG_REO_DEST_IND_S)
  8337. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8340. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8341. } while (0)
  8342. /* DWORD 0: Multi buffer MSDU override */
  8343. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8344. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8345. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8346. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8347. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8348. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8349. do { \
  8350. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8351. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8352. } while (0)
  8353. /* DWORD 0: Intra BSS override */
  8354. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8355. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8356. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8357. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8358. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8359. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8362. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8363. } while (0)
  8364. /* DWORD 0: Decap RAW override */
  8365. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8366. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8367. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8368. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8369. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8370. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8371. do { \
  8372. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8373. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8374. } while (0)
  8375. /* DWORD 0: Decap NWIFI override */
  8376. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8377. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8378. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8379. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8380. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8381. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8382. do { \
  8383. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8384. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8385. } while (0)
  8386. /* DWORD 0: IP frag override */
  8387. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8388. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8389. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8390. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8391. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8392. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8393. do { \
  8394. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8395. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8396. } while (0)
  8397. /*
  8398. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8399. *
  8400. * @details
  8401. * The following field definitions describe the format of the HTT host
  8402. * to target FW VDEV TX RX stats retrieve message.
  8403. * The message specifies the type of stats the host wants to retrieve.
  8404. *
  8405. * |31 27|26 25|24 17|16|15 8|7 0|
  8406. * |-----------------------------------------------------------|
  8407. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8408. * |-----------------------------------------------------------|
  8409. * | vdev_id lower bitmask |
  8410. * |-----------------------------------------------------------|
  8411. * | vdev_id upper bitmask |
  8412. * |-----------------------------------------------------------|
  8413. * Header fields:
  8414. * Where:
  8415. * dword0 - b'7:0 - msg_type: This will be set to
  8416. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8417. * b'15:8 - pdev id
  8418. * b'16(E) - Enable/Disable the vdev HW stats
  8419. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8420. * b'25:26(R) - Reset stats bits
  8421. * 0: don't reset stats
  8422. * 1: reset stats once
  8423. * 2: reset stats at the start of each periodic interval
  8424. * b'27:31 - reserved for future use
  8425. * dword1 - b'0:31 - vdev_id lower bitmask
  8426. * dword2 - b'0:31 - vdev_id upper bitmask
  8427. */
  8428. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8429. A_UINT32 msg_type :8,
  8430. pdev_id :8,
  8431. enable :1,
  8432. periodic_interval :8,
  8433. reset_stats_bits :2,
  8434. reserved0 :5;
  8435. A_UINT32 vdev_id_lower_bitmask;
  8436. A_UINT32 vdev_id_upper_bitmask;
  8437. } POSTPACK;
  8438. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8439. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8440. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8441. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8442. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8443. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8444. do { \
  8445. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8446. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8447. } while (0)
  8448. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8449. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8450. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8451. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8452. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8453. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8454. do { \
  8455. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8456. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8457. } while (0)
  8458. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8459. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8460. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8461. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8462. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8463. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8464. do { \
  8465. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8466. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8467. } while (0)
  8468. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8469. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8470. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8471. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8472. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8473. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8474. do { \
  8475. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8476. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8477. } while (0)
  8478. /*
  8479. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8480. *
  8481. * @details
  8482. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8483. * the default MSDU queues for one of the TIDs within the specified peer
  8484. * to the specified service class.
  8485. * The TID is indirectly specified - each service class is associated
  8486. * with a TID. All default MSDU queues for this peer-TID will be
  8487. * linked to the service class in question.
  8488. *
  8489. * |31 16|15 8|7 0|
  8490. * |------------------------------+--------------+--------------|
  8491. * | peer ID | svc class ID | msg type |
  8492. * |------------------------------------------------------------|
  8493. * Header fields:
  8494. * dword0 - b'7:0 - msg_type: This will be set to
  8495. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8496. * b'15:8 - service class ID
  8497. * b'31:16 - peer ID
  8498. */
  8499. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8500. A_UINT32 msg_type :8,
  8501. svc_class_id :8,
  8502. peer_id :16;
  8503. } POSTPACK;
  8504. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8505. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8506. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8507. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8508. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8509. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8510. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8511. do { \
  8512. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8513. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8514. } while (0)
  8515. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8516. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8517. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8518. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8519. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8520. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8521. do { \
  8522. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8523. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8524. } while (0)
  8525. /*
  8526. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8527. *
  8528. * @details
  8529. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8530. * remove the linkage of the specified peer-TID's MSDU queues to
  8531. * service classes.
  8532. *
  8533. * |31 16|15 8|7 0|
  8534. * |------------------------------+--------------+--------------|
  8535. * | peer ID | svc class ID | msg type |
  8536. * |------------------------------------------------------------|
  8537. * Header fields:
  8538. * dword0 - b'7:0 - msg_type: This will be set to
  8539. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8540. * b'15:8 - service class ID
  8541. * b'31:16 - peer ID
  8542. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8543. * value for peer ID indicates that the target should
  8544. * apply the UNMAP_REQ to all peers.
  8545. */
  8546. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8547. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8548. A_UINT32 msg_type :8,
  8549. svc_class_id :8,
  8550. peer_id :16;
  8551. } POSTPACK;
  8552. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8553. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8554. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8555. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8556. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8557. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8558. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8559. do { \
  8560. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8561. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8562. } while (0)
  8563. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8564. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8565. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8566. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8567. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8568. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8569. do { \
  8570. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8571. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8572. } while (0)
  8573. /*
  8574. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8575. *
  8576. * @details
  8577. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8578. * request the target to report what service class the default MSDU queues
  8579. * of the specified TIDs within the peer are linked to.
  8580. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8581. * to report what service class (if any) the default MSDU queues for
  8582. * each of the specified TIDs are linked to.
  8583. *
  8584. * |31 16|15 8|7 1| 0|
  8585. * |------------------------------+--------------+--------------|
  8586. * | peer ID | TID mask | msg type |
  8587. * |------------------------------------------------------------|
  8588. * | reserved |ETO|
  8589. * |------------------------------------------------------------|
  8590. * Header fields:
  8591. * dword0 - b'7:0 - msg_type: This will be set to
  8592. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8593. * b'15:8 - TID mask
  8594. * b'31:16 - peer ID
  8595. * dword1 - b'0 - "Existing Tids Only" flag
  8596. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8597. * message generated by this REQ will only show the
  8598. * mapping for TIDs that actually exist in the target's
  8599. * peer object.
  8600. * Any TIDs that are covered by a MAP_REQ but which
  8601. * do not actually exist will be shown as being
  8602. * unmapped (i.e. svc class ID 0xff).
  8603. * If this flag is cleared, the MAP_REPORT_CONF message
  8604. * will consider not only the mapping of TIDs currently
  8605. * existing in the peer, but also the mapping that will
  8606. * be applied for any TID objects created within this
  8607. * peer in the future.
  8608. * b'31:1 - reserved for future use
  8609. */
  8610. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8611. A_UINT32 msg_type :8,
  8612. tid_mask :8,
  8613. peer_id :16;
  8614. A_UINT32 existing_tids_only:1,
  8615. reserved :31;
  8616. } POSTPACK;
  8617. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8618. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8619. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8620. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8621. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8622. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8623. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8624. do { \
  8625. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8626. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8627. } while (0)
  8628. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8629. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8630. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8631. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8632. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8633. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8634. do { \
  8635. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8636. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8637. } while (0)
  8638. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8639. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8640. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8641. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8642. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8643. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8644. do { \
  8645. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8646. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8647. } while (0)
  8648. /**
  8649. * @brief Format of shared memory between Host and Target
  8650. * for UMAC hang recovery feature messaging.
  8651. * @details
  8652. * This is shared memory between Host and Target allocated
  8653. * and used in chips where UMAC hang recovery feature is supported.
  8654. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8655. * then host interprets it as a new message from target.
  8656. * Host clears that particular read bit in t2h_msg after each read
  8657. * operation. It is vice versa for h2t_msg. At any given point
  8658. * of time there is expected to be only one bit set
  8659. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8660. *
  8661. * The message is interpreted as follows:
  8662. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8663. * added for debuggability purpose.
  8664. * dword1 - b'0 - do_pre_reset
  8665. * b'1 - do_post_reset_start
  8666. * b'2 - do_post_reset_complete
  8667. * b'3:31 - rsvd_t2h
  8668. * dword2 - b'0 - pre_reset_done
  8669. * b'1 - post_reset_start_done
  8670. * b'2 - post_reset_complete_done
  8671. * b'3:31 - rsvd_h2t
  8672. */
  8673. PREPACK typedef struct {
  8674. /** Magic number added for debuggability. */
  8675. A_UINT32 magic_num;
  8676. union {
  8677. /*
  8678. * BIT [0] :- T2H msg to do pre-reset
  8679. * BIT [1] :- T2H msg to do post-reset start
  8680. * BIT [2] :- T2H msg to do post-reset complete
  8681. * BIT [31 : 3] :- reserved
  8682. */
  8683. A_UINT32 t2h_msg;
  8684. struct {
  8685. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8686. do_post_reset_start : 1, /* BIT [1] */
  8687. do_post_reset_complete : 1, /* BIT [2] */
  8688. rsvd_t2h : 29; /* BIT [31 : 3] */
  8689. };
  8690. };
  8691. union {
  8692. /*
  8693. * BIT [0] :- H2T msg to send pre-reset done
  8694. * BIT [1] :- H2T msg to send post-reset start done
  8695. * BIT [2] :- H2T msg to send post-reset complete done
  8696. * BIT [31 : 3] :- reserved
  8697. */
  8698. A_UINT32 h2t_msg;
  8699. struct {
  8700. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8701. post_reset_start_done : 1, /* BIT [1] */
  8702. post_reset_complete_done : 1, /* BIT [2] */
  8703. rsvd_h2t : 29; /* BIT [31 : 3] */
  8704. };
  8705. };
  8706. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8707. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8708. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8709. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8710. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8711. /* dword1 - b'0 - do_pre_reset */
  8712. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8713. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8714. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8715. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8716. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8717. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8718. do { \
  8719. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8720. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8721. } while (0)
  8722. /* dword1 - b'1 - do_post_reset_start */
  8723. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8724. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8725. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8726. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8727. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8728. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8729. do { \
  8730. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8731. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8732. } while (0)
  8733. /* dword1 - b'2 - do_post_reset_complete */
  8734. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8735. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8736. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8737. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8738. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8739. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8740. do { \
  8741. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8742. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8743. } while (0)
  8744. /* dword2 - b'0 - pre_reset_done */
  8745. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8746. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8747. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8748. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8749. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8750. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8751. do { \
  8752. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8753. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8754. } while (0)
  8755. /* dword2 - b'1 - post_reset_start_done */
  8756. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8757. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8758. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8759. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8760. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8761. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8762. do { \
  8763. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8764. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8765. } while (0)
  8766. /* dword2 - b'2 - post_reset_complete_done */
  8767. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8768. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8769. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8770. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8771. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8772. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8773. do { \
  8774. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8775. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8776. } while (0)
  8777. /**
  8778. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8779. *
  8780. * @details
  8781. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8782. * by the host to provide prerequisite info to target for the UMAC hang
  8783. * recovery feature.
  8784. * The info sent in this H2T message are T2H message method, H2T message
  8785. * method, T2H MSI interrupt number and physical start address, size of
  8786. * the shared memory (refers to the shared memory dedicated for messaging
  8787. * between host and target when the DUT is in UMAC hang recovery mode).
  8788. * This H2T message is expected to be only sent if the WMI service bit
  8789. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8790. *
  8791. * |31 16|15 12|11 8|7 0|
  8792. * |-------------------------------+--------------+--------------+------------|
  8793. * | reserved |h2t msg method|t2h msg method| msg_type |
  8794. * |--------------------------------------------------------------------------|
  8795. * | t2h msi interrupt number |
  8796. * |--------------------------------------------------------------------------|
  8797. * | shared memory area size |
  8798. * |--------------------------------------------------------------------------|
  8799. * | shared memory area physical address low |
  8800. * |--------------------------------------------------------------------------|
  8801. * | shared memory area physical address high |
  8802. * |--------------------------------------------------------------------------|
  8803. *
  8804. * The message is interpreted as follows:
  8805. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8806. * b'8:11 - t2h_msg_method: indicates method to be used for
  8807. * T2H communication in UMAC hang recovery mode.
  8808. * Value zero indicates MSI interrupt (default method).
  8809. * Refer to htt_umac_hang_recovery_msg_method enum.
  8810. * b'12:15 - h2t_msg_method: indicates method to be used for
  8811. * H2T communication in UMAC hang recovery mode.
  8812. * Value zero indicates polling by target for this h2t msg
  8813. * during UMAC hang recovery mode.
  8814. * Refer to htt_umac_hang_recovery_msg_method enum.
  8815. * b'16:31 - reserved.
  8816. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8817. * T2H communication in UMAC hang recovery mode.
  8818. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8819. * only when in UMAC hang recovery mode.
  8820. * This refers to size in bytes.
  8821. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8822. * of the shared memory dedicated for messaging only when
  8823. * in UMAC hang recovery mode.
  8824. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8825. * of the shared memory dedicated for messaging only when
  8826. * in UMAC hang recovery mode.
  8827. */
  8828. /* t2h_msg_method and h2t_msg_method */
  8829. enum htt_umac_hang_recovery_msg_method {
  8830. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8831. };
  8832. PREPACK typedef struct {
  8833. A_UINT32 msg_type : 8,
  8834. t2h_msg_method : 4,
  8835. h2t_msg_method : 4,
  8836. reserved : 16;
  8837. A_UINT32 t2h_msi_data;
  8838. /* size bytes and physical address of shared memory. */
  8839. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8840. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8841. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8842. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8843. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8844. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8845. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8846. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8847. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8848. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8849. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8850. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8851. do { \
  8852. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8853. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8854. } while (0)
  8855. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8856. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8857. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8858. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8859. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8860. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8861. do { \
  8862. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8863. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8864. } while (0)
  8865. /*=== target -> host messages ===============================================*/
  8866. enum htt_t2h_msg_type {
  8867. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8868. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8869. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8870. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8871. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8872. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8873. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8874. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8875. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8876. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8877. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8878. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8879. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8880. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8881. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8882. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8883. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8884. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8885. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8886. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8887. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8888. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8889. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8890. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8891. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8892. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8893. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8894. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8895. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8896. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8897. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8898. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8899. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8900. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8901. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8902. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8903. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8904. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8905. /* TX_OFFLOAD_DELIVER_IND:
  8906. * Forward the target's locally-generated packets to the host,
  8907. * to provide to the monitor mode interface.
  8908. */
  8909. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8910. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8911. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8912. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8913. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8914. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8915. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8916. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8917. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8918. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8919. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8920. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8921. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8922. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8923. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8924. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8925. HTT_T2H_MSG_TYPE_TEST,
  8926. /* keep this last */
  8927. HTT_T2H_NUM_MSGS
  8928. };
  8929. /*
  8930. * HTT target to host message type -
  8931. * stored in bits 7:0 of the first word of the message
  8932. */
  8933. #define HTT_T2H_MSG_TYPE_M 0xff
  8934. #define HTT_T2H_MSG_TYPE_S 0
  8935. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8936. do { \
  8937. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8938. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8939. } while (0)
  8940. #define HTT_T2H_MSG_TYPE_GET(word) \
  8941. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8942. /**
  8943. * @brief target -> host version number confirmation message definition
  8944. *
  8945. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8946. *
  8947. * |31 24|23 16|15 8|7 0|
  8948. * |----------------+----------------+----------------+----------------|
  8949. * | reserved | major number | minor number | msg type |
  8950. * |-------------------------------------------------------------------|
  8951. * : option request TLV (optional) |
  8952. * :...................................................................:
  8953. *
  8954. * The VER_CONF message may consist of a single 4-byte word, or may be
  8955. * extended with TLVs that specify HTT options selected by the target.
  8956. * The following option TLVs may be appended to the VER_CONF message:
  8957. * - LL_BUS_ADDR_SIZE
  8958. * - HL_SUPPRESS_TX_COMPL_IND
  8959. * - MAX_TX_QUEUE_GROUPS
  8960. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8961. * may be appended to the VER_CONF message (but only one TLV of each type).
  8962. *
  8963. * Header fields:
  8964. * - MSG_TYPE
  8965. * Bits 7:0
  8966. * Purpose: identifies this as a version number confirmation message
  8967. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8968. * - VER_MINOR
  8969. * Bits 15:8
  8970. * Purpose: Specify the minor number of the HTT message library version
  8971. * in use by the target firmware.
  8972. * The minor number specifies the specific revision within a range
  8973. * of fundamentally compatible HTT message definition revisions.
  8974. * Compatible revisions involve adding new messages or perhaps
  8975. * adding new fields to existing messages, in a backwards-compatible
  8976. * manner.
  8977. * Incompatible revisions involve changing the message type values,
  8978. * or redefining existing messages.
  8979. * Value: minor number
  8980. * - VER_MAJOR
  8981. * Bits 15:8
  8982. * Purpose: Specify the major number of the HTT message library version
  8983. * in use by the target firmware.
  8984. * The major number specifies the family of minor revisions that are
  8985. * fundamentally compatible with each other, but not with prior or
  8986. * later families.
  8987. * Value: major number
  8988. */
  8989. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8990. #define HTT_VER_CONF_MINOR_S 8
  8991. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8992. #define HTT_VER_CONF_MAJOR_S 16
  8993. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8996. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8997. } while (0)
  8998. #define HTT_VER_CONF_MINOR_GET(word) \
  8999. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9000. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9003. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9004. } while (0)
  9005. #define HTT_VER_CONF_MAJOR_GET(word) \
  9006. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9007. #define HTT_VER_CONF_BYTES 4
  9008. /**
  9009. * @brief - target -> host HTT Rx In order indication message
  9010. *
  9011. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9012. *
  9013. * @details
  9014. *
  9015. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9016. * |----------------+-------------------+---------------------+---------------|
  9017. * | peer ID | P| F| O| ext TID | msg type |
  9018. * |--------------------------------------------------------------------------|
  9019. * | MSDU count | Reserved | vdev id |
  9020. * |--------------------------------------------------------------------------|
  9021. * | MSDU 0 bus address (bits 31:0) |
  9022. #if HTT_PADDR64
  9023. * | MSDU 0 bus address (bits 63:32) |
  9024. #endif
  9025. * |--------------------------------------------------------------------------|
  9026. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9027. * |--------------------------------------------------------------------------|
  9028. * | MSDU 1 bus address (bits 31:0) |
  9029. #if HTT_PADDR64
  9030. * | MSDU 1 bus address (bits 63:32) |
  9031. #endif
  9032. * |--------------------------------------------------------------------------|
  9033. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9034. * |--------------------------------------------------------------------------|
  9035. */
  9036. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9037. *
  9038. * @details
  9039. * bits
  9040. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9041. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9042. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9043. * | | frag | | | | fail |chksum fail|
  9044. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9045. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9046. */
  9047. struct htt_rx_in_ord_paddr_ind_hdr_t
  9048. {
  9049. A_UINT32 /* word 0 */
  9050. msg_type: 8,
  9051. ext_tid: 5,
  9052. offload: 1,
  9053. frag: 1,
  9054. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9055. peer_id: 16;
  9056. A_UINT32 /* word 1 */
  9057. vap_id: 8,
  9058. /* NOTE:
  9059. * This reserved_1 field is not truly reserved - certain targets use
  9060. * this field internally to store debug information, and do not zero
  9061. * out the contents of the field before uploading the message to the
  9062. * host. Thus, any host-target communication supported by this field
  9063. * is limited to using values that are never used by the debug
  9064. * information stored by certain targets in the reserved_1 field.
  9065. * In particular, the targets in question don't use the value 0x3
  9066. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9067. * so this previously-unused value within these bits is available to
  9068. * use as the host / target PKT_CAPTURE_MODE flag.
  9069. */
  9070. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9071. /* if pkt_capture_mode == 0x3, host should
  9072. * send rx frames to monitor mode interface
  9073. */
  9074. msdu_cnt: 16;
  9075. };
  9076. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9077. {
  9078. A_UINT32 dma_addr;
  9079. A_UINT32
  9080. length: 16,
  9081. fw_desc: 8,
  9082. msdu_info:8;
  9083. };
  9084. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9085. {
  9086. A_UINT32 dma_addr_lo;
  9087. A_UINT32 dma_addr_hi;
  9088. A_UINT32
  9089. length: 16,
  9090. fw_desc: 8,
  9091. msdu_info:8;
  9092. };
  9093. #if HTT_PADDR64
  9094. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9095. #else
  9096. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9097. #endif
  9098. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9099. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9100. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9101. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9102. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9103. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9104. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9106. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9107. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9108. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9109. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9110. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9111. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9112. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9113. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9114. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9115. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9116. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9117. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9118. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9119. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9120. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9121. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9122. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9123. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9124. /* for systems using 64-bit format for bus addresses */
  9125. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9126. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9127. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9128. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9129. /* for systems using 32-bit format for bus addresses */
  9130. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9131. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9132. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9133. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9134. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9135. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9136. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9137. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9138. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9139. do { \
  9140. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9141. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9142. } while (0)
  9143. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9144. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9145. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9146. do { \
  9147. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9148. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9149. } while (0)
  9150. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9151. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9152. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9153. do { \
  9154. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9155. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9156. } while (0)
  9157. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9158. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9159. /*
  9160. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9161. * deliver the rx frames to the monitor mode interface.
  9162. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9163. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9164. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9165. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9166. */
  9167. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9168. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9169. do { \
  9170. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9171. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9172. } while (0)
  9173. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9174. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9175. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9177. do { \
  9178. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9179. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9180. } while (0)
  9181. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9182. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9183. /* for systems using 64-bit format for bus addresses */
  9184. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9185. do { \
  9186. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9187. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9188. } while (0)
  9189. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9190. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9191. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9192. do { \
  9193. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9194. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9195. } while (0)
  9196. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9197. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9198. /* for systems using 32-bit format for bus addresses */
  9199. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9200. do { \
  9201. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9202. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9203. } while (0)
  9204. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9205. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9206. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9207. do { \
  9208. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9209. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9210. } while (0)
  9211. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9212. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9213. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9214. do { \
  9215. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9216. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9217. } while (0)
  9218. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9219. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9220. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9223. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9224. } while (0)
  9225. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9226. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9227. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9228. do { \
  9229. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9230. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9231. } while (0)
  9232. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9233. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9234. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9235. do { \
  9236. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9237. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9238. } while (0)
  9239. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9240. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9241. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9242. do { \
  9243. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9244. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9245. } while (0)
  9246. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9247. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9248. /* definitions used within target -> host rx indication message */
  9249. PREPACK struct htt_rx_ind_hdr_prefix_t
  9250. {
  9251. A_UINT32 /* word 0 */
  9252. msg_type: 8,
  9253. ext_tid: 5,
  9254. release_valid: 1,
  9255. flush_valid: 1,
  9256. reserved0: 1,
  9257. peer_id: 16;
  9258. A_UINT32 /* word 1 */
  9259. flush_start_seq_num: 6,
  9260. flush_end_seq_num: 6,
  9261. release_start_seq_num: 6,
  9262. release_end_seq_num: 6,
  9263. num_mpdu_ranges: 8;
  9264. } POSTPACK;
  9265. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9266. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9267. #define HTT_TGT_RSSI_INVALID 0x80
  9268. PREPACK struct htt_rx_ppdu_desc_t
  9269. {
  9270. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9271. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9272. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9273. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9274. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9275. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9276. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9277. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9278. A_UINT32 /* word 0 */
  9279. rssi_cmb: 8,
  9280. timestamp_submicrosec: 8,
  9281. phy_err_code: 8,
  9282. phy_err: 1,
  9283. legacy_rate: 4,
  9284. legacy_rate_sel: 1,
  9285. end_valid: 1,
  9286. start_valid: 1;
  9287. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9288. union {
  9289. A_UINT32 /* word 1 */
  9290. rssi0_pri20: 8,
  9291. rssi0_ext20: 8,
  9292. rssi0_ext40: 8,
  9293. rssi0_ext80: 8;
  9294. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9295. } u0;
  9296. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9297. union {
  9298. A_UINT32 /* word 2 */
  9299. rssi1_pri20: 8,
  9300. rssi1_ext20: 8,
  9301. rssi1_ext40: 8,
  9302. rssi1_ext80: 8;
  9303. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9304. } u1;
  9305. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9306. union {
  9307. A_UINT32 /* word 3 */
  9308. rssi2_pri20: 8,
  9309. rssi2_ext20: 8,
  9310. rssi2_ext40: 8,
  9311. rssi2_ext80: 8;
  9312. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9313. } u2;
  9314. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9315. union {
  9316. A_UINT32 /* word 4 */
  9317. rssi3_pri20: 8,
  9318. rssi3_ext20: 8,
  9319. rssi3_ext40: 8,
  9320. rssi3_ext80: 8;
  9321. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9322. } u3;
  9323. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9324. A_UINT32 tsf32; /* word 5 */
  9325. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9326. A_UINT32 timestamp_microsec; /* word 6 */
  9327. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9328. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9329. A_UINT32 /* word 7 */
  9330. vht_sig_a1: 24,
  9331. preamble_type: 8;
  9332. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9333. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9334. A_UINT32 /* word 8 */
  9335. vht_sig_a2: 24,
  9336. /* sa_ant_matrix
  9337. * For cases where a single rx chain has options to be connected to
  9338. * different rx antennas, show which rx antennas were in use during
  9339. * receipt of a given PPDU.
  9340. * This sa_ant_matrix provides a bitmask of the antennas used while
  9341. * receiving this frame.
  9342. */
  9343. sa_ant_matrix: 8;
  9344. } POSTPACK;
  9345. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9346. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9347. PREPACK struct htt_rx_ind_hdr_suffix_t
  9348. {
  9349. A_UINT32 /* word 0 */
  9350. fw_rx_desc_bytes: 16,
  9351. reserved0: 16;
  9352. } POSTPACK;
  9353. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9354. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9355. PREPACK struct htt_rx_ind_hdr_t
  9356. {
  9357. struct htt_rx_ind_hdr_prefix_t prefix;
  9358. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9359. struct htt_rx_ind_hdr_suffix_t suffix;
  9360. } POSTPACK;
  9361. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9362. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9363. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9364. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9365. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9366. /*
  9367. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9368. * the offset into the HTT rx indication message at which the
  9369. * FW rx PPDU descriptor resides
  9370. */
  9371. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9372. /*
  9373. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9374. * the offset into the HTT rx indication message at which the
  9375. * header suffix (FW rx MSDU byte count) resides
  9376. */
  9377. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9378. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9379. /*
  9380. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9381. * the offset into the HTT rx indication message at which the per-MSDU
  9382. * information starts
  9383. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9384. * per-MSDU information portion of the message. The per-MSDU info itself
  9385. * starts at byte 12.
  9386. */
  9387. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9388. /**
  9389. * @brief target -> host rx indication message definition
  9390. *
  9391. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9392. *
  9393. * @details
  9394. * The following field definitions describe the format of the rx indication
  9395. * message sent from the target to the host.
  9396. * The message consists of three major sections:
  9397. * 1. a fixed-length header
  9398. * 2. a variable-length list of firmware rx MSDU descriptors
  9399. * 3. one or more 4-octet MPDU range information elements
  9400. * The fixed length header itself has two sub-sections
  9401. * 1. the message meta-information, including identification of the
  9402. * sender and type of the received data, and a 4-octet flush/release IE
  9403. * 2. the firmware rx PPDU descriptor
  9404. *
  9405. * The format of the message is depicted below.
  9406. * in this depiction, the following abbreviations are used for information
  9407. * elements within the message:
  9408. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9409. * elements associated with the PPDU start are valid.
  9410. * Specifically, the following fields are valid only if SV is set:
  9411. * RSSI (all variants), L, legacy rate, preamble type, service,
  9412. * VHT-SIG-A
  9413. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9414. * elements associated with the PPDU end are valid.
  9415. * Specifically, the following fields are valid only if EV is set:
  9416. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9417. * - L - Legacy rate selector - if legacy rates are used, this flag
  9418. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9419. * (L == 0) PHY.
  9420. * - P - PHY error flag - boolean indication of whether the rx frame had
  9421. * a PHY error
  9422. *
  9423. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9424. * |----------------+-------------------+---------------------+---------------|
  9425. * | peer ID | |RV|FV| ext TID | msg type |
  9426. * |--------------------------------------------------------------------------|
  9427. * | num | release | release | flush | flush |
  9428. * | MPDU | end | start | end | start |
  9429. * | ranges | seq num | seq num | seq num | seq num |
  9430. * |==========================================================================|
  9431. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9432. * |V|V| | rate | | | timestamp | RSSI |
  9433. * |--------------------------------------------------------------------------|
  9434. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9435. * |--------------------------------------------------------------------------|
  9436. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9437. * |--------------------------------------------------------------------------|
  9438. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9439. * |--------------------------------------------------------------------------|
  9440. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9441. * |--------------------------------------------------------------------------|
  9442. * | TSF LSBs |
  9443. * |--------------------------------------------------------------------------|
  9444. * | microsec timestamp |
  9445. * |--------------------------------------------------------------------------|
  9446. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9447. * |--------------------------------------------------------------------------|
  9448. * | service | HT-SIG / VHT-SIG-A2 |
  9449. * |==========================================================================|
  9450. * | reserved | FW rx desc bytes |
  9451. * |--------------------------------------------------------------------------|
  9452. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9453. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9454. * |--------------------------------------------------------------------------|
  9455. * : : :
  9456. * |--------------------------------------------------------------------------|
  9457. * | alignment | MSDU Rx |
  9458. * | padding | desc Bn |
  9459. * |--------------------------------------------------------------------------|
  9460. * | reserved | MPDU range status | MPDU count |
  9461. * |--------------------------------------------------------------------------|
  9462. * : reserved : MPDU range status : MPDU count :
  9463. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9464. *
  9465. * Header fields:
  9466. * - MSG_TYPE
  9467. * Bits 7:0
  9468. * Purpose: identifies this as an rx indication message
  9469. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9470. * - EXT_TID
  9471. * Bits 12:8
  9472. * Purpose: identify the traffic ID of the rx data, including
  9473. * special "extended" TID values for multicast, broadcast, and
  9474. * non-QoS data frames
  9475. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9476. * - FLUSH_VALID (FV)
  9477. * Bit 13
  9478. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9479. * is valid
  9480. * Value:
  9481. * 1 -> flush IE is valid and needs to be processed
  9482. * 0 -> flush IE is not valid and should be ignored
  9483. * - REL_VALID (RV)
  9484. * Bit 13
  9485. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9486. * is valid
  9487. * Value:
  9488. * 1 -> release IE is valid and needs to be processed
  9489. * 0 -> release IE is not valid and should be ignored
  9490. * - PEER_ID
  9491. * Bits 31:16
  9492. * Purpose: Identify, by ID, which peer sent the rx data
  9493. * Value: ID of the peer who sent the rx data
  9494. * - FLUSH_SEQ_NUM_START
  9495. * Bits 5:0
  9496. * Purpose: Indicate the start of a series of MPDUs to flush
  9497. * Not all MPDUs within this series are necessarily valid - the host
  9498. * must check each sequence number within this range to see if the
  9499. * corresponding MPDU is actually present.
  9500. * This field is only valid if the FV bit is set.
  9501. * Value:
  9502. * The sequence number for the first MPDUs to check to flush.
  9503. * The sequence number is masked by 0x3f.
  9504. * - FLUSH_SEQ_NUM_END
  9505. * Bits 11:6
  9506. * Purpose: Indicate the end of a series of MPDUs to flush
  9507. * Value:
  9508. * The sequence number one larger than the sequence number of the
  9509. * last MPDU to check to flush.
  9510. * The sequence number is masked by 0x3f.
  9511. * Not all MPDUs within this series are necessarily valid - the host
  9512. * must check each sequence number within this range to see if the
  9513. * corresponding MPDU is actually present.
  9514. * This field is only valid if the FV bit is set.
  9515. * - REL_SEQ_NUM_START
  9516. * Bits 17:12
  9517. * Purpose: Indicate the start of a series of MPDUs to release.
  9518. * All MPDUs within this series are present and valid - the host
  9519. * need not check each sequence number within this range to see if
  9520. * the corresponding MPDU is actually present.
  9521. * This field is only valid if the RV bit is set.
  9522. * Value:
  9523. * The sequence number for the first MPDUs to check to release.
  9524. * The sequence number is masked by 0x3f.
  9525. * - REL_SEQ_NUM_END
  9526. * Bits 23:18
  9527. * Purpose: Indicate the end of a series of MPDUs to release.
  9528. * Value:
  9529. * The sequence number one larger than the sequence number of the
  9530. * last MPDU to check to release.
  9531. * The sequence number is masked by 0x3f.
  9532. * All MPDUs within this series are present and valid - the host
  9533. * need not check each sequence number within this range to see if
  9534. * the corresponding MPDU is actually present.
  9535. * This field is only valid if the RV bit is set.
  9536. * - NUM_MPDU_RANGES
  9537. * Bits 31:24
  9538. * Purpose: Indicate how many ranges of MPDUs are present.
  9539. * Each MPDU range consists of a series of contiguous MPDUs within the
  9540. * rx frame sequence which all have the same MPDU status.
  9541. * Value: 1-63 (typically a small number, like 1-3)
  9542. *
  9543. * Rx PPDU descriptor fields:
  9544. * - RSSI_CMB
  9545. * Bits 7:0
  9546. * Purpose: Combined RSSI from all active rx chains, across the active
  9547. * bandwidth.
  9548. * Value: RSSI dB units w.r.t. noise floor
  9549. * - TIMESTAMP_SUBMICROSEC
  9550. * Bits 15:8
  9551. * Purpose: high-resolution timestamp
  9552. * Value:
  9553. * Sub-microsecond time of PPDU reception.
  9554. * This timestamp ranges from [0,MAC clock MHz).
  9555. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9556. * to form a high-resolution, large range rx timestamp.
  9557. * - PHY_ERR_CODE
  9558. * Bits 23:16
  9559. * Purpose:
  9560. * If the rx frame processing resulted in a PHY error, indicate what
  9561. * type of rx PHY error occurred.
  9562. * Value:
  9563. * This field is valid if the "P" (PHY_ERR) flag is set.
  9564. * TBD: document/specify the values for this field
  9565. * - PHY_ERR
  9566. * Bit 24
  9567. * Purpose: indicate whether the rx PPDU had a PHY error
  9568. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9569. * - LEGACY_RATE
  9570. * Bits 28:25
  9571. * Purpose:
  9572. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9573. * specify which rate was used.
  9574. * Value:
  9575. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9576. * flag.
  9577. * If LEGACY_RATE_SEL is 0:
  9578. * 0x8: OFDM 48 Mbps
  9579. * 0x9: OFDM 24 Mbps
  9580. * 0xA: OFDM 12 Mbps
  9581. * 0xB: OFDM 6 Mbps
  9582. * 0xC: OFDM 54 Mbps
  9583. * 0xD: OFDM 36 Mbps
  9584. * 0xE: OFDM 18 Mbps
  9585. * 0xF: OFDM 9 Mbps
  9586. * If LEGACY_RATE_SEL is 1:
  9587. * 0x8: CCK 11 Mbps long preamble
  9588. * 0x9: CCK 5.5 Mbps long preamble
  9589. * 0xA: CCK 2 Mbps long preamble
  9590. * 0xB: CCK 1 Mbps long preamble
  9591. * 0xC: CCK 11 Mbps short preamble
  9592. * 0xD: CCK 5.5 Mbps short preamble
  9593. * 0xE: CCK 2 Mbps short preamble
  9594. * - LEGACY_RATE_SEL
  9595. * Bit 29
  9596. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9597. * Value:
  9598. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9599. * used a legacy rate.
  9600. * 0 -> OFDM, 1 -> CCK
  9601. * - END_VALID
  9602. * Bit 30
  9603. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9604. * the start of the PPDU are valid. Specifically, the following
  9605. * fields are only valid if END_VALID is set:
  9606. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9607. * TIMESTAMP_SUBMICROSEC
  9608. * Value:
  9609. * 0 -> rx PPDU desc end fields are not valid
  9610. * 1 -> rx PPDU desc end fields are valid
  9611. * - START_VALID
  9612. * Bit 31
  9613. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9614. * the end of the PPDU are valid. Specifically, the following
  9615. * fields are only valid if START_VALID is set:
  9616. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9617. * VHT-SIG-A
  9618. * Value:
  9619. * 0 -> rx PPDU desc start fields are not valid
  9620. * 1 -> rx PPDU desc start fields are valid
  9621. * - RSSI0_PRI20
  9622. * Bits 7:0
  9623. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9624. * Value: RSSI dB units w.r.t. noise floor
  9625. *
  9626. * - RSSI0_EXT20
  9627. * Bits 7:0
  9628. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9629. * (if the rx bandwidth was >= 40 MHz)
  9630. * Value: RSSI dB units w.r.t. noise floor
  9631. * - RSSI0_EXT40
  9632. * Bits 7:0
  9633. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9634. * (if the rx bandwidth was >= 80 MHz)
  9635. * Value: RSSI dB units w.r.t. noise floor
  9636. * - RSSI0_EXT80
  9637. * Bits 7:0
  9638. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9639. * (if the rx bandwidth was >= 160 MHz)
  9640. * Value: RSSI dB units w.r.t. noise floor
  9641. *
  9642. * - RSSI1_PRI20
  9643. * Bits 7:0
  9644. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9645. * Value: RSSI dB units w.r.t. noise floor
  9646. * - RSSI1_EXT20
  9647. * Bits 7:0
  9648. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9649. * (if the rx bandwidth was >= 40 MHz)
  9650. * Value: RSSI dB units w.r.t. noise floor
  9651. * - RSSI1_EXT40
  9652. * Bits 7:0
  9653. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9654. * (if the rx bandwidth was >= 80 MHz)
  9655. * Value: RSSI dB units w.r.t. noise floor
  9656. * - RSSI1_EXT80
  9657. * Bits 7:0
  9658. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9659. * (if the rx bandwidth was >= 160 MHz)
  9660. * Value: RSSI dB units w.r.t. noise floor
  9661. *
  9662. * - RSSI2_PRI20
  9663. * Bits 7:0
  9664. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9665. * Value: RSSI dB units w.r.t. noise floor
  9666. * - RSSI2_EXT20
  9667. * Bits 7:0
  9668. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9669. * (if the rx bandwidth was >= 40 MHz)
  9670. * Value: RSSI dB units w.r.t. noise floor
  9671. * - RSSI2_EXT40
  9672. * Bits 7:0
  9673. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9674. * (if the rx bandwidth was >= 80 MHz)
  9675. * Value: RSSI dB units w.r.t. noise floor
  9676. * - RSSI2_EXT80
  9677. * Bits 7:0
  9678. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9679. * (if the rx bandwidth was >= 160 MHz)
  9680. * Value: RSSI dB units w.r.t. noise floor
  9681. *
  9682. * - RSSI3_PRI20
  9683. * Bits 7:0
  9684. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9685. * Value: RSSI dB units w.r.t. noise floor
  9686. * - RSSI3_EXT20
  9687. * Bits 7:0
  9688. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9689. * (if the rx bandwidth was >= 40 MHz)
  9690. * Value: RSSI dB units w.r.t. noise floor
  9691. * - RSSI3_EXT40
  9692. * Bits 7:0
  9693. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9694. * (if the rx bandwidth was >= 80 MHz)
  9695. * Value: RSSI dB units w.r.t. noise floor
  9696. * - RSSI3_EXT80
  9697. * Bits 7:0
  9698. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9699. * (if the rx bandwidth was >= 160 MHz)
  9700. * Value: RSSI dB units w.r.t. noise floor
  9701. *
  9702. * - TSF32
  9703. * Bits 31:0
  9704. * Purpose: specify the time the rx PPDU was received, in TSF units
  9705. * Value: 32 LSBs of the TSF
  9706. * - TIMESTAMP_MICROSEC
  9707. * Bits 31:0
  9708. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9709. * Value: PPDU rx time, in microseconds
  9710. * - VHT_SIG_A1
  9711. * Bits 23:0
  9712. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9713. * from the rx PPDU
  9714. * Value:
  9715. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9716. * VHT-SIG-A1 data.
  9717. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9718. * first 24 bits of the HT-SIG data.
  9719. * Otherwise, this field is invalid.
  9720. * Refer to the the 802.11 protocol for the definition of the
  9721. * HT-SIG and VHT-SIG-A1 fields
  9722. * - VHT_SIG_A2
  9723. * Bits 23:0
  9724. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9725. * from the rx PPDU
  9726. * Value:
  9727. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9728. * VHT-SIG-A2 data.
  9729. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9730. * last 24 bits of the HT-SIG data.
  9731. * Otherwise, this field is invalid.
  9732. * Refer to the the 802.11 protocol for the definition of the
  9733. * HT-SIG and VHT-SIG-A2 fields
  9734. * - PREAMBLE_TYPE
  9735. * Bits 31:24
  9736. * Purpose: indicate the PHY format of the received burst
  9737. * Value:
  9738. * 0x4: Legacy (OFDM/CCK)
  9739. * 0x8: HT
  9740. * 0x9: HT with TxBF
  9741. * 0xC: VHT
  9742. * 0xD: VHT with TxBF
  9743. * - SERVICE
  9744. * Bits 31:24
  9745. * Purpose: TBD
  9746. * Value: TBD
  9747. *
  9748. * Rx MSDU descriptor fields:
  9749. * - FW_RX_DESC_BYTES
  9750. * Bits 15:0
  9751. * Purpose: Indicate how many bytes in the Rx indication are used for
  9752. * FW Rx descriptors
  9753. *
  9754. * Payload fields:
  9755. * - MPDU_COUNT
  9756. * Bits 7:0
  9757. * Purpose: Indicate how many sequential MPDUs share the same status.
  9758. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9759. * - MPDU_STATUS
  9760. * Bits 15:8
  9761. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9762. * received successfully.
  9763. * Value:
  9764. * 0x1: success
  9765. * 0x2: FCS error
  9766. * 0x3: duplicate error
  9767. * 0x4: replay error
  9768. * 0x5: invalid peer
  9769. */
  9770. /* header fields */
  9771. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9772. #define HTT_RX_IND_EXT_TID_S 8
  9773. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9774. #define HTT_RX_IND_FLUSH_VALID_S 13
  9775. #define HTT_RX_IND_REL_VALID_M 0x4000
  9776. #define HTT_RX_IND_REL_VALID_S 14
  9777. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9778. #define HTT_RX_IND_PEER_ID_S 16
  9779. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9780. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9781. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9782. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9783. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9784. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9785. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9786. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9787. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9788. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9789. /* rx PPDU descriptor fields */
  9790. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9791. #define HTT_RX_IND_RSSI_CMB_S 0
  9792. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9793. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9794. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9795. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9796. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9797. #define HTT_RX_IND_PHY_ERR_S 24
  9798. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9799. #define HTT_RX_IND_LEGACY_RATE_S 25
  9800. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9801. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9802. #define HTT_RX_IND_END_VALID_M 0x40000000
  9803. #define HTT_RX_IND_END_VALID_S 30
  9804. #define HTT_RX_IND_START_VALID_M 0x80000000
  9805. #define HTT_RX_IND_START_VALID_S 31
  9806. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9807. #define HTT_RX_IND_RSSI_PRI20_S 0
  9808. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9809. #define HTT_RX_IND_RSSI_EXT20_S 8
  9810. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9811. #define HTT_RX_IND_RSSI_EXT40_S 16
  9812. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9813. #define HTT_RX_IND_RSSI_EXT80_S 24
  9814. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9815. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9816. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9817. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9818. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9819. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9820. #define HTT_RX_IND_SERVICE_M 0xff000000
  9821. #define HTT_RX_IND_SERVICE_S 24
  9822. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9823. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9824. /* rx MSDU descriptor fields */
  9825. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9826. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9827. /* payload fields */
  9828. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9829. #define HTT_RX_IND_MPDU_COUNT_S 0
  9830. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9831. #define HTT_RX_IND_MPDU_STATUS_S 8
  9832. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9833. do { \
  9834. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9835. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9836. } while (0)
  9837. #define HTT_RX_IND_EXT_TID_GET(word) \
  9838. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9839. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9840. do { \
  9841. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9842. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9843. } while (0)
  9844. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9845. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9846. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9847. do { \
  9848. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9849. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9850. } while (0)
  9851. #define HTT_RX_IND_REL_VALID_GET(word) \
  9852. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9853. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9854. do { \
  9855. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9856. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9857. } while (0)
  9858. #define HTT_RX_IND_PEER_ID_GET(word) \
  9859. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9860. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9861. do { \
  9862. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9863. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9864. } while (0)
  9865. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9866. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9867. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9868. do { \
  9869. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9870. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9871. } while (0)
  9872. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9873. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9874. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9875. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9876. do { \
  9877. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9878. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9879. } while (0)
  9880. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9881. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9882. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9883. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9884. do { \
  9885. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9886. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9887. } while (0)
  9888. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9889. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9890. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9891. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9892. do { \
  9893. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9894. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9895. } while (0)
  9896. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9897. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9898. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9899. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9900. do { \
  9901. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9902. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9903. } while (0)
  9904. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9905. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9906. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9907. /* FW rx PPDU descriptor fields */
  9908. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9909. do { \
  9910. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9911. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9912. } while (0)
  9913. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9914. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9915. HTT_RX_IND_RSSI_CMB_S)
  9916. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9917. do { \
  9918. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9919. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9920. } while (0)
  9921. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9922. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9923. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9924. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9925. do { \
  9926. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9927. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9928. } while (0)
  9929. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9930. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9931. HTT_RX_IND_PHY_ERR_CODE_S)
  9932. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9933. do { \
  9934. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9935. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9936. } while (0)
  9937. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9938. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9939. HTT_RX_IND_PHY_ERR_S)
  9940. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9941. do { \
  9942. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9943. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9944. } while (0)
  9945. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9946. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9947. HTT_RX_IND_LEGACY_RATE_S)
  9948. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9949. do { \
  9950. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9951. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9952. } while (0)
  9953. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9954. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9955. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9956. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9957. do { \
  9958. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9959. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9960. } while (0)
  9961. #define HTT_RX_IND_END_VALID_GET(word) \
  9962. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9963. HTT_RX_IND_END_VALID_S)
  9964. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9965. do { \
  9966. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9967. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9968. } while (0)
  9969. #define HTT_RX_IND_START_VALID_GET(word) \
  9970. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9971. HTT_RX_IND_START_VALID_S)
  9972. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9973. do { \
  9974. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9975. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9976. } while (0)
  9977. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9978. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9979. HTT_RX_IND_RSSI_PRI20_S)
  9980. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9981. do { \
  9982. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9983. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9984. } while (0)
  9985. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9986. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9987. HTT_RX_IND_RSSI_EXT20_S)
  9988. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9989. do { \
  9990. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9991. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9992. } while (0)
  9993. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9994. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9995. HTT_RX_IND_RSSI_EXT40_S)
  9996. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9997. do { \
  9998. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9999. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10000. } while (0)
  10001. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10002. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10003. HTT_RX_IND_RSSI_EXT80_S)
  10004. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10007. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10008. } while (0)
  10009. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10010. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10011. HTT_RX_IND_VHT_SIG_A1_S)
  10012. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10013. do { \
  10014. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10015. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10016. } while (0)
  10017. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10018. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10019. HTT_RX_IND_VHT_SIG_A2_S)
  10020. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10021. do { \
  10022. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10023. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10024. } while (0)
  10025. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10026. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10027. HTT_RX_IND_PREAMBLE_TYPE_S)
  10028. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10029. do { \
  10030. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10031. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10032. } while (0)
  10033. #define HTT_RX_IND_SERVICE_GET(word) \
  10034. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10035. HTT_RX_IND_SERVICE_S)
  10036. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10037. do { \
  10038. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10039. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10040. } while (0)
  10041. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10042. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10043. HTT_RX_IND_SA_ANT_MATRIX_S)
  10044. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10045. do { \
  10046. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10047. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10048. } while (0)
  10049. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10050. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10051. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10052. do { \
  10053. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10054. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10055. } while (0)
  10056. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10057. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10058. #define HTT_RX_IND_HL_BYTES \
  10059. (HTT_RX_IND_HDR_BYTES + \
  10060. 4 /* single FW rx MSDU descriptor */ + \
  10061. 4 /* single MPDU range information element */)
  10062. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10063. /* Could we use one macro entry? */
  10064. #define HTT_WORD_SET(word, field, value) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(field, value); \
  10067. (word) |= ((value) << field ## _S); \
  10068. } while (0)
  10069. #define HTT_WORD_GET(word, field) \
  10070. (((word) & field ## _M) >> field ## _S)
  10071. PREPACK struct hl_htt_rx_ind_base {
  10072. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10073. } POSTPACK;
  10074. /*
  10075. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10076. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10077. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10078. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10079. * htt_rx_ind_hl_rx_desc_t.
  10080. */
  10081. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10082. struct htt_rx_ind_hl_rx_desc_t {
  10083. A_UINT8 ver;
  10084. A_UINT8 len;
  10085. struct {
  10086. A_UINT8
  10087. first_msdu: 1,
  10088. last_msdu: 1,
  10089. c3_failed: 1,
  10090. c4_failed: 1,
  10091. ipv6: 1,
  10092. tcp: 1,
  10093. udp: 1,
  10094. reserved: 1;
  10095. } flags;
  10096. /* NOTE: no reserved space - don't append any new fields here */
  10097. };
  10098. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10099. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10100. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10101. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10102. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10103. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10104. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10105. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10106. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10107. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10108. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10109. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10110. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10111. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10112. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10113. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10114. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10115. /* This structure is used in HL, the basic descriptor information
  10116. * used by host. the structure is translated by FW from HW desc
  10117. * or generated by FW. But in HL monitor mode, the host would use
  10118. * the same structure with LL.
  10119. */
  10120. PREPACK struct hl_htt_rx_desc_base {
  10121. A_UINT32
  10122. seq_num:12,
  10123. encrypted:1,
  10124. chan_info_present:1,
  10125. resv0:2,
  10126. mcast_bcast:1,
  10127. fragment:1,
  10128. key_id_oct:8,
  10129. resv1:6;
  10130. A_UINT32
  10131. pn_31_0;
  10132. union {
  10133. struct {
  10134. A_UINT16 pn_47_32;
  10135. A_UINT16 pn_63_48;
  10136. } pn16;
  10137. A_UINT32 pn_63_32;
  10138. } u0;
  10139. A_UINT32
  10140. pn_95_64;
  10141. A_UINT32
  10142. pn_127_96;
  10143. } POSTPACK;
  10144. /*
  10145. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10146. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10147. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10148. * Please see htt_chan_change_t for description of the fields.
  10149. */
  10150. PREPACK struct htt_chan_info_t
  10151. {
  10152. A_UINT32 primary_chan_center_freq_mhz: 16,
  10153. contig_chan1_center_freq_mhz: 16;
  10154. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10155. phy_mode: 8,
  10156. reserved: 8;
  10157. } POSTPACK;
  10158. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10159. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10160. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10161. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10162. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10163. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10164. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10165. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10166. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10167. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10168. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10169. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10170. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10171. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10172. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10173. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10174. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10175. /* Channel information */
  10176. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10177. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10178. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10179. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10180. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10181. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10182. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10183. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10184. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10185. do { \
  10186. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10187. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10188. } while (0)
  10189. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10190. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10191. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10192. do { \
  10193. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10194. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10195. } while (0)
  10196. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10197. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10198. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10199. do { \
  10200. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10201. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10202. } while (0)
  10203. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10204. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10205. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10206. do { \
  10207. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10208. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10209. } while (0)
  10210. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10211. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10212. /*
  10213. * @brief target -> host message definition for FW offloaded pkts
  10214. *
  10215. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10216. *
  10217. * @details
  10218. * The following field definitions describe the format of the firmware
  10219. * offload deliver message sent from the target to the host.
  10220. *
  10221. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10222. *
  10223. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10224. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10225. * | reserved_1 | msg type |
  10226. * |--------------------------------------------------------------------------|
  10227. * | phy_timestamp_l32 |
  10228. * |--------------------------------------------------------------------------|
  10229. * | WORD2 (see below) |
  10230. * |--------------------------------------------------------------------------|
  10231. * | seqno | framectrl |
  10232. * |--------------------------------------------------------------------------|
  10233. * | reserved_3 | vdev_id | tid_num|
  10234. * |--------------------------------------------------------------------------|
  10235. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10236. * |--------------------------------------------------------------------------|
  10237. *
  10238. * where:
  10239. * STAT = status
  10240. * F = format (802.3 vs. 802.11)
  10241. *
  10242. * definition for word 2
  10243. *
  10244. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10245. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10246. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10247. * |--------------------------------------------------------------------------|
  10248. *
  10249. * where:
  10250. * PR = preamble
  10251. * BF = beamformed
  10252. */
  10253. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10254. {
  10255. A_UINT32 /* word 0 */
  10256. msg_type:8, /* [ 7: 0] */
  10257. reserved_1:24; /* [31: 8] */
  10258. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10259. A_UINT32 /* word 2 */
  10260. /* preamble:
  10261. * 0-OFDM,
  10262. * 1-CCk,
  10263. * 2-HT,
  10264. * 3-VHT
  10265. */
  10266. preamble: 2, /* [1:0] */
  10267. /* mcs:
  10268. * In case of HT preamble interpret
  10269. * MCS along with NSS.
  10270. * Valid values for HT are 0 to 7.
  10271. * HT mcs 0 with NSS 2 is mcs 8.
  10272. * Valid values for VHT are 0 to 9.
  10273. */
  10274. mcs: 4, /* [5:2] */
  10275. /* rate:
  10276. * This is applicable only for
  10277. * CCK and OFDM preamble type
  10278. * rate 0: OFDM 48 Mbps,
  10279. * 1: OFDM 24 Mbps,
  10280. * 2: OFDM 12 Mbps
  10281. * 3: OFDM 6 Mbps
  10282. * 4: OFDM 54 Mbps
  10283. * 5: OFDM 36 Mbps
  10284. * 6: OFDM 18 Mbps
  10285. * 7: OFDM 9 Mbps
  10286. * rate 0: CCK 11 Mbps Long
  10287. * 1: CCK 5.5 Mbps Long
  10288. * 2: CCK 2 Mbps Long
  10289. * 3: CCK 1 Mbps Long
  10290. * 4: CCK 11 Mbps Short
  10291. * 5: CCK 5.5 Mbps Short
  10292. * 6: CCK 2 Mbps Short
  10293. */
  10294. rate : 3, /* [ 8: 6] */
  10295. rssi : 8, /* [16: 9] units=dBm */
  10296. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10297. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10298. stbc : 1, /* [22] */
  10299. sgi : 1, /* [23] */
  10300. ldpc : 1, /* [24] */
  10301. beamformed: 1, /* [25] */
  10302. reserved_2: 6; /* [31:26] */
  10303. A_UINT32 /* word 3 */
  10304. framectrl:16, /* [15: 0] */
  10305. seqno:16; /* [31:16] */
  10306. A_UINT32 /* word 4 */
  10307. tid_num:5, /* [ 4: 0] actual TID number */
  10308. vdev_id:8, /* [12: 5] */
  10309. reserved_3:19; /* [31:13] */
  10310. A_UINT32 /* word 5 */
  10311. /* status:
  10312. * 0: tx_ok
  10313. * 1: retry
  10314. * 2: drop
  10315. * 3: filtered
  10316. * 4: abort
  10317. * 5: tid delete
  10318. * 6: sw abort
  10319. * 7: dropped by peer migration
  10320. */
  10321. status:3, /* [2:0] */
  10322. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10323. tx_mpdu_bytes:16, /* [19:4] */
  10324. /* Indicates retry count of offloaded/local generated Data tx frames */
  10325. tx_retry_cnt:6, /* [25:20] */
  10326. reserved_4:6; /* [31:26] */
  10327. } POSTPACK;
  10328. /* FW offload deliver ind message header fields */
  10329. /* DWORD one */
  10330. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10331. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10332. /* DWORD two */
  10333. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10334. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10335. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10336. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10337. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10338. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10339. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10340. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10341. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10342. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10343. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10344. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10345. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10346. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10347. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10348. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10349. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10350. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10351. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10352. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10353. /* DWORD three*/
  10354. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10355. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10356. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10357. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10358. /* DWORD four */
  10359. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10360. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10361. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10362. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10363. /* DWORD five */
  10364. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10365. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10366. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10367. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10368. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10369. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10370. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10371. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10372. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10373. do { \
  10374. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10375. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10376. } while (0)
  10377. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10378. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10379. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10380. do { \
  10381. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10382. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10383. } while (0)
  10384. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10385. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10386. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10387. do { \
  10388. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10389. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10390. } while (0)
  10391. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10392. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10393. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10394. do { \
  10395. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10396. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10397. } while (0)
  10398. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10399. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10400. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10401. do { \
  10402. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10403. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10404. } while (0)
  10405. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10406. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10407. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10408. do { \
  10409. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10410. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10411. } while (0)
  10412. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10413. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10414. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10415. do { \
  10416. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10417. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10418. } while (0)
  10419. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10420. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10421. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10422. do { \
  10423. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10424. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10425. } while (0)
  10426. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10427. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10428. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10429. do { \
  10430. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10431. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10432. } while (0)
  10433. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10434. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10435. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10436. do { \
  10437. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10438. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10439. } while (0)
  10440. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10441. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10442. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10443. do { \
  10444. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10445. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10446. } while (0)
  10447. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10448. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10449. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10450. do { \
  10451. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10452. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10453. } while (0)
  10454. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10455. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10456. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10457. do { \
  10458. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10459. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10460. } while (0)
  10461. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10462. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10463. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10464. do { \
  10465. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10466. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10467. } while (0)
  10468. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10469. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10470. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10471. do { \
  10472. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10473. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10474. } while (0)
  10475. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10476. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10477. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10478. do { \
  10479. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10480. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10481. } while (0)
  10482. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10483. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10484. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10485. do { \
  10486. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10487. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10488. } while (0)
  10489. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10490. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10491. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10492. do { \
  10493. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10494. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10495. } while (0)
  10496. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10497. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10498. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10499. do { \
  10500. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10501. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10502. } while (0)
  10503. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10504. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10505. /*
  10506. * @brief target -> host rx reorder flush message definition
  10507. *
  10508. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10509. *
  10510. * @details
  10511. * The following field definitions describe the format of the rx flush
  10512. * message sent from the target to the host.
  10513. * The message consists of a 4-octet header, followed by one or more
  10514. * 4-octet payload information elements.
  10515. *
  10516. * |31 24|23 8|7 0|
  10517. * |--------------------------------------------------------------|
  10518. * | TID | peer ID | msg type |
  10519. * |--------------------------------------------------------------|
  10520. * | seq num end | seq num start | MPDU status | reserved |
  10521. * |--------------------------------------------------------------|
  10522. * First DWORD:
  10523. * - MSG_TYPE
  10524. * Bits 7:0
  10525. * Purpose: identifies this as an rx flush message
  10526. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10527. * - PEER_ID
  10528. * Bits 23:8 (only bits 18:8 actually used)
  10529. * Purpose: identify which peer's rx data is being flushed
  10530. * Value: (rx) peer ID
  10531. * - TID
  10532. * Bits 31:24 (only bits 27:24 actually used)
  10533. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10534. * Value: traffic identifier
  10535. * Second DWORD:
  10536. * - MPDU_STATUS
  10537. * Bits 15:8
  10538. * Purpose:
  10539. * Indicate whether the flushed MPDUs should be discarded or processed.
  10540. * Value:
  10541. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10542. * stages of rx processing
  10543. * other: discard the MPDUs
  10544. * It is anticipated that flush messages will always have
  10545. * MPDU status == 1, but the status flag is included for
  10546. * flexibility.
  10547. * - SEQ_NUM_START
  10548. * Bits 23:16
  10549. * Purpose:
  10550. * Indicate the start of a series of consecutive MPDUs being flushed.
  10551. * Not all MPDUs within this range are necessarily valid - the host
  10552. * must check each sequence number within this range to see if the
  10553. * corresponding MPDU is actually present.
  10554. * Value:
  10555. * The sequence number for the first MPDU in the sequence.
  10556. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10557. * - SEQ_NUM_END
  10558. * Bits 30:24
  10559. * Purpose:
  10560. * Indicate the end of a series of consecutive MPDUs being flushed.
  10561. * Value:
  10562. * The sequence number one larger than the sequence number of the
  10563. * last MPDU being flushed.
  10564. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10565. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10566. * are to be released for further rx processing.
  10567. * Not all MPDUs within this range are necessarily valid - the host
  10568. * must check each sequence number within this range to see if the
  10569. * corresponding MPDU is actually present.
  10570. */
  10571. /* first DWORD */
  10572. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10573. #define HTT_RX_FLUSH_PEER_ID_S 8
  10574. #define HTT_RX_FLUSH_TID_M 0xff000000
  10575. #define HTT_RX_FLUSH_TID_S 24
  10576. /* second DWORD */
  10577. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10578. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10579. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10580. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10581. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10582. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10583. #define HTT_RX_FLUSH_BYTES 8
  10584. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10585. do { \
  10586. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10587. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10588. } while (0)
  10589. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10590. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10591. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10592. do { \
  10593. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10594. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10595. } while (0)
  10596. #define HTT_RX_FLUSH_TID_GET(word) \
  10597. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10598. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10599. do { \
  10600. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10601. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10602. } while (0)
  10603. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10604. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10605. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10606. do { \
  10607. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10608. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10609. } while (0)
  10610. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10611. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10612. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10613. do { \
  10614. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10615. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10616. } while (0)
  10617. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10618. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10619. /*
  10620. * @brief target -> host rx pn check indication message
  10621. *
  10622. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10623. *
  10624. * @details
  10625. * The following field definitions describe the format of the Rx PN check
  10626. * indication message sent from the target to the host.
  10627. * The message consists of a 4-octet header, followed by the start and
  10628. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10629. * IE is one octet containing the sequence number that failed the PN
  10630. * check.
  10631. *
  10632. * |31 24|23 8|7 0|
  10633. * |--------------------------------------------------------------|
  10634. * | TID | peer ID | msg type |
  10635. * |--------------------------------------------------------------|
  10636. * | Reserved | PN IE count | seq num end | seq num start|
  10637. * |--------------------------------------------------------------|
  10638. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10639. * |--------------------------------------------------------------|
  10640. * First DWORD:
  10641. * - MSG_TYPE
  10642. * Bits 7:0
  10643. * Purpose: Identifies this as an rx pn check indication message
  10644. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10645. * - PEER_ID
  10646. * Bits 23:8 (only bits 18:8 actually used)
  10647. * Purpose: identify which peer
  10648. * Value: (rx) peer ID
  10649. * - TID
  10650. * Bits 31:24 (only bits 27:24 actually used)
  10651. * Purpose: identify traffic identifier
  10652. * Value: traffic identifier
  10653. * Second DWORD:
  10654. * - SEQ_NUM_START
  10655. * Bits 7:0
  10656. * Purpose:
  10657. * Indicates the starting sequence number of the MPDU in this
  10658. * series of MPDUs that went though PN check.
  10659. * Value:
  10660. * The sequence number for the first MPDU in the sequence.
  10661. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10662. * - SEQ_NUM_END
  10663. * Bits 15:8
  10664. * Purpose:
  10665. * Indicates the ending sequence number of the MPDU in this
  10666. * series of MPDUs that went though PN check.
  10667. * Value:
  10668. * The sequence number one larger then the sequence number of the last
  10669. * MPDU being flushed.
  10670. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10671. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10672. * for invalid PN numbers and are ready to be released for further processing.
  10673. * Not all MPDUs within this range are necessarily valid - the host
  10674. * must check each sequence number within this range to see if the
  10675. * corresponding MPDU is actually present.
  10676. * - PN_IE_COUNT
  10677. * Bits 23:16
  10678. * Purpose:
  10679. * Used to determine the variable number of PN information elements in this
  10680. * message
  10681. *
  10682. * PN information elements:
  10683. * - PN_IE_x-
  10684. * Purpose:
  10685. * Each PN information element contains the sequence number of the MPDU that
  10686. * has failed the target PN check.
  10687. * Value:
  10688. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10689. * that failed the PN check.
  10690. */
  10691. /* first DWORD */
  10692. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10693. #define HTT_RX_PN_IND_PEER_ID_S 8
  10694. #define HTT_RX_PN_IND_TID_M 0xff000000
  10695. #define HTT_RX_PN_IND_TID_S 24
  10696. /* second DWORD */
  10697. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10698. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10699. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10700. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10701. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10702. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10703. #define HTT_RX_PN_IND_BYTES 8
  10704. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10705. do { \
  10706. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10707. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10708. } while (0)
  10709. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10710. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10711. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10712. do { \
  10713. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10714. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10715. } while (0)
  10716. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10717. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10718. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10719. do { \
  10720. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10721. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10722. } while (0)
  10723. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10724. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10725. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10726. do { \
  10727. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10728. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10729. } while (0)
  10730. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10731. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10732. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10733. do { \
  10734. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10735. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10736. } while (0)
  10737. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10738. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10739. /*
  10740. * @brief target -> host rx offload deliver message for LL system
  10741. *
  10742. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10743. *
  10744. * @details
  10745. * In a low latency system this message is sent whenever the offload
  10746. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10747. * The DMA of the actual packets into host memory is done before sending out
  10748. * this message. This message indicates only how many MSDUs to reap. The
  10749. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10750. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10751. * DMA'd by the MAC directly into host memory these packets do not contain
  10752. * the MAC descriptors in the header portion of the packet. Instead they contain
  10753. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10754. * message, the packets are delivered directly to the NW stack without going
  10755. * through the regular reorder buffering and PN checking path since it has
  10756. * already been done in target.
  10757. *
  10758. * |31 24|23 16|15 8|7 0|
  10759. * |-----------------------------------------------------------------------|
  10760. * | Total MSDU count | reserved | msg type |
  10761. * |-----------------------------------------------------------------------|
  10762. *
  10763. * @brief target -> host rx offload deliver message for HL system
  10764. *
  10765. * @details
  10766. * In a high latency system this message is sent whenever the offload manager
  10767. * flushes out the packets it has coalesced in its coalescing buffer. The
  10768. * actual packets are also carried along with this message. When the host
  10769. * receives this message, it is expected to deliver these packets to the NW
  10770. * stack directly instead of routing them through the reorder buffering and
  10771. * PN checking path since it has already been done in target.
  10772. *
  10773. * |31 24|23 16|15 8|7 0|
  10774. * |-----------------------------------------------------------------------|
  10775. * | Total MSDU count | reserved | msg type |
  10776. * |-----------------------------------------------------------------------|
  10777. * | peer ID | MSDU length |
  10778. * |-----------------------------------------------------------------------|
  10779. * | MSDU payload | FW Desc | tid | vdev ID |
  10780. * |-----------------------------------------------------------------------|
  10781. * | MSDU payload contd. |
  10782. * |-----------------------------------------------------------------------|
  10783. * | peer ID | MSDU length |
  10784. * |-----------------------------------------------------------------------|
  10785. * | MSDU payload | FW Desc | tid | vdev ID |
  10786. * |-----------------------------------------------------------------------|
  10787. * | MSDU payload contd. |
  10788. * |-----------------------------------------------------------------------|
  10789. *
  10790. */
  10791. /* first DWORD */
  10792. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10793. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10795. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10797. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10799. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10800. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10801. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10802. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10804. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10805. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10806. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10807. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10808. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10809. do { \
  10810. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10811. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10812. } while (0)
  10813. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10814. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10815. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10816. do { \
  10817. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10818. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10819. } while (0)
  10820. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10821. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10822. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10823. do { \
  10824. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10825. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10826. } while (0)
  10827. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10828. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10829. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10830. do { \
  10831. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10832. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10833. } while (0)
  10834. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10835. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10836. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10837. do { \
  10838. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10839. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10840. } while (0)
  10841. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10842. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10843. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10844. do { \
  10845. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10846. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10847. } while (0)
  10848. /**
  10849. * @brief target -> host rx peer map/unmap message definition
  10850. *
  10851. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10852. *
  10853. * @details
  10854. * The following diagram shows the format of the rx peer map message sent
  10855. * from the target to the host. This layout assumes the target operates
  10856. * as little-endian.
  10857. *
  10858. * This message always contains a SW peer ID. The main purpose of the
  10859. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10860. * with, so that the host can use that peer ID to determine which peer
  10861. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10862. * other purposes, such as identifying during tx completions which peer
  10863. * the tx frames in question were transmitted to.
  10864. *
  10865. * In certain generations of chips, the peer map message also contains
  10866. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10867. * to identify which peer the frame needs to be forwarded to (i.e. the
  10868. * peer assocated with the Destination MAC Address within the packet),
  10869. * and particularly which vdev needs to transmit the frame (for cases
  10870. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10871. * meaning as AST_INDEX_0.
  10872. * This DA-based peer ID that is provided for certain rx frames
  10873. * (the rx frames that need to be re-transmitted as tx frames)
  10874. * is the ID that the HW uses for referring to the peer in question,
  10875. * rather than the peer ID that the SW+FW use to refer to the peer.
  10876. *
  10877. *
  10878. * |31 24|23 16|15 8|7 0|
  10879. * |-----------------------------------------------------------------------|
  10880. * | SW peer ID | VDEV ID | msg type |
  10881. * |-----------------------------------------------------------------------|
  10882. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10883. * |-----------------------------------------------------------------------|
  10884. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10885. * |-----------------------------------------------------------------------|
  10886. *
  10887. *
  10888. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10889. *
  10890. * The following diagram shows the format of the rx peer unmap message sent
  10891. * from the target to the host.
  10892. *
  10893. * |31 24|23 16|15 8|7 0|
  10894. * |-----------------------------------------------------------------------|
  10895. * | SW peer ID | VDEV ID | msg type |
  10896. * |-----------------------------------------------------------------------|
  10897. *
  10898. * The following field definitions describe the format of the rx peer map
  10899. * and peer unmap messages sent from the target to the host.
  10900. * - MSG_TYPE
  10901. * Bits 7:0
  10902. * Purpose: identifies this as an rx peer map or peer unmap message
  10903. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10904. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10905. * - VDEV_ID
  10906. * Bits 15:8
  10907. * Purpose: Indicates which virtual device the peer is associated
  10908. * with.
  10909. * Value: vdev ID (used in the host to look up the vdev object)
  10910. * - PEER_ID (a.k.a. SW_PEER_ID)
  10911. * Bits 31:16
  10912. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10913. * freeing (unmap)
  10914. * Value: (rx) peer ID
  10915. * - MAC_ADDR_L32 (peer map only)
  10916. * Bits 31:0
  10917. * Purpose: Identifies which peer node the peer ID is for.
  10918. * Value: lower 4 bytes of peer node's MAC address
  10919. * - MAC_ADDR_U16 (peer map only)
  10920. * Bits 15:0
  10921. * Purpose: Identifies which peer node the peer ID is for.
  10922. * Value: upper 2 bytes of peer node's MAC address
  10923. * - HW_PEER_ID
  10924. * Bits 31:16
  10925. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10926. * address, so for rx frames marked for rx --> tx forwarding, the
  10927. * host can determine from the HW peer ID provided as meta-data with
  10928. * the rx frame which peer the frame is supposed to be forwarded to.
  10929. * Value: ID used by the MAC HW to identify the peer
  10930. */
  10931. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10932. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10933. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10934. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10935. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10936. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10937. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10938. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10939. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10940. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10941. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10942. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10943. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10944. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10945. do { \
  10946. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10947. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10948. } while (0)
  10949. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10950. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10951. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10952. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10953. do { \
  10954. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10955. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10956. } while (0)
  10957. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10958. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10959. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10960. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10961. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10962. do { \
  10963. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10964. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10965. } while (0)
  10966. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10967. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10968. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10969. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10970. #define HTT_RX_PEER_MAP_BYTES 12
  10971. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10972. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10973. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10974. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10975. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10976. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10977. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10978. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10979. #define HTT_RX_PEER_UNMAP_BYTES 4
  10980. /**
  10981. * @brief target -> host rx peer map V2 message definition
  10982. *
  10983. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10984. *
  10985. * @details
  10986. * The following diagram shows the format of the rx peer map v2 message sent
  10987. * from the target to the host. This layout assumes the target operates
  10988. * as little-endian.
  10989. *
  10990. * This message always contains a SW peer ID. The main purpose of the
  10991. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10992. * with, so that the host can use that peer ID to determine which peer
  10993. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10994. * other purposes, such as identifying during tx completions which peer
  10995. * the tx frames in question were transmitted to.
  10996. *
  10997. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10998. * is used during rx --> tx frame forwarding to identify which peer the
  10999. * frame needs to be forwarded to (i.e. the peer assocated with the
  11000. * Destination MAC Address within the packet), and particularly which vdev
  11001. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11002. * This DA-based peer ID that is provided for certain rx frames
  11003. * (the rx frames that need to be re-transmitted as tx frames)
  11004. * is the ID that the HW uses for referring to the peer in question,
  11005. * rather than the peer ID that the SW+FW use to refer to the peer.
  11006. *
  11007. * The HW peer id here is the same meaning as AST_INDEX_0.
  11008. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11009. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11010. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11011. * AST is valid.
  11012. *
  11013. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11014. * |-------------------------------------------------------------------------|
  11015. * | SW peer ID | VDEV ID | msg type |
  11016. * |-------------------------------------------------------------------------|
  11017. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11018. * |-------------------------------------------------------------------------|
  11019. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11020. * |-------------------------------------------------------------------------|
  11021. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11022. * |-------------------------------------------------------------------------|
  11023. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11024. * |-------------------------------------------------------------------------|
  11025. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11026. * |-------------------------------------------------------------------------|
  11027. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11028. * |-------------------------------------------------------------------------|
  11029. * | Reserved_2 |
  11030. * |-------------------------------------------------------------------------|
  11031. * Where:
  11032. * NH = Next Hop
  11033. * ASTVM = AST valid mask
  11034. * OA = on-chip AST valid bit
  11035. * ASTFM = AST flow mask
  11036. *
  11037. * The following field definitions describe the format of the rx peer map v2
  11038. * messages sent from the target to the host.
  11039. * - MSG_TYPE
  11040. * Bits 7:0
  11041. * Purpose: identifies this as an rx peer map v2 message
  11042. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11043. * - VDEV_ID
  11044. * Bits 15:8
  11045. * Purpose: Indicates which virtual device the peer is associated with.
  11046. * Value: vdev ID (used in the host to look up the vdev object)
  11047. * - SW_PEER_ID
  11048. * Bits 31:16
  11049. * Purpose: The peer ID (index) that WAL is allocating
  11050. * Value: (rx) peer ID
  11051. * - MAC_ADDR_L32
  11052. * Bits 31:0
  11053. * Purpose: Identifies which peer node the peer ID is for.
  11054. * Value: lower 4 bytes of peer node's MAC address
  11055. * - MAC_ADDR_U16
  11056. * Bits 15:0
  11057. * Purpose: Identifies which peer node the peer ID is for.
  11058. * Value: upper 2 bytes of peer node's MAC address
  11059. * - HW_PEER_ID / AST_INDEX_0
  11060. * Bits 31:16
  11061. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11062. * address, so for rx frames marked for rx --> tx forwarding, the
  11063. * host can determine from the HW peer ID provided as meta-data with
  11064. * the rx frame which peer the frame is supposed to be forwarded to.
  11065. * Value: ID used by the MAC HW to identify the peer
  11066. * - AST_HASH_VALUE
  11067. * Bits 15:0
  11068. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11069. * override feature.
  11070. * - NEXT_HOP
  11071. * Bit 16
  11072. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11073. * (Wireless Distribution System).
  11074. * - AST_VALID_MASK
  11075. * Bits 19:17
  11076. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11077. * - ONCHIP_AST_VALID_FLAG
  11078. * Bit 20
  11079. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11080. * is valid.
  11081. * - AST_INDEX_1
  11082. * Bits 15:0
  11083. * Purpose: indicate the second AST index for this peer
  11084. * - AST_0_FLOW_MASK
  11085. * Bits 19:16
  11086. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11087. * - AST_1_FLOW_MASK
  11088. * Bits 23:20
  11089. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11090. * - AST_2_FLOW_MASK
  11091. * Bits 27:24
  11092. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11093. * - AST_3_FLOW_MASK
  11094. * Bits 31:28
  11095. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11096. * - AST_INDEX_2
  11097. * Bits 15:0
  11098. * Purpose: indicate the third AST index for this peer
  11099. * - TID_VALID_HI_PRI
  11100. * Bits 23:16
  11101. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11102. * - TID_VALID_LOW_PRI
  11103. * Bits 31:24
  11104. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11105. * - AST_INDEX_3
  11106. * Bits 15:0
  11107. * Purpose: indicate the fourth AST index for this peer
  11108. * - ONCHIP_AST_IDX / RESERVED
  11109. * Bits 31:16
  11110. * Purpose: This field is valid only when split AST feature is enabled.
  11111. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11112. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11113. * address, this ast_idx is used for LMAC modules for RXPCU.
  11114. * Value: ID used by the LMAC HW to identify the peer
  11115. */
  11116. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11117. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11118. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11119. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11120. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11121. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11122. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11123. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11124. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11125. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11126. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11127. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11128. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11129. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11130. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11131. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11132. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11133. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11134. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11135. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11136. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11137. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11138. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11139. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11140. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11141. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11142. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11143. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11144. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11145. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11146. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11147. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11148. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11149. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11150. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11151. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11152. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11153. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11154. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11155. do { \
  11156. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11157. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11158. } while (0)
  11159. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11160. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11161. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11162. do { \
  11163. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11164. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11165. } while (0)
  11166. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11167. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11168. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11169. do { \
  11170. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11171. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11172. } while (0)
  11173. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11174. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11175. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11176. do { \
  11177. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11178. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11179. } while (0)
  11180. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11181. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11182. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11183. do { \
  11184. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11185. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11186. } while (0)
  11187. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11188. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11189. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11190. do { \
  11191. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11192. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11193. } while (0)
  11194. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11195. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11196. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11199. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11200. } while (0)
  11201. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11202. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11203. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11204. do { \
  11205. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11206. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11207. } while (0)
  11208. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11209. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11210. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11211. do { \
  11212. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11213. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11214. } while (0)
  11215. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11216. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11217. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11218. do { \
  11219. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11220. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11221. } while (0)
  11222. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11223. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11224. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11225. do { \
  11226. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11227. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11228. } while (0)
  11229. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11230. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11231. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11232. do { \
  11233. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11234. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11235. } while (0)
  11236. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11237. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11238. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11239. do { \
  11240. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11241. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11242. } while (0)
  11243. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11244. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11245. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11246. do { \
  11247. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11248. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11249. } while (0)
  11250. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11251. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11252. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11253. do { \
  11254. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11255. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11256. } while (0)
  11257. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11258. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11259. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11260. do { \
  11261. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11262. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11263. } while (0)
  11264. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11265. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11266. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11267. do { \
  11268. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11269. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11270. } while (0)
  11271. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11272. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11273. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11274. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11279. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11280. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11281. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11282. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11283. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11284. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11285. /**
  11286. * @brief target -> host rx peer map V3 message definition
  11287. *
  11288. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11289. *
  11290. * @details
  11291. * The following diagram shows the format of the rx peer map v3 message sent
  11292. * from the target to the host.
  11293. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11294. * This layout assumes the target operates as little-endian.
  11295. *
  11296. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11297. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11298. * | SW peer ID | VDEV ID | msg type |
  11299. * |-----------------+--------------------+-----------------+-----------------|
  11300. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11301. * |-----------------+--------------------+-----------------+-----------------|
  11302. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11303. * |-----------------+--------+-----------+-----------------+-----------------|
  11304. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11305. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11306. * | (8bits) | | (4bits) | |
  11307. * |-----------------+--------+--+--+--+--------------------------------------|
  11308. * | RESERVED |E |O | | |
  11309. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11310. * | |V |V | | |
  11311. * |-----------------+--------------------+-----------------------------------|
  11312. * | HTT_MSDU_IDX_ | RESERVED | |
  11313. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11314. * | (8bits) | | |
  11315. * |-----------------+--------------------+-----------------------------------|
  11316. * | Reserved_2 |
  11317. * |--------------------------------------------------------------------------|
  11318. * | Reserved_3 |
  11319. * |--------------------------------------------------------------------------|
  11320. *
  11321. * Where:
  11322. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11323. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11324. * NH = Next Hop
  11325. * The following field definitions describe the format of the rx peer map v3
  11326. * messages sent from the target to the host.
  11327. * - MSG_TYPE
  11328. * Bits 7:0
  11329. * Purpose: identifies this as a peer map v3 message
  11330. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11331. * - VDEV_ID
  11332. * Bits 15:8
  11333. * Purpose: Indicates which virtual device the peer is associated with.
  11334. * - SW_PEER_ID
  11335. * Bits 31:16
  11336. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11337. * - MAC_ADDR_L32
  11338. * Bits 31:0
  11339. * Purpose: Identifies which peer node the peer ID is for.
  11340. * Value: lower 4 bytes of peer node's MAC address
  11341. * - MAC_ADDR_U16
  11342. * Bits 15:0
  11343. * Purpose: Identifies which peer node the peer ID is for.
  11344. * Value: upper 2 bytes of peer node's MAC address
  11345. * - MULTICAST_SW_PEER_ID
  11346. * Bits 31:16
  11347. * Purpose: The multicast peer ID (index)
  11348. * Value: set to HTT_INVALID_PEER if not valid
  11349. * - HW_PEER_ID / AST_INDEX
  11350. * Bits 15:0
  11351. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11352. * address, so for rx frames marked for rx --> tx forwarding, the
  11353. * host can determine from the HW peer ID provided as meta-data with
  11354. * the rx frame which peer the frame is supposed to be forwarded to.
  11355. * - CACHE_SET_NUM
  11356. * Bits 19:16
  11357. * Purpose: Cache Set Number for AST_INDEX
  11358. * Cache set number that should be used to cache the index based
  11359. * search results, for address and flow search.
  11360. * This value should be equal to LSB 4 bits of the hash value
  11361. * of match data, in case of search index points to an entry which
  11362. * may be used in content based search also. The value can be
  11363. * anything when the entry pointed by search index will not be
  11364. * used for content based search.
  11365. * - HTT_MSDU_IDX_VALID_MASK
  11366. * Bits 31:24
  11367. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11368. * - ONCHIP_AST_IDX / RESERVED
  11369. * Bits 15:0
  11370. * Purpose: This field is valid only when split AST feature is enabled.
  11371. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11372. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11373. * address, this ast_idx is used for LMAC modules for RXPCU.
  11374. * - NEXT_HOP
  11375. * Bits 16
  11376. * Purpose: Flag indicates next_hop AST entry used for WDS
  11377. * (Wireless Distribution System).
  11378. * - ONCHIP_AST_VALID
  11379. * Bits 17
  11380. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11381. * - EXT_AST_VALID
  11382. * Bits 18
  11383. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11384. * - EXT_AST_INDEX
  11385. * Bits 15:0
  11386. * Purpose: This field describes Extended AST index
  11387. * Valid if EXT_AST_VALID flag set
  11388. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11389. * Bits 31:24
  11390. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11391. */
  11392. /* dword 0 */
  11393. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11394. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11395. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11396. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11397. /* dword 1 */
  11398. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11399. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11400. /* dword 2 */
  11401. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11402. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11403. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11404. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11405. /* dword 3 */
  11406. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11407. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11408. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11409. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11410. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11411. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11412. /* dword 4 */
  11413. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11414. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11415. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11416. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11417. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11418. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11419. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11420. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11421. /* dword 5 */
  11422. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11423. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11424. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11425. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11426. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11427. do { \
  11428. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11429. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11430. } while (0)
  11431. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11432. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11433. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11434. do { \
  11435. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11436. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11437. } while (0)
  11438. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11439. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11440. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11441. do { \
  11442. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11443. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11444. } while (0)
  11445. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11446. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11447. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11448. do { \
  11449. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11450. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11451. } while (0)
  11452. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11453. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11454. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11455. do { \
  11456. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11457. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11458. } while (0)
  11459. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11460. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11461. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11462. do { \
  11463. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11464. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11465. } while (0)
  11466. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11467. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11468. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11469. do { \
  11470. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11471. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11472. } while (0)
  11473. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11474. (((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)
  11475. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11476. do { \
  11477. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11478. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11479. } while (0)
  11480. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11481. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11482. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11483. do { \
  11484. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11485. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11486. } while (0)
  11487. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11488. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11489. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11490. do { \
  11491. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11492. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11493. } while (0)
  11494. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11495. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11496. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11497. do { \
  11498. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11499. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11500. } while (0)
  11501. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11502. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11503. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11504. do { \
  11505. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11506. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11507. } while (0)
  11508. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11509. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11510. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11511. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11512. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11513. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11514. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11515. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11516. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11517. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11518. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11519. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11520. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11521. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11522. /**
  11523. * @brief target -> host rx peer unmap V2 message definition
  11524. *
  11525. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11526. *
  11527. * The following diagram shows the format of the rx peer unmap message sent
  11528. * from the target to the host.
  11529. *
  11530. * |31 24|23 16|15 8|7 0|
  11531. * |-----------------------------------------------------------------------|
  11532. * | SW peer ID | VDEV ID | msg type |
  11533. * |-----------------------------------------------------------------------|
  11534. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11535. * |-----------------------------------------------------------------------|
  11536. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11537. * |-----------------------------------------------------------------------|
  11538. * | Peer Delete Duration |
  11539. * |-----------------------------------------------------------------------|
  11540. * | Reserved_0 | WDS Free Count |
  11541. * |-----------------------------------------------------------------------|
  11542. * | Reserved_1 |
  11543. * |-----------------------------------------------------------------------|
  11544. * | Reserved_2 |
  11545. * |-----------------------------------------------------------------------|
  11546. *
  11547. *
  11548. * The following field definitions describe the format of the rx peer unmap
  11549. * messages sent from the target to the host.
  11550. * - MSG_TYPE
  11551. * Bits 7:0
  11552. * Purpose: identifies this as an rx peer unmap v2 message
  11553. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11554. * - VDEV_ID
  11555. * Bits 15:8
  11556. * Purpose: Indicates which virtual device the peer is associated
  11557. * with.
  11558. * Value: vdev ID (used in the host to look up the vdev object)
  11559. * - SW_PEER_ID
  11560. * Bits 31:16
  11561. * Purpose: The peer ID (index) that WAL is freeing
  11562. * Value: (rx) peer ID
  11563. * - MAC_ADDR_L32
  11564. * Bits 31:0
  11565. * Purpose: Identifies which peer node the peer ID is for.
  11566. * Value: lower 4 bytes of peer node's MAC address
  11567. * - MAC_ADDR_U16
  11568. * Bits 15:0
  11569. * Purpose: Identifies which peer node the peer ID is for.
  11570. * Value: upper 2 bytes of peer node's MAC address
  11571. * - NEXT_HOP
  11572. * Bits 16
  11573. * Purpose: Bit indicates next_hop AST entry used for WDS
  11574. * (Wireless Distribution System).
  11575. * - PEER_DELETE_DURATION
  11576. * Bits 31:0
  11577. * Purpose: Time taken to delete peer, in msec,
  11578. * Used for monitoring / debugging PEER delete response delay
  11579. * - PEER_WDS_FREE_COUNT
  11580. * Bits 15:0
  11581. * Purpose: Count of WDS entries deleted associated to peer deleted
  11582. */
  11583. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11584. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11585. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11586. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11587. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11588. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11589. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11590. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11591. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11592. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11593. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11594. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11595. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11596. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11597. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11598. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11599. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11600. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11601. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11602. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11603. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11604. do { \
  11605. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11606. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11607. } while (0)
  11608. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11609. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11610. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11611. do { \
  11612. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11613. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11614. } while (0)
  11615. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11616. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11617. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11618. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11619. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11620. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11621. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11622. /**
  11623. * @brief target -> host rx peer mlo map message definition
  11624. *
  11625. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11626. *
  11627. * @details
  11628. * The following diagram shows the format of the rx mlo peer map message sent
  11629. * from the target to the host. This layout assumes the target operates
  11630. * as little-endian.
  11631. *
  11632. * MCC:
  11633. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11634. *
  11635. * WIN:
  11636. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11637. * It will be sent on the Assoc Link.
  11638. *
  11639. * This message always contains a MLO peer ID. The main purpose of the
  11640. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11641. * with, so that the host can use that MLO peer ID to determine which peer
  11642. * transmitted the rx frame.
  11643. *
  11644. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11645. * |-------------------------------------------------------------------------|
  11646. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11647. * |-------------------------------------------------------------------------|
  11648. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11649. * |-------------------------------------------------------------------------|
  11650. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11651. * |-------------------------------------------------------------------------|
  11652. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11653. * |-------------------------------------------------------------------------|
  11654. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11655. * |-------------------------------------------------------------------------|
  11656. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11657. * |-------------------------------------------------------------------------|
  11658. * |RSVD |
  11659. * |-------------------------------------------------------------------------|
  11660. * |RSVD |
  11661. * |-------------------------------------------------------------------------|
  11662. * | htt_tlv_hdr_t |
  11663. * |-------------------------------------------------------------------------|
  11664. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11665. * |-------------------------------------------------------------------------|
  11666. * | htt_tlv_hdr_t |
  11667. * |-------------------------------------------------------------------------|
  11668. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11669. * |-------------------------------------------------------------------------|
  11670. * | htt_tlv_hdr_t |
  11671. * |-------------------------------------------------------------------------|
  11672. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11673. * |-------------------------------------------------------------------------|
  11674. *
  11675. * Where:
  11676. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11677. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11678. * V (valid) - 1 Bit Bit17
  11679. * CHIPID - 3 Bits
  11680. * TIDMASK - 8 Bits
  11681. * CACHE_SET_NUM - 8 Bits
  11682. *
  11683. * The following field definitions describe the format of the rx MLO peer map
  11684. * messages sent from the target to the host.
  11685. * - MSG_TYPE
  11686. * Bits 7:0
  11687. * Purpose: identifies this as an rx mlo peer map message
  11688. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11689. *
  11690. * - MLO_PEER_ID
  11691. * Bits 23:8
  11692. * Purpose: The MLO peer ID (index).
  11693. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11694. * Value: MLO peer ID
  11695. *
  11696. * - NUMLINK
  11697. * Bits: 26:24 (3Bits)
  11698. * Purpose: Indicate the max number of logical links supported per client.
  11699. * Value: number of logical links
  11700. *
  11701. * - PRC
  11702. * Bits: 29:27 (3Bits)
  11703. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11704. * if there is migration of the primary chip.
  11705. * Value: Primary REO CHIPID
  11706. *
  11707. * - MAC_ADDR_L32
  11708. * Bits 31:0
  11709. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11710. * Value: lower 4 bytes of peer node's MAC address
  11711. *
  11712. * - MAC_ADDR_U16
  11713. * Bits 15:0
  11714. * Purpose: Identifies which peer node the peer ID is for.
  11715. * Value: upper 2 bytes of peer node's MAC address
  11716. *
  11717. * - PRIMARY_TCL_AST_IDX
  11718. * Bits 15:0
  11719. * Purpose: Primary TCL AST index for this peer.
  11720. *
  11721. * - V
  11722. * 1 Bit Position 16
  11723. * Purpose: If the ast idx is valid.
  11724. *
  11725. * - CHIPID
  11726. * Bits 19:17
  11727. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11728. *
  11729. * - TIDMASK
  11730. * Bits 27:20
  11731. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11732. *
  11733. * - CACHE_SET_NUM
  11734. * Bits 31:28
  11735. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11736. * Cache set number that should be used to cache the index based
  11737. * search results, for address and flow search.
  11738. * This value should be equal to LSB four bits of the hash value
  11739. * of match data, in case of search index points to an entry which
  11740. * may be used in content based search also. The value can be
  11741. * anything when the entry pointed by search index will not be
  11742. * used for content based search.
  11743. *
  11744. * - htt_tlv_hdr_t
  11745. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11746. *
  11747. * Bits 11:0
  11748. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11749. *
  11750. * Bits 23:12
  11751. * Purpose: Length, Length of the value that follows the header
  11752. *
  11753. * Bits 31:28
  11754. * Purpose: Reserved.
  11755. *
  11756. *
  11757. * - SW_PEER_ID
  11758. * Bits 15:0
  11759. * Purpose: The peer ID (index) that WAL is allocating
  11760. * Value: (rx) peer ID
  11761. *
  11762. * - VDEV_ID
  11763. * Bits 23:16
  11764. * Purpose: Indicates which virtual device the peer is associated with.
  11765. * Value: vdev ID (used in the host to look up the vdev object)
  11766. *
  11767. * - CHIPID
  11768. * Bits 26:24
  11769. * Purpose: Indicates which Chip id the peer is associated with.
  11770. * Value: chip ID (Provided by Host as part of QMI exchange)
  11771. */
  11772. typedef enum {
  11773. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11774. } MLO_PEER_MAP_TLV_TAG_ID;
  11775. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11776. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11777. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11778. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11779. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11780. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11781. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11782. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11783. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11784. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11785. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11786. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11787. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11788. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11789. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11790. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11791. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11792. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11793. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11794. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11795. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11796. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11797. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11798. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11799. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11800. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11801. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11802. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11803. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11804. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11805. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11806. do { \
  11807. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11808. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11809. } while (0)
  11810. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11811. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11812. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11813. do { \
  11814. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11815. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11816. } while (0)
  11817. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11818. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11819. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11820. do { \
  11821. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11822. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11823. } while (0)
  11824. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11825. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11826. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11827. do { \
  11828. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11829. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11830. } while (0)
  11831. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11832. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11833. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11834. do { \
  11835. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11836. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11837. } while (0)
  11838. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11839. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11840. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11841. do { \
  11842. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11843. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11844. } while (0)
  11845. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11846. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11847. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11848. do { \
  11849. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11850. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11851. } while (0)
  11852. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11853. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11854. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11855. do { \
  11856. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11857. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11858. } while (0)
  11859. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11860. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11861. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11862. do { \
  11863. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11864. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11865. } while (0)
  11866. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11867. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11868. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11869. do { \
  11870. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11871. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11872. } while (0)
  11873. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11874. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11875. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11876. do { \
  11877. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11878. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11879. } while (0)
  11880. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11881. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11882. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11883. do { \
  11884. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11885. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11886. } while (0)
  11887. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11888. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11889. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11890. do { \
  11891. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11892. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11893. } while (0)
  11894. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11895. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11896. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11897. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11898. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11899. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11900. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11901. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11902. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11903. *
  11904. * The following diagram shows the format of the rx mlo peer unmap message sent
  11905. * from the target to the host.
  11906. *
  11907. * |31 24|23 16|15 8|7 0|
  11908. * |-----------------------------------------------------------------------|
  11909. * | RSVD_24_31 | MLO peer ID | msg type |
  11910. * |-----------------------------------------------------------------------|
  11911. */
  11912. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11913. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11914. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11915. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11916. /**
  11917. * @brief target -> host message specifying security parameters
  11918. *
  11919. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11920. *
  11921. * @details
  11922. * The following diagram shows the format of the security specification
  11923. * message sent from the target to the host.
  11924. * This security specification message tells the host whether a PN check is
  11925. * necessary on rx data frames, and if so, how large the PN counter is.
  11926. * This message also tells the host about the security processing to apply
  11927. * to defragmented rx frames - specifically, whether a Message Integrity
  11928. * Check is required, and the Michael key to use.
  11929. *
  11930. * |31 24|23 16|15|14 8|7 0|
  11931. * |-----------------------------------------------------------------------|
  11932. * | peer ID | U| security type | msg type |
  11933. * |-----------------------------------------------------------------------|
  11934. * | Michael Key K0 |
  11935. * |-----------------------------------------------------------------------|
  11936. * | Michael Key K1 |
  11937. * |-----------------------------------------------------------------------|
  11938. * | WAPI RSC Low0 |
  11939. * |-----------------------------------------------------------------------|
  11940. * | WAPI RSC Low1 |
  11941. * |-----------------------------------------------------------------------|
  11942. * | WAPI RSC Hi0 |
  11943. * |-----------------------------------------------------------------------|
  11944. * | WAPI RSC Hi1 |
  11945. * |-----------------------------------------------------------------------|
  11946. *
  11947. * The following field definitions describe the format of the security
  11948. * indication message sent from the target to the host.
  11949. * - MSG_TYPE
  11950. * Bits 7:0
  11951. * Purpose: identifies this as a security specification message
  11952. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11953. * - SEC_TYPE
  11954. * Bits 14:8
  11955. * Purpose: specifies which type of security applies to the peer
  11956. * Value: htt_sec_type enum value
  11957. * - UNICAST
  11958. * Bit 15
  11959. * Purpose: whether this security is applied to unicast or multicast data
  11960. * Value: 1 -> unicast, 0 -> multicast
  11961. * - PEER_ID
  11962. * Bits 31:16
  11963. * Purpose: The ID number for the peer the security specification is for
  11964. * Value: peer ID
  11965. * - MICHAEL_KEY_K0
  11966. * Bits 31:0
  11967. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11968. * Value: Michael Key K0 (if security type is TKIP)
  11969. * - MICHAEL_KEY_K1
  11970. * Bits 31:0
  11971. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11972. * Value: Michael Key K1 (if security type is TKIP)
  11973. * - WAPI_RSC_LOW0
  11974. * Bits 31:0
  11975. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11976. * Value: WAPI RSC Low0 (if security type is WAPI)
  11977. * - WAPI_RSC_LOW1
  11978. * Bits 31:0
  11979. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11980. * Value: WAPI RSC Low1 (if security type is WAPI)
  11981. * - WAPI_RSC_HI0
  11982. * Bits 31:0
  11983. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11984. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11985. * - WAPI_RSC_HI1
  11986. * Bits 31:0
  11987. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11988. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11989. */
  11990. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11991. #define HTT_SEC_IND_SEC_TYPE_S 8
  11992. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11993. #define HTT_SEC_IND_UNICAST_S 15
  11994. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11995. #define HTT_SEC_IND_PEER_ID_S 16
  11996. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11997. do { \
  11998. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11999. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12000. } while (0)
  12001. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12002. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12003. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12004. do { \
  12005. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12006. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12007. } while (0)
  12008. #define HTT_SEC_IND_UNICAST_GET(word) \
  12009. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12010. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12011. do { \
  12012. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12013. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12014. } while (0)
  12015. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12016. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12017. #define HTT_SEC_IND_BYTES 28
  12018. /**
  12019. * @brief target -> host rx ADDBA / DELBA message definitions
  12020. *
  12021. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12022. *
  12023. * @details
  12024. * The following diagram shows the format of the rx ADDBA message sent
  12025. * from the target to the host:
  12026. *
  12027. * |31 20|19 16|15 8|7 0|
  12028. * |---------------------------------------------------------------------|
  12029. * | peer ID | TID | window size | msg type |
  12030. * |---------------------------------------------------------------------|
  12031. *
  12032. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12033. *
  12034. * The following diagram shows the format of the rx DELBA message sent
  12035. * from the target to the host:
  12036. *
  12037. * |31 20|19 16|15 10|9 8|7 0|
  12038. * |---------------------------------------------------------------------|
  12039. * | peer ID | TID | window size | IR| msg type |
  12040. * |---------------------------------------------------------------------|
  12041. *
  12042. * The following field definitions describe the format of the rx ADDBA
  12043. * and DELBA messages sent from the target to the host.
  12044. * - MSG_TYPE
  12045. * Bits 7:0
  12046. * Purpose: identifies this as an rx ADDBA or DELBA message
  12047. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12048. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12049. * - IR (initiator / recipient)
  12050. * Bits 9:8 (DELBA only)
  12051. * Purpose: specify whether the DELBA handshake was initiated by the
  12052. * local STA/AP, or by the peer STA/AP
  12053. * Value:
  12054. * 0 - unspecified
  12055. * 1 - initiator (a.k.a. originator)
  12056. * 2 - recipient (a.k.a. responder)
  12057. * 3 - unused / reserved
  12058. * - WIN_SIZE
  12059. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12060. * Purpose: Specifies the length of the block ack window (max = 64).
  12061. * Value:
  12062. * block ack window length specified by the received ADDBA/DELBA
  12063. * management message.
  12064. * - TID
  12065. * Bits 19:16
  12066. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12067. * Value:
  12068. * TID specified by the received ADDBA or DELBA management message.
  12069. * - PEER_ID
  12070. * Bits 31:20
  12071. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12072. * Value:
  12073. * ID (hash value) used by the host for fast, direct lookup of
  12074. * host SW peer info, including rx reorder states.
  12075. */
  12076. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12077. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12078. #define HTT_RX_ADDBA_TID_M 0xf0000
  12079. #define HTT_RX_ADDBA_TID_S 16
  12080. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12081. #define HTT_RX_ADDBA_PEER_ID_S 20
  12082. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12083. do { \
  12084. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12085. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12086. } while (0)
  12087. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12088. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12089. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12090. do { \
  12091. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12092. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12093. } while (0)
  12094. #define HTT_RX_ADDBA_TID_GET(word) \
  12095. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12096. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12097. do { \
  12098. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12099. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12100. } while (0)
  12101. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12102. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12103. #define HTT_RX_ADDBA_BYTES 4
  12104. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12105. #define HTT_RX_DELBA_INITIATOR_S 8
  12106. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12107. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12108. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12109. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12110. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12111. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12112. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12113. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12114. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12115. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12116. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12117. do { \
  12118. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12119. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12120. } while (0)
  12121. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12122. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12123. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12124. do { \
  12125. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12126. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12127. } while (0)
  12128. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12129. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12130. #define HTT_RX_DELBA_BYTES 4
  12131. /**
  12132. * @brief target -> host rx ADDBA / DELBA message definitions
  12133. *
  12134. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12135. *
  12136. * @details
  12137. * The following diagram shows the format of the rx ADDBA extn message sent
  12138. * from the target to the host:
  12139. *
  12140. * |31 20|19 16|15 13|12 8|7 0|
  12141. * |---------------------------------------------------------------------|
  12142. * | peer ID | TID | reserved | msg type |
  12143. * |---------------------------------------------------------------------|
  12144. * | reserved | window size |
  12145. * |---------------------------------------------------------------------|
  12146. *
  12147. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12148. *
  12149. * The following diagram shows the format of the rx DELBA message sent
  12150. * from the target to the host:
  12151. *
  12152. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12153. * |---------------------------------------------------------------------|
  12154. * | peer ID | TID | reserved | IR| msg type |
  12155. * |---------------------------------------------------------------------|
  12156. * | reserved | window size |
  12157. * |---------------------------------------------------------------------|
  12158. *
  12159. * The following field definitions describe the format of the rx ADDBA
  12160. * and DELBA messages sent from the target to the host.
  12161. * - MSG_TYPE
  12162. * Bits 7:0
  12163. * Purpose: identifies this as an rx ADDBA or DELBA message
  12164. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12165. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12166. * - IR (initiator / recipient)
  12167. * Bits 9:8 (DELBA only)
  12168. * Purpose: specify whether the DELBA handshake was initiated by the
  12169. * local STA/AP, or by the peer STA/AP
  12170. * Value:
  12171. * 0 - unspecified
  12172. * 1 - initiator (a.k.a. originator)
  12173. * 2 - recipient (a.k.a. responder)
  12174. * 3 - unused / reserved
  12175. * Value:
  12176. * block ack window length specified by the received ADDBA/DELBA
  12177. * management message.
  12178. * - TID
  12179. * Bits 19:16
  12180. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12181. * Value:
  12182. * TID specified by the received ADDBA or DELBA management message.
  12183. * - PEER_ID
  12184. * Bits 31:20
  12185. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12186. * Value:
  12187. * ID (hash value) used by the host for fast, direct lookup of
  12188. * host SW peer info, including rx reorder states.
  12189. * == DWORD 1
  12190. * - WIN_SIZE
  12191. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12192. * Purpose: Specifies the length of the block ack window (max = 8191).
  12193. */
  12194. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12195. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12196. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12197. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12198. /*--- Dword 0 ---*/
  12199. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12200. do { \
  12201. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12202. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12203. } while (0)
  12204. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12205. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12206. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12207. do { \
  12208. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12209. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12210. } while (0)
  12211. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12212. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12213. /*--- Dword 1 ---*/
  12214. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12215. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12216. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12217. do { \
  12218. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12219. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12220. } while (0)
  12221. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12222. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12223. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12224. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12225. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12226. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12227. #define HTT_RX_DELBA_EXTN_TID_S 16
  12228. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12229. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12230. /*--- Dword 0 ---*/
  12231. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12232. do { \
  12233. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12234. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12235. } while (0)
  12236. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12237. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12238. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12239. do { \
  12240. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12241. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12242. } while (0)
  12243. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12244. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12245. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12246. do { \
  12247. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12248. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12249. } while (0)
  12250. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12251. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12252. /*--- Dword 1 ---*/
  12253. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12254. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12255. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12256. do { \
  12257. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12258. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12259. } while (0)
  12260. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12261. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12262. #define HTT_RX_DELBA_EXTN_BYTES 8
  12263. /**
  12264. * @brief tx queue group information element definition
  12265. *
  12266. * @details
  12267. * The following diagram shows the format of the tx queue group
  12268. * information element, which can be included in target --> host
  12269. * messages to specify the number of tx "credits" (tx descriptors
  12270. * for LL, or tx buffers for HL) available to a particular group
  12271. * of host-side tx queues, and which host-side tx queues belong to
  12272. * the group.
  12273. *
  12274. * |31|30 24|23 16|15|14|13 0|
  12275. * |------------------------------------------------------------------------|
  12276. * | X| reserved | tx queue grp ID | A| S| credit count |
  12277. * |------------------------------------------------------------------------|
  12278. * | vdev ID mask | AC mask |
  12279. * |------------------------------------------------------------------------|
  12280. *
  12281. * The following definitions describe the fields within the tx queue group
  12282. * information element:
  12283. * - credit_count
  12284. * Bits 13:1
  12285. * Purpose: specify how many tx credits are available to the tx queue group
  12286. * Value: An absolute or relative, positive or negative credit value
  12287. * The 'A' bit specifies whether the value is absolute or relative.
  12288. * The 'S' bit specifies whether the value is positive or negative.
  12289. * A negative value can only be relative, not absolute.
  12290. * An absolute value replaces any prior credit value the host has for
  12291. * the tx queue group in question.
  12292. * A relative value is added to the prior credit value the host has for
  12293. * the tx queue group in question.
  12294. * - sign
  12295. * Bit 14
  12296. * Purpose: specify whether the credit count is positive or negative
  12297. * Value: 0 -> positive, 1 -> negative
  12298. * - absolute
  12299. * Bit 15
  12300. * Purpose: specify whether the credit count is absolute or relative
  12301. * Value: 0 -> relative, 1 -> absolute
  12302. * - txq_group_id
  12303. * Bits 23:16
  12304. * Purpose: indicate which tx queue group's credit and/or membership are
  12305. * being specified
  12306. * Value: 0 to max_tx_queue_groups-1
  12307. * - reserved
  12308. * Bits 30:16
  12309. * Value: 0x0
  12310. * - eXtension
  12311. * Bit 31
  12312. * Purpose: specify whether another tx queue group info element follows
  12313. * Value: 0 -> no more tx queue group information elements
  12314. * 1 -> another tx queue group information element immediately follows
  12315. * - ac_mask
  12316. * Bits 15:0
  12317. * Purpose: specify which Access Categories belong to the tx queue group
  12318. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12319. * the tx queue group.
  12320. * The AC bit-mask values are obtained by left-shifting by the
  12321. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12322. * - vdev_id_mask
  12323. * Bits 31:16
  12324. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12325. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12326. * belong to the tx queue group.
  12327. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12328. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12329. */
  12330. PREPACK struct htt_txq_group {
  12331. A_UINT32
  12332. credit_count: 14,
  12333. sign: 1,
  12334. absolute: 1,
  12335. tx_queue_group_id: 8,
  12336. reserved0: 7,
  12337. extension: 1;
  12338. A_UINT32
  12339. ac_mask: 16,
  12340. vdev_id_mask: 16;
  12341. } POSTPACK;
  12342. /* first word */
  12343. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12344. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12345. #define HTT_TXQ_GROUP_SIGN_S 14
  12346. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12347. #define HTT_TXQ_GROUP_ABS_S 15
  12348. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12349. #define HTT_TXQ_GROUP_ID_S 16
  12350. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12351. #define HTT_TXQ_GROUP_EXT_S 31
  12352. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12353. /* second word */
  12354. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12355. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12356. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12357. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12358. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12359. do { \
  12360. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12361. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12362. } while (0)
  12363. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12364. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12365. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12366. do { \
  12367. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12368. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12369. } while (0)
  12370. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12371. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12372. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12373. do { \
  12374. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12375. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12376. } while (0)
  12377. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12378. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12379. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12380. do { \
  12381. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12382. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12383. } while (0)
  12384. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12385. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12386. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12387. do { \
  12388. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12389. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12390. } while (0)
  12391. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12392. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12393. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12394. do { \
  12395. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12396. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12397. } while (0)
  12398. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12399. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12400. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12401. do { \
  12402. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12403. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12404. } while (0)
  12405. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12406. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12407. /**
  12408. * @brief target -> host TX completion indication message definition
  12409. *
  12410. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12411. *
  12412. * @details
  12413. * The following diagram shows the format of the TX completion indication sent
  12414. * from the target to the host
  12415. *
  12416. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12417. * |-------------------------------------------------------------------|
  12418. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12419. * |-------------------------------------------------------------------|
  12420. * payload:| MSDU1 ID | MSDU0 ID |
  12421. * |-------------------------------------------------------------------|
  12422. * : MSDU3 ID | MSDU2 ID :
  12423. * |-------------------------------------------------------------------|
  12424. * | struct htt_tx_compl_ind_append_retries |
  12425. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12426. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12427. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12428. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12429. * |-------------------------------------------------------------------|
  12430. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12431. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12432. * | MSDU0 tx_tsf64_low |
  12433. * |-------------------------------------------------------------------|
  12434. * | MSDU0 tx_tsf64_high |
  12435. * |-------------------------------------------------------------------|
  12436. * | MSDU1 tx_tsf64_low |
  12437. * |-------------------------------------------------------------------|
  12438. * | MSDU1 tx_tsf64_high |
  12439. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12440. * | phy_timestamp |
  12441. * |-------------------------------------------------------------------|
  12442. * | rate specs (see below) |
  12443. * |-------------------------------------------------------------------|
  12444. * | seqctrl | framectrl |
  12445. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12446. * Where:
  12447. * A0 = append (a.k.a. append0)
  12448. * A1 = append1
  12449. * TP = MSDU tx power presence
  12450. * A2 = append2
  12451. * A3 = append3
  12452. * A4 = append4
  12453. *
  12454. * The following field definitions describe the format of the TX completion
  12455. * indication sent from the target to the host
  12456. * Header fields:
  12457. * - msg_type
  12458. * Bits 7:0
  12459. * Purpose: identifies this as HTT TX completion indication
  12460. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12461. * - status
  12462. * Bits 10:8
  12463. * Purpose: the TX completion status of payload fragmentations descriptors
  12464. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12465. * - tid
  12466. * Bits 14:11
  12467. * Purpose: the tid associated with those fragmentation descriptors. It is
  12468. * valid or not, depending on the tid_invalid bit.
  12469. * Value: 0 to 15
  12470. * - tid_invalid
  12471. * Bits 15:15
  12472. * Purpose: this bit indicates whether the tid field is valid or not
  12473. * Value: 0 indicates valid; 1 indicates invalid
  12474. * - num
  12475. * Bits 23:16
  12476. * Purpose: the number of payload in this indication
  12477. * Value: 1 to 255
  12478. * - append (a.k.a. append0)
  12479. * Bits 24:24
  12480. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12481. * the number of tx retries for one MSDU at the end of this message
  12482. * Value: 0 indicates no appending; 1 indicates appending
  12483. * - append1
  12484. * Bits 25:25
  12485. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12486. * contains the timestamp info for each TX msdu id in payload.
  12487. * The order of the timestamps matches the order of the MSDU IDs.
  12488. * Note that a big-endian host needs to account for the reordering
  12489. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12490. * conversion) when determining which tx timestamp corresponds to
  12491. * which MSDU ID.
  12492. * Value: 0 indicates no appending; 1 indicates appending
  12493. * - msdu_tx_power_presence
  12494. * Bits 26:26
  12495. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12496. * for each MSDU referenced by the TX_COMPL_IND message.
  12497. * The tx power is reported in 0.5 dBm units.
  12498. * The order of the per-MSDU tx power reports matches the order
  12499. * of the MSDU IDs.
  12500. * Note that a big-endian host needs to account for the reordering
  12501. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12502. * conversion) when determining which Tx Power corresponds to
  12503. * which MSDU ID.
  12504. * Value: 0 indicates MSDU tx power reports are not appended,
  12505. * 1 indicates MSDU tx power reports are appended
  12506. * - append2
  12507. * Bits 27:27
  12508. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12509. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12510. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12511. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12512. * for each MSDU, for convenience.
  12513. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12514. * this append2 bit is set).
  12515. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12516. * dB above the noise floor.
  12517. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12518. * 1 indicates MSDU ACK RSSI values are appended.
  12519. * - append3
  12520. * Bits 28:28
  12521. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12522. * contains the tx tsf info based on wlan global TSF for
  12523. * each TX msdu id in payload.
  12524. * The order of the tx tsf matches the order of the MSDU IDs.
  12525. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12526. * values to indicate the the lower 32 bits and higher 32 bits of
  12527. * the tx tsf.
  12528. * The tx_tsf64 here represents the time MSDU was acked and the
  12529. * tx_tsf64 has microseconds units.
  12530. * Value: 0 indicates no appending; 1 indicates appending
  12531. * - append4
  12532. * Bits 29:29
  12533. * Purpose: Indicate whether data frame control fields and fields required
  12534. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12535. * message. The order of the this message matches the order of
  12536. * the MSDU IDs.
  12537. * Value: 0 indicates frame control fields and fields required for
  12538. * radio tap header values are not appended,
  12539. * 1 indicates frame control fields and fields required for
  12540. * radio tap header values are appended.
  12541. * Payload fields:
  12542. * - hmsdu_id
  12543. * Bits 15:0
  12544. * Purpose: this ID is used to track the Tx buffer in host
  12545. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12546. */
  12547. PREPACK struct htt_tx_data_hdr_information {
  12548. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12549. A_UINT32 /* word 1 */
  12550. /* preamble:
  12551. * 0-OFDM,
  12552. * 1-CCk,
  12553. * 2-HT,
  12554. * 3-VHT
  12555. */
  12556. preamble: 2, /* [1:0] */
  12557. /* mcs:
  12558. * In case of HT preamble interpret
  12559. * MCS along with NSS.
  12560. * Valid values for HT are 0 to 7.
  12561. * HT mcs 0 with NSS 2 is mcs 8.
  12562. * Valid values for VHT are 0 to 9.
  12563. */
  12564. mcs: 4, /* [5:2] */
  12565. /* rate:
  12566. * This is applicable only for
  12567. * CCK and OFDM preamble type
  12568. * rate 0: OFDM 48 Mbps,
  12569. * 1: OFDM 24 Mbps,
  12570. * 2: OFDM 12 Mbps
  12571. * 3: OFDM 6 Mbps
  12572. * 4: OFDM 54 Mbps
  12573. * 5: OFDM 36 Mbps
  12574. * 6: OFDM 18 Mbps
  12575. * 7: OFDM 9 Mbps
  12576. * rate 0: CCK 11 Mbps Long
  12577. * 1: CCK 5.5 Mbps Long
  12578. * 2: CCK 2 Mbps Long
  12579. * 3: CCK 1 Mbps Long
  12580. * 4: CCK 11 Mbps Short
  12581. * 5: CCK 5.5 Mbps Short
  12582. * 6: CCK 2 Mbps Short
  12583. */
  12584. rate : 3, /* [ 8: 6] */
  12585. rssi : 8, /* [16: 9] units=dBm */
  12586. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12587. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12588. stbc : 1, /* [22] */
  12589. sgi : 1, /* [23] */
  12590. ldpc : 1, /* [24] */
  12591. beamformed: 1, /* [25] */
  12592. /* tx_retry_cnt:
  12593. * Indicates retry count of data tx frames provided by the host.
  12594. */
  12595. tx_retry_cnt: 6; /* [31:26] */
  12596. A_UINT32 /* word 2 */
  12597. framectrl:16, /* [15: 0] */
  12598. seqno:16; /* [31:16] */
  12599. } POSTPACK;
  12600. #define HTT_TX_COMPL_IND_STATUS_S 8
  12601. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12602. #define HTT_TX_COMPL_IND_TID_S 11
  12603. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12604. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12605. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12606. #define HTT_TX_COMPL_IND_NUM_S 16
  12607. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12608. #define HTT_TX_COMPL_IND_APPEND_S 24
  12609. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12610. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12611. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12612. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12613. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12614. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12615. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12616. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12617. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12618. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12619. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12620. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12621. do { \
  12622. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12623. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12624. } while (0)
  12625. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12626. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12627. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12628. do { \
  12629. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12630. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12631. } while (0)
  12632. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12633. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12634. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12635. do { \
  12636. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12637. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12638. } while (0)
  12639. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12640. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12641. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12642. do { \
  12643. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12644. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12645. } while (0)
  12646. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12647. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12648. HTT_TX_COMPL_IND_TID_INV_S)
  12649. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12650. do { \
  12651. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12652. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12653. } while (0)
  12654. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12655. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12656. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12657. do { \
  12658. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12659. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12660. } while (0)
  12661. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12662. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12663. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12664. do { \
  12665. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12666. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12667. } while (0)
  12668. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12669. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12670. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12671. do { \
  12672. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12673. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12674. } while (0)
  12675. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12676. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12677. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12678. do { \
  12679. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12680. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12681. } while (0)
  12682. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12683. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12684. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12685. do { \
  12686. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12687. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12688. } while (0)
  12689. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12690. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12691. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12692. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12693. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12694. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12695. #define HTT_TX_COMPL_IND_STAT_OK 0
  12696. /* DISCARD:
  12697. * current meaning:
  12698. * MSDUs were queued for transmission but filtered by HW or SW
  12699. * without any over the air attempts
  12700. * legacy meaning (HL Rome):
  12701. * MSDUs were discarded by the target FW without any over the air
  12702. * attempts due to lack of space
  12703. */
  12704. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12705. /* NO_ACK:
  12706. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12707. */
  12708. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12709. /* POSTPONE:
  12710. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12711. * be downloaded again later (in the appropriate order), when they are
  12712. * deliverable.
  12713. */
  12714. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12715. /*
  12716. * The PEER_DEL tx completion status is used for HL cases
  12717. * where the peer the frame is for has been deleted.
  12718. * The host has already discarded its copy of the frame, but
  12719. * it still needs the tx completion to restore its credit.
  12720. */
  12721. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12722. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12723. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12724. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12725. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12726. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12727. PREPACK struct htt_tx_compl_ind_base {
  12728. A_UINT32 hdr;
  12729. A_UINT16 payload[1/*or more*/];
  12730. } POSTPACK;
  12731. PREPACK struct htt_tx_compl_ind_append_retries {
  12732. A_UINT16 msdu_id;
  12733. A_UINT8 tx_retries;
  12734. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12735. 0: this is the last append_retries struct */
  12736. } POSTPACK;
  12737. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12738. A_UINT32 timestamp[1/*or more*/];
  12739. } POSTPACK;
  12740. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12741. A_UINT32 tx_tsf64_low;
  12742. A_UINT32 tx_tsf64_high;
  12743. } POSTPACK;
  12744. /* htt_tx_data_hdr_information payload extension fields: */
  12745. /* DWORD zero */
  12746. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12747. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12748. /* DWORD one */
  12749. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12750. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12751. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12752. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12753. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12754. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12755. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12756. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12757. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12758. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12759. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12760. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12761. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12762. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12763. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12764. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12765. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12766. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12767. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12768. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12769. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12770. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12771. /* DWORD two */
  12772. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12773. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12774. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12775. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12776. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12777. do { \
  12778. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12779. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12780. } while (0)
  12781. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12782. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12783. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12784. do { \
  12785. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12786. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12787. } while (0)
  12788. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12789. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12790. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12791. do { \
  12792. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12793. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12794. } while (0)
  12795. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12796. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12797. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12798. do { \
  12799. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12800. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12801. } while (0)
  12802. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12803. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12804. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12805. do { \
  12806. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12807. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12808. } while (0)
  12809. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12810. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12811. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12812. do { \
  12813. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12814. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12815. } while (0)
  12816. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12817. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12818. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12819. do { \
  12820. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12821. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12822. } while (0)
  12823. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12824. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12825. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12826. do { \
  12827. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12828. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12829. } while (0)
  12830. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12831. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12832. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12833. do { \
  12834. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12835. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12836. } while (0)
  12837. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12838. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12839. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12840. do { \
  12841. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12842. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12843. } while (0)
  12844. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12845. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12846. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12847. do { \
  12848. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12849. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12850. } while (0)
  12851. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12852. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12853. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12854. do { \
  12855. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12856. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12857. } while (0)
  12858. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12859. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12860. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12861. do { \
  12862. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12863. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12864. } while (0)
  12865. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12866. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12867. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12868. do { \
  12869. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12870. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12871. } while (0)
  12872. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12873. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12874. /**
  12875. * @brief target -> host rate-control update indication message
  12876. *
  12877. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12878. *
  12879. * @details
  12880. * The following diagram shows the format of the RC Update message
  12881. * sent from the target to the host, while processing the tx-completion
  12882. * of a transmitted PPDU.
  12883. *
  12884. * |31 24|23 16|15 8|7 0|
  12885. * |-------------------------------------------------------------|
  12886. * | peer ID | vdev ID | msg_type |
  12887. * |-------------------------------------------------------------|
  12888. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12889. * |-------------------------------------------------------------|
  12890. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12891. * |-------------------------------------------------------------|
  12892. * | : |
  12893. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12894. * | : |
  12895. * |-------------------------------------------------------------|
  12896. * | : |
  12897. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12898. * | : |
  12899. * |-------------------------------------------------------------|
  12900. * : :
  12901. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12902. *
  12903. */
  12904. typedef struct {
  12905. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12906. A_UINT32 rate_code_flags;
  12907. A_UINT32 flags; /* Encodes information such as excessive
  12908. retransmission, aggregate, some info
  12909. from .11 frame control,
  12910. STBC, LDPC, (SGI and Tx Chain Mask
  12911. are encoded in ptx_rc->flags field),
  12912. AMPDU truncation (BT/time based etc.),
  12913. RTS/CTS attempt */
  12914. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12915. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12916. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12917. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12918. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12919. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12920. } HTT_RC_TX_DONE_PARAMS;
  12921. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12922. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12923. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12924. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12925. #define HTT_RC_UPDATE_VDEVID_S 8
  12926. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12927. #define HTT_RC_UPDATE_PEERID_S 16
  12928. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12929. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12930. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12931. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12932. do { \
  12933. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12934. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12935. } while (0)
  12936. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12937. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12938. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12939. do { \
  12940. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12941. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12942. } while (0)
  12943. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12944. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12945. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12946. do { \
  12947. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12948. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12949. } while (0)
  12950. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12951. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12952. /**
  12953. * @brief target -> host rx fragment indication message definition
  12954. *
  12955. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12956. *
  12957. * @details
  12958. * The following field definitions describe the format of the rx fragment
  12959. * indication message sent from the target to the host.
  12960. * The rx fragment indication message shares the format of the
  12961. * rx indication message, but not all fields from the rx indication message
  12962. * are relevant to the rx fragment indication message.
  12963. *
  12964. *
  12965. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12966. * |-----------+-------------------+---------------------+-------------|
  12967. * | peer ID | |FV| ext TID | msg type |
  12968. * |-------------------------------------------------------------------|
  12969. * | | flush | flush |
  12970. * | | end | start |
  12971. * | | seq num | seq num |
  12972. * |-------------------------------------------------------------------|
  12973. * | reserved | FW rx desc bytes |
  12974. * |-------------------------------------------------------------------|
  12975. * | | FW MSDU Rx |
  12976. * | | desc B0 |
  12977. * |-------------------------------------------------------------------|
  12978. * Header fields:
  12979. * - MSG_TYPE
  12980. * Bits 7:0
  12981. * Purpose: identifies this as an rx fragment indication message
  12982. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12983. * - EXT_TID
  12984. * Bits 12:8
  12985. * Purpose: identify the traffic ID of the rx data, including
  12986. * special "extended" TID values for multicast, broadcast, and
  12987. * non-QoS data frames
  12988. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12989. * - FLUSH_VALID (FV)
  12990. * Bit 13
  12991. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12992. * is valid
  12993. * Value:
  12994. * 1 -> flush IE is valid and needs to be processed
  12995. * 0 -> flush IE is not valid and should be ignored
  12996. * - PEER_ID
  12997. * Bits 31:16
  12998. * Purpose: Identify, by ID, which peer sent the rx data
  12999. * Value: ID of the peer who sent the rx data
  13000. * - FLUSH_SEQ_NUM_START
  13001. * Bits 5:0
  13002. * Purpose: Indicate the start of a series of MPDUs to flush
  13003. * Not all MPDUs within this series are necessarily valid - the host
  13004. * must check each sequence number within this range to see if the
  13005. * corresponding MPDU is actually present.
  13006. * This field is only valid if the FV bit is set.
  13007. * Value:
  13008. * The sequence number for the first MPDUs to check to flush.
  13009. * The sequence number is masked by 0x3f.
  13010. * - FLUSH_SEQ_NUM_END
  13011. * Bits 11:6
  13012. * Purpose: Indicate the end of a series of MPDUs to flush
  13013. * Value:
  13014. * The sequence number one larger than the sequence number of the
  13015. * last MPDU to check to flush.
  13016. * The sequence number is masked by 0x3f.
  13017. * Not all MPDUs within this series are necessarily valid - the host
  13018. * must check each sequence number within this range to see if the
  13019. * corresponding MPDU is actually present.
  13020. * This field is only valid if the FV bit is set.
  13021. * Rx descriptor fields:
  13022. * - FW_RX_DESC_BYTES
  13023. * Bits 15:0
  13024. * Purpose: Indicate how many bytes in the Rx indication are used for
  13025. * FW Rx descriptors
  13026. * Value: 1
  13027. */
  13028. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13029. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13030. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13031. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13032. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13033. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13034. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13035. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13036. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13037. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13038. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13039. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13040. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13041. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13042. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13043. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13044. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13045. #define HTT_RX_FRAG_IND_BYTES \
  13046. (4 /* msg hdr */ + \
  13047. 4 /* flush spec */ + \
  13048. 4 /* (unused) FW rx desc bytes spec */ + \
  13049. 4 /* FW rx desc */)
  13050. /**
  13051. * @brief target -> host test message definition
  13052. *
  13053. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13054. *
  13055. * @details
  13056. * The following field definitions describe the format of the test
  13057. * message sent from the target to the host.
  13058. * The message consists of a 4-octet header, followed by a variable
  13059. * number of 32-bit integer values, followed by a variable number
  13060. * of 8-bit character values.
  13061. *
  13062. * |31 16|15 8|7 0|
  13063. * |-----------------------------------------------------------|
  13064. * | num chars | num ints | msg type |
  13065. * |-----------------------------------------------------------|
  13066. * | int 0 |
  13067. * |-----------------------------------------------------------|
  13068. * | int 1 |
  13069. * |-----------------------------------------------------------|
  13070. * | ... |
  13071. * |-----------------------------------------------------------|
  13072. * | char 3 | char 2 | char 1 | char 0 |
  13073. * |-----------------------------------------------------------|
  13074. * | | | ... | char 4 |
  13075. * |-----------------------------------------------------------|
  13076. * - MSG_TYPE
  13077. * Bits 7:0
  13078. * Purpose: identifies this as a test message
  13079. * Value: HTT_MSG_TYPE_TEST
  13080. * - NUM_INTS
  13081. * Bits 15:8
  13082. * Purpose: indicate how many 32-bit integers follow the message header
  13083. * - NUM_CHARS
  13084. * Bits 31:16
  13085. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13086. */
  13087. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13088. #define HTT_RX_TEST_NUM_INTS_S 8
  13089. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13090. #define HTT_RX_TEST_NUM_CHARS_S 16
  13091. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13092. do { \
  13093. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13094. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13095. } while (0)
  13096. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13097. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13098. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13099. do { \
  13100. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13101. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13102. } while (0)
  13103. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13104. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13105. /**
  13106. * @brief target -> host packet log message
  13107. *
  13108. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13109. *
  13110. * @details
  13111. * The following field definitions describe the format of the packet log
  13112. * message sent from the target to the host.
  13113. * The message consists of a 4-octet header,followed by a variable number
  13114. * of 32-bit character values.
  13115. *
  13116. * |31 16|15 12|11 10|9 8|7 0|
  13117. * |------------------------------------------------------------------|
  13118. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13119. * |------------------------------------------------------------------|
  13120. * | payload |
  13121. * |------------------------------------------------------------------|
  13122. * - MSG_TYPE
  13123. * Bits 7:0
  13124. * Purpose: identifies this as a pktlog message
  13125. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13126. * - mac_id
  13127. * Bits 9:8
  13128. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13129. * Value: 0-3
  13130. * - pdev_id
  13131. * Bits 11:10
  13132. * Purpose: pdev_id
  13133. * Value: 0-3
  13134. * 0 (for rings at SOC level),
  13135. * 1/2/3 PDEV -> 0/1/2
  13136. * - payload_size
  13137. * Bits 31:16
  13138. * Purpose: explicitly specify the payload size
  13139. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13140. */
  13141. PREPACK struct htt_pktlog_msg {
  13142. A_UINT32 header;
  13143. A_UINT32 payload[1/* or more */];
  13144. } POSTPACK;
  13145. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13146. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13147. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13148. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13149. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13150. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13151. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13152. do { \
  13153. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13154. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13155. } while (0)
  13156. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13157. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13158. HTT_T2H_PKTLOG_MAC_ID_S)
  13159. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13160. do { \
  13161. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13162. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13163. } while (0)
  13164. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13165. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13166. HTT_T2H_PKTLOG_PDEV_ID_S)
  13167. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13168. do { \
  13169. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13170. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13171. } while (0)
  13172. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13173. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13174. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13175. /*
  13176. * Rx reorder statistics
  13177. * NB: all the fields must be defined in 4 octets size.
  13178. */
  13179. struct rx_reorder_stats {
  13180. /* Non QoS MPDUs received */
  13181. A_UINT32 deliver_non_qos;
  13182. /* MPDUs received in-order */
  13183. A_UINT32 deliver_in_order;
  13184. /* Flush due to reorder timer expired */
  13185. A_UINT32 deliver_flush_timeout;
  13186. /* Flush due to move out of window */
  13187. A_UINT32 deliver_flush_oow;
  13188. /* Flush due to DELBA */
  13189. A_UINT32 deliver_flush_delba;
  13190. /* MPDUs dropped due to FCS error */
  13191. A_UINT32 fcs_error;
  13192. /* MPDUs dropped due to monitor mode non-data packet */
  13193. A_UINT32 mgmt_ctrl;
  13194. /* Unicast-data MPDUs dropped due to invalid peer */
  13195. A_UINT32 invalid_peer;
  13196. /* MPDUs dropped due to duplication (non aggregation) */
  13197. A_UINT32 dup_non_aggr;
  13198. /* MPDUs dropped due to processed before */
  13199. A_UINT32 dup_past;
  13200. /* MPDUs dropped due to duplicate in reorder queue */
  13201. A_UINT32 dup_in_reorder;
  13202. /* Reorder timeout happened */
  13203. A_UINT32 reorder_timeout;
  13204. /* invalid bar ssn */
  13205. A_UINT32 invalid_bar_ssn;
  13206. /* reorder reset due to bar ssn */
  13207. A_UINT32 ssn_reset;
  13208. /* Flush due to delete peer */
  13209. A_UINT32 deliver_flush_delpeer;
  13210. /* Flush due to offload*/
  13211. A_UINT32 deliver_flush_offload;
  13212. /* Flush due to out of buffer*/
  13213. A_UINT32 deliver_flush_oob;
  13214. /* MPDUs dropped due to PN check fail */
  13215. A_UINT32 pn_fail;
  13216. /* MPDUs dropped due to unable to allocate memory */
  13217. A_UINT32 store_fail;
  13218. /* Number of times the tid pool alloc succeeded */
  13219. A_UINT32 tid_pool_alloc_succ;
  13220. /* Number of times the MPDU pool alloc succeeded */
  13221. A_UINT32 mpdu_pool_alloc_succ;
  13222. /* Number of times the MSDU pool alloc succeeded */
  13223. A_UINT32 msdu_pool_alloc_succ;
  13224. /* Number of times the tid pool alloc failed */
  13225. A_UINT32 tid_pool_alloc_fail;
  13226. /* Number of times the MPDU pool alloc failed */
  13227. A_UINT32 mpdu_pool_alloc_fail;
  13228. /* Number of times the MSDU pool alloc failed */
  13229. A_UINT32 msdu_pool_alloc_fail;
  13230. /* Number of times the tid pool freed */
  13231. A_UINT32 tid_pool_free;
  13232. /* Number of times the MPDU pool freed */
  13233. A_UINT32 mpdu_pool_free;
  13234. /* Number of times the MSDU pool freed */
  13235. A_UINT32 msdu_pool_free;
  13236. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13237. A_UINT32 msdu_queued;
  13238. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13239. A_UINT32 msdu_recycled;
  13240. /* Number of MPDUs with invalid peer but A2 found in AST */
  13241. A_UINT32 invalid_peer_a2_in_ast;
  13242. /* Number of MPDUs with invalid peer but A3 found in AST */
  13243. A_UINT32 invalid_peer_a3_in_ast;
  13244. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13245. A_UINT32 invalid_peer_bmc_mpdus;
  13246. /* Number of MSDUs with err attention word */
  13247. A_UINT32 rxdesc_err_att;
  13248. /* Number of MSDUs with flag of peer_idx_invalid */
  13249. A_UINT32 rxdesc_err_peer_idx_inv;
  13250. /* Number of MSDUs with flag of peer_idx_timeout */
  13251. A_UINT32 rxdesc_err_peer_idx_to;
  13252. /* Number of MSDUs with flag of overflow */
  13253. A_UINT32 rxdesc_err_ov;
  13254. /* Number of MSDUs with flag of msdu_length_err */
  13255. A_UINT32 rxdesc_err_msdu_len;
  13256. /* Number of MSDUs with flag of mpdu_length_err */
  13257. A_UINT32 rxdesc_err_mpdu_len;
  13258. /* Number of MSDUs with flag of tkip_mic_err */
  13259. A_UINT32 rxdesc_err_tkip_mic;
  13260. /* Number of MSDUs with flag of decrypt_err */
  13261. A_UINT32 rxdesc_err_decrypt;
  13262. /* Number of MSDUs with flag of fcs_err */
  13263. A_UINT32 rxdesc_err_fcs;
  13264. /* Number of Unicast (bc_mc bit is not set in attention word)
  13265. * frames with invalid peer handler
  13266. */
  13267. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13268. /* Number of unicast frame directly (direct bit is set in attention word)
  13269. * to DUT with invalid peer handler
  13270. */
  13271. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13272. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13273. * frames with invalid peer handler
  13274. */
  13275. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13276. /* Number of MSDUs dropped due to no first MSDU flag */
  13277. A_UINT32 rxdesc_no_1st_msdu;
  13278. /* Number of MSDUs droped due to ring overflow */
  13279. A_UINT32 msdu_drop_ring_ov;
  13280. /* Number of MSDUs dropped due to FC mismatch */
  13281. A_UINT32 msdu_drop_fc_mismatch;
  13282. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13283. A_UINT32 msdu_drop_mgmt_remote_ring;
  13284. /* Number of MSDUs dropped due to errors not reported in attention word */
  13285. A_UINT32 msdu_drop_misc;
  13286. /* Number of MSDUs go to offload before reorder */
  13287. A_UINT32 offload_msdu_wal;
  13288. /* Number of data frame dropped by offload after reorder */
  13289. A_UINT32 offload_msdu_reorder;
  13290. /* Number of MPDUs with sequence number in the past and within the BA window */
  13291. A_UINT32 dup_past_within_window;
  13292. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13293. A_UINT32 dup_past_outside_window;
  13294. /* Number of MSDUs with decrypt/MIC error */
  13295. A_UINT32 rxdesc_err_decrypt_mic;
  13296. /* Number of data MSDUs received on both local and remote rings */
  13297. A_UINT32 data_msdus_on_both_rings;
  13298. /* MPDUs never filled */
  13299. A_UINT32 holes_not_filled;
  13300. };
  13301. /*
  13302. * Rx Remote buffer statistics
  13303. * NB: all the fields must be defined in 4 octets size.
  13304. */
  13305. struct rx_remote_buffer_mgmt_stats {
  13306. /* Total number of MSDUs reaped for Rx processing */
  13307. A_UINT32 remote_reaped;
  13308. /* MSDUs recycled within firmware */
  13309. A_UINT32 remote_recycled;
  13310. /* MSDUs stored by Data Rx */
  13311. A_UINT32 data_rx_msdus_stored;
  13312. /* Number of HTT indications from WAL Rx MSDU */
  13313. A_UINT32 wal_rx_ind;
  13314. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13315. A_UINT32 wal_rx_ind_unconsumed;
  13316. /* Number of HTT indications from Data Rx MSDU */
  13317. A_UINT32 data_rx_ind;
  13318. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13319. A_UINT32 data_rx_ind_unconsumed;
  13320. /* Number of HTT indications from ATHBUF */
  13321. A_UINT32 athbuf_rx_ind;
  13322. /* Number of remote buffers requested for refill */
  13323. A_UINT32 refill_buf_req;
  13324. /* Number of remote buffers filled by the host */
  13325. A_UINT32 refill_buf_rsp;
  13326. /* Number of times MAC hw_index = f/w write_index */
  13327. A_INT32 mac_no_bufs;
  13328. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13329. A_INT32 fw_indices_equal;
  13330. /* Number of times f/w finds no buffers to post */
  13331. A_INT32 host_no_bufs;
  13332. };
  13333. /*
  13334. * TXBF MU/SU packets and NDPA statistics
  13335. * NB: all the fields must be defined in 4 octets size.
  13336. */
  13337. struct rx_txbf_musu_ndpa_pkts_stats {
  13338. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13339. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13340. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13341. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13342. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13343. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13344. };
  13345. /*
  13346. * htt_dbg_stats_status -
  13347. * present - The requested stats have been delivered in full.
  13348. * This indicates that either the stats information was contained
  13349. * in its entirety within this message, or else this message
  13350. * completes the delivery of the requested stats info that was
  13351. * partially delivered through earlier STATS_CONF messages.
  13352. * partial - The requested stats have been delivered in part.
  13353. * One or more subsequent STATS_CONF messages with the same
  13354. * cookie value will be sent to deliver the remainder of the
  13355. * information.
  13356. * error - The requested stats could not be delivered, for example due
  13357. * to a shortage of memory to construct a message holding the
  13358. * requested stats.
  13359. * invalid - The requested stat type is either not recognized, or the
  13360. * target is configured to not gather the stats type in question.
  13361. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13362. * series_done - This special value indicates that no further stats info
  13363. * elements are present within a series of stats info elems
  13364. * (within a stats upload confirmation message).
  13365. */
  13366. enum htt_dbg_stats_status {
  13367. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13368. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13369. HTT_DBG_STATS_STATUS_ERROR = 2,
  13370. HTT_DBG_STATS_STATUS_INVALID = 3,
  13371. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13372. };
  13373. /**
  13374. * @brief target -> host statistics upload
  13375. *
  13376. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13377. *
  13378. * @details
  13379. * The following field definitions describe the format of the HTT target
  13380. * to host stats upload confirmation message.
  13381. * The message contains a cookie echoed from the HTT host->target stats
  13382. * upload request, which identifies which request the confirmation is
  13383. * for, and a series of tag-length-value stats information elements.
  13384. * The tag-length header for each stats info element also includes a
  13385. * status field, to indicate whether the request for the stat type in
  13386. * question was fully met, partially met, unable to be met, or invalid
  13387. * (if the stat type in question is disabled in the target).
  13388. * A special value of all 1's in this status field is used to indicate
  13389. * the end of the series of stats info elements.
  13390. *
  13391. *
  13392. * |31 16|15 8|7 5|4 0|
  13393. * |------------------------------------------------------------|
  13394. * | reserved | msg type |
  13395. * |------------------------------------------------------------|
  13396. * | cookie LSBs |
  13397. * |------------------------------------------------------------|
  13398. * | cookie MSBs |
  13399. * |------------------------------------------------------------|
  13400. * | stats entry length | reserved | S |stat type|
  13401. * |------------------------------------------------------------|
  13402. * | |
  13403. * | type-specific stats info |
  13404. * | |
  13405. * |------------------------------------------------------------|
  13406. * | stats entry length | reserved | S |stat type|
  13407. * |------------------------------------------------------------|
  13408. * | |
  13409. * | type-specific stats info |
  13410. * | |
  13411. * |------------------------------------------------------------|
  13412. * | n/a | reserved | 111 | n/a |
  13413. * |------------------------------------------------------------|
  13414. * Header fields:
  13415. * - MSG_TYPE
  13416. * Bits 7:0
  13417. * Purpose: identifies this is a statistics upload confirmation message
  13418. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13419. * - COOKIE_LSBS
  13420. * Bits 31:0
  13421. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13422. * message with its preceding host->target stats request message.
  13423. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13424. * - COOKIE_MSBS
  13425. * Bits 31:0
  13426. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13427. * message with its preceding host->target stats request message.
  13428. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13429. *
  13430. * Stats Information Element tag-length header fields:
  13431. * - STAT_TYPE
  13432. * Bits 4:0
  13433. * Purpose: identifies the type of statistics info held in the
  13434. * following information element
  13435. * Value: htt_dbg_stats_type
  13436. * - STATUS
  13437. * Bits 7:5
  13438. * Purpose: indicate whether the requested stats are present
  13439. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13440. * the completion of the stats entry series
  13441. * - LENGTH
  13442. * Bits 31:16
  13443. * Purpose: indicate the stats information size
  13444. * Value: This field specifies the number of bytes of stats information
  13445. * that follows the element tag-length header.
  13446. * It is expected but not required that this length is a multiple of
  13447. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13448. * subsequent stats entry header will begin on a 4-byte aligned
  13449. * boundary.
  13450. */
  13451. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13452. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13453. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13454. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13455. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13456. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13457. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13458. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13459. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13460. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13461. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13462. do { \
  13463. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13464. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13465. } while (0)
  13466. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13467. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13468. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13469. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13470. do { \
  13471. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13472. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13473. } while (0)
  13474. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13475. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13476. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13477. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13478. do { \
  13479. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13480. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13481. } while (0)
  13482. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13483. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13484. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13485. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13486. #define HTT_MAX_AGGR 64
  13487. #define HTT_HL_MAX_AGGR 18
  13488. /**
  13489. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13490. *
  13491. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13492. *
  13493. * @details
  13494. * The following field definitions describe the format of the HTT host
  13495. * to target frag_desc/msdu_ext bank configuration message.
  13496. * The message contains the based address and the min and max id of the
  13497. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13498. * MSDU_EXT/FRAG_DESC.
  13499. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13500. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13501. * the hardware does the mapping/translation.
  13502. *
  13503. * Total banks that can be configured is configured to 16.
  13504. *
  13505. * This should be called before any TX has be initiated by the HTT
  13506. *
  13507. * |31 16|15 8|7 5|4 0|
  13508. * |------------------------------------------------------------|
  13509. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13510. * |------------------------------------------------------------|
  13511. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13512. #if HTT_PADDR64
  13513. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13514. #endif
  13515. * |------------------------------------------------------------|
  13516. * | ... |
  13517. * |------------------------------------------------------------|
  13518. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13519. #if HTT_PADDR64
  13520. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13521. #endif
  13522. * |------------------------------------------------------------|
  13523. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13524. * |------------------------------------------------------------|
  13525. * | ... |
  13526. * |------------------------------------------------------------|
  13527. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13528. * |------------------------------------------------------------|
  13529. * Header fields:
  13530. * - MSG_TYPE
  13531. * Bits 7:0
  13532. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13533. * for systems with 64-bit format for bus addresses:
  13534. * - BANKx_BASE_ADDRESS_LO
  13535. * Bits 31:0
  13536. * Purpose: Provide a mechanism to specify the base address of the
  13537. * MSDU_EXT bank physical/bus address.
  13538. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13539. * - BANKx_BASE_ADDRESS_HI
  13540. * Bits 31:0
  13541. * Purpose: Provide a mechanism to specify the base address of the
  13542. * MSDU_EXT bank physical/bus address.
  13543. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13544. * for systems with 32-bit format for bus addresses:
  13545. * - BANKx_BASE_ADDRESS
  13546. * Bits 31:0
  13547. * Purpose: Provide a mechanism to specify the base address of the
  13548. * MSDU_EXT bank physical/bus address.
  13549. * Value: MSDU_EXT bank physical / bus address
  13550. * - BANKx_MIN_ID
  13551. * Bits 15:0
  13552. * Purpose: Provide a mechanism to specify the min index that needs to
  13553. * mapped.
  13554. * - BANKx_MAX_ID
  13555. * Bits 31:16
  13556. * Purpose: Provide a mechanism to specify the max index that needs to
  13557. * mapped.
  13558. *
  13559. */
  13560. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13561. * safe value.
  13562. * @note MAX supported banks is 16.
  13563. */
  13564. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13565. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13566. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13567. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13568. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13569. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13570. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13571. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13572. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13573. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13574. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13575. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13576. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13577. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13578. do { \
  13579. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13580. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13581. } while (0)
  13582. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13583. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13584. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13585. do { \
  13586. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13587. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13588. } while (0)
  13589. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13590. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13591. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13592. do { \
  13593. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13594. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13595. } while (0)
  13596. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13597. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13598. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13599. do { \
  13600. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13601. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13602. } while (0)
  13603. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13604. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13605. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13606. do { \
  13607. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13608. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13609. } while (0)
  13610. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13611. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13612. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13613. do { \
  13614. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13615. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13616. } while (0)
  13617. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13618. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13619. /*
  13620. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13621. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13622. * addresses are stored in a XXX-bit field.
  13623. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13624. * htt_tx_frag_desc64_bank_cfg_t structs.
  13625. */
  13626. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13627. _paddr_bits_, \
  13628. _paddr__bank_base_address_) \
  13629. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13630. /** word 0 \
  13631. * msg_type: 8, \
  13632. * pdev_id: 2, \
  13633. * swap: 1, \
  13634. * reserved0: 5, \
  13635. * num_banks: 8, \
  13636. * desc_size: 8; \
  13637. */ \
  13638. A_UINT32 word0; \
  13639. /* \
  13640. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13641. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13642. * the second A_UINT32). \
  13643. */ \
  13644. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13645. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13646. } POSTPACK
  13647. /* define htt_tx_frag_desc32_bank_cfg_t */
  13648. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13649. /* define htt_tx_frag_desc64_bank_cfg_t */
  13650. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13651. /*
  13652. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13653. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13654. */
  13655. #if HTT_PADDR64
  13656. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13657. #else
  13658. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13659. #endif
  13660. /**
  13661. * @brief target -> host HTT TX Credit total count update message definition
  13662. *
  13663. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13664. *
  13665. *|31 16|15|14 9| 8 |7 0 |
  13666. *|---------------------+--+----------+-------+----------|
  13667. *|cur htt credit delta | Q| reserved | sign | msg type |
  13668. *|------------------------------------------------------|
  13669. *
  13670. * Header fields:
  13671. * - MSG_TYPE
  13672. * Bits 7:0
  13673. * Purpose: identifies this as a htt tx credit delta update message
  13674. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13675. * - SIGN
  13676. * Bits 8
  13677. * identifies whether credit delta is positive or negative
  13678. * Value:
  13679. * - 0x0: credit delta is positive, rebalance in some buffers
  13680. * - 0x1: credit delta is negative, rebalance out some buffers
  13681. * - reserved
  13682. * Bits 14:9
  13683. * Value: 0x0
  13684. * - TXQ_GRP
  13685. * Bit 15
  13686. * Purpose: indicates whether any tx queue group information elements
  13687. * are appended to the tx credit update message
  13688. * Value: 0 -> no tx queue group information element is present
  13689. * 1 -> a tx queue group information element immediately follows
  13690. * - DELTA_COUNT
  13691. * Bits 31:16
  13692. * Purpose: Specify current htt credit delta absolute count
  13693. */
  13694. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13695. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13696. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13697. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13698. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13699. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13700. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13701. do { \
  13702. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13703. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13704. } while (0)
  13705. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13706. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13707. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13708. do { \
  13709. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13710. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13711. } while (0)
  13712. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13713. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13714. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13715. do { \
  13716. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13717. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13718. } while (0)
  13719. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13720. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13721. #define HTT_TX_CREDIT_MSG_BYTES 4
  13722. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13723. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13724. /**
  13725. * @brief HTT WDI_IPA Operation Response Message
  13726. *
  13727. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13728. *
  13729. * @details
  13730. * HTT WDI_IPA Operation Response message is sent by target
  13731. * to host confirming suspend or resume operation.
  13732. * |31 24|23 16|15 8|7 0|
  13733. * |----------------+----------------+----------------+----------------|
  13734. * | op_code | Rsvd | msg_type |
  13735. * |-------------------------------------------------------------------|
  13736. * | Rsvd | Response len |
  13737. * |-------------------------------------------------------------------|
  13738. * | |
  13739. * | Response-type specific info |
  13740. * | |
  13741. * | |
  13742. * |-------------------------------------------------------------------|
  13743. * Header fields:
  13744. * - MSG_TYPE
  13745. * Bits 7:0
  13746. * Purpose: Identifies this as WDI_IPA Operation Response message
  13747. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13748. * - OP_CODE
  13749. * Bits 31:16
  13750. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13751. * value: = enum htt_wdi_ipa_op_code
  13752. * - RSP_LEN
  13753. * Bits 16:0
  13754. * Purpose: length for the response-type specific info
  13755. * value: = length in bytes for response-type specific info
  13756. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13757. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13758. */
  13759. PREPACK struct htt_wdi_ipa_op_response_t
  13760. {
  13761. /* DWORD 0: flags and meta-data */
  13762. A_UINT32
  13763. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13764. reserved1: 8,
  13765. op_code: 16;
  13766. A_UINT32
  13767. rsp_len: 16,
  13768. reserved2: 16;
  13769. } POSTPACK;
  13770. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13771. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13772. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13773. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13774. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13775. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13776. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13777. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13778. do { \
  13779. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13780. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13781. } while (0)
  13782. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13783. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13784. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13785. do { \
  13786. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13787. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13788. } while (0)
  13789. enum htt_phy_mode {
  13790. htt_phy_mode_11a = 0,
  13791. htt_phy_mode_11g = 1,
  13792. htt_phy_mode_11b = 2,
  13793. htt_phy_mode_11g_only = 3,
  13794. htt_phy_mode_11na_ht20 = 4,
  13795. htt_phy_mode_11ng_ht20 = 5,
  13796. htt_phy_mode_11na_ht40 = 6,
  13797. htt_phy_mode_11ng_ht40 = 7,
  13798. htt_phy_mode_11ac_vht20 = 8,
  13799. htt_phy_mode_11ac_vht40 = 9,
  13800. htt_phy_mode_11ac_vht80 = 10,
  13801. htt_phy_mode_11ac_vht20_2g = 11,
  13802. htt_phy_mode_11ac_vht40_2g = 12,
  13803. htt_phy_mode_11ac_vht80_2g = 13,
  13804. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13805. htt_phy_mode_11ac_vht160 = 15,
  13806. htt_phy_mode_max,
  13807. };
  13808. /**
  13809. * @brief target -> host HTT channel change indication
  13810. *
  13811. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13812. *
  13813. * @details
  13814. * Specify when a channel change occurs.
  13815. * This allows the host to precisely determine which rx frames arrived
  13816. * on the old channel and which rx frames arrived on the new channel.
  13817. *
  13818. *|31 |7 0 |
  13819. *|-------------------------------------------+----------|
  13820. *| reserved | msg type |
  13821. *|------------------------------------------------------|
  13822. *| primary_chan_center_freq_mhz |
  13823. *|------------------------------------------------------|
  13824. *| contiguous_chan1_center_freq_mhz |
  13825. *|------------------------------------------------------|
  13826. *| contiguous_chan2_center_freq_mhz |
  13827. *|------------------------------------------------------|
  13828. *| phy_mode |
  13829. *|------------------------------------------------------|
  13830. *
  13831. * Header fields:
  13832. * - MSG_TYPE
  13833. * Bits 7:0
  13834. * Purpose: identifies this as a htt channel change indication message
  13835. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13836. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13837. * Bits 31:0
  13838. * Purpose: identify the (center of the) new 20 MHz primary channel
  13839. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13840. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13841. * Bits 31:0
  13842. * Purpose: identify the (center of the) contiguous frequency range
  13843. * comprising the new channel.
  13844. * For example, if the new channel is a 80 MHz channel extending
  13845. * 60 MHz beyond the primary channel, this field would be 30 larger
  13846. * than the primary channel center frequency field.
  13847. * Value: center frequency of the contiguous frequency range comprising
  13848. * the full channel in MHz units
  13849. * (80+80 channels also use the CONTIG_CHAN2 field)
  13850. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13851. * Bits 31:0
  13852. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13853. * within a VHT 80+80 channel.
  13854. * This field is only relevant for VHT 80+80 channels.
  13855. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13856. * channel (arbitrary value for cases besides VHT 80+80)
  13857. * - PHY_MODE
  13858. * Bits 31:0
  13859. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13860. * and band
  13861. * Value: htt_phy_mode enum value
  13862. */
  13863. PREPACK struct htt_chan_change_t
  13864. {
  13865. /* DWORD 0: flags and meta-data */
  13866. A_UINT32
  13867. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13868. reserved1: 24;
  13869. A_UINT32 primary_chan_center_freq_mhz;
  13870. A_UINT32 contig_chan1_center_freq_mhz;
  13871. A_UINT32 contig_chan2_center_freq_mhz;
  13872. A_UINT32 phy_mode;
  13873. } POSTPACK;
  13874. /*
  13875. * Due to historical / backwards-compatibility reasons, maintain the
  13876. * below htt_chan_change_msg struct definition, which needs to be
  13877. * consistent with the above htt_chan_change_t struct definition
  13878. * (aside from the htt_chan_change_t definition including the msg_type
  13879. * dword within the message, and the htt_chan_change_msg only containing
  13880. * the payload of the message that follows the msg_type dword).
  13881. */
  13882. PREPACK struct htt_chan_change_msg {
  13883. A_UINT32 chan_mhz; /* frequency in mhz */
  13884. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13885. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13886. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13887. } POSTPACK;
  13888. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13889. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13890. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13891. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13892. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13893. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13894. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13895. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13896. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13897. do { \
  13898. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13899. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13900. } while (0)
  13901. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13902. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13903. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13904. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13905. do { \
  13906. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13907. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13908. } while (0)
  13909. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13910. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13911. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13912. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13913. do { \
  13914. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13915. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13916. } while (0)
  13917. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13918. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13919. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13920. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13921. do { \
  13922. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13923. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13924. } while (0)
  13925. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13926. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13927. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13928. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13929. /**
  13930. * @brief rx offload packet error message
  13931. *
  13932. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13933. *
  13934. * @details
  13935. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13936. * of target payload like mic err.
  13937. *
  13938. * |31 24|23 16|15 8|7 0|
  13939. * |----------------+----------------+----------------+----------------|
  13940. * | tid | vdev_id | msg_sub_type | msg_type |
  13941. * |-------------------------------------------------------------------|
  13942. * : (sub-type dependent content) :
  13943. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13944. * Header fields:
  13945. * - msg_type
  13946. * Bits 7:0
  13947. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13948. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13949. * - msg_sub_type
  13950. * Bits 15:8
  13951. * Purpose: Identifies which type of rx error is reported by this message
  13952. * value: htt_rx_ofld_pkt_err_type
  13953. * - vdev_id
  13954. * Bits 23:16
  13955. * Purpose: Identifies which vdev received the erroneous rx frame
  13956. * value:
  13957. * - tid
  13958. * Bits 31:24
  13959. * Purpose: Identifies the traffic type of the rx frame
  13960. * value:
  13961. *
  13962. * - The payload fields used if the sub-type == MIC error are shown below.
  13963. * Note - MIC err is per MSDU, while PN is per MPDU.
  13964. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13965. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13966. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13967. * instead of sending separate HTT messages for each wrong MSDU within
  13968. * the MPDU.
  13969. *
  13970. * |31 24|23 16|15 8|7 0|
  13971. * |----------------+----------------+----------------+----------------|
  13972. * | Rsvd | key_id | peer_id |
  13973. * |-------------------------------------------------------------------|
  13974. * | receiver MAC addr 31:0 |
  13975. * |-------------------------------------------------------------------|
  13976. * | Rsvd | receiver MAC addr 47:32 |
  13977. * |-------------------------------------------------------------------|
  13978. * | transmitter MAC addr 31:0 |
  13979. * |-------------------------------------------------------------------|
  13980. * | Rsvd | transmitter MAC addr 47:32 |
  13981. * |-------------------------------------------------------------------|
  13982. * | PN 31:0 |
  13983. * |-------------------------------------------------------------------|
  13984. * | Rsvd | PN 47:32 |
  13985. * |-------------------------------------------------------------------|
  13986. * - peer_id
  13987. * Bits 15:0
  13988. * Purpose: identifies which peer is frame is from
  13989. * value:
  13990. * - key_id
  13991. * Bits 23:16
  13992. * Purpose: identifies key_id of rx frame
  13993. * value:
  13994. * - RA_31_0 (receiver MAC addr 31:0)
  13995. * Bits 31:0
  13996. * Purpose: identifies by MAC address which vdev received the frame
  13997. * value: MAC address lower 4 bytes
  13998. * - RA_47_32 (receiver MAC addr 47:32)
  13999. * Bits 15:0
  14000. * Purpose: identifies by MAC address which vdev received the frame
  14001. * value: MAC address upper 2 bytes
  14002. * - TA_31_0 (transmitter MAC addr 31:0)
  14003. * Bits 31:0
  14004. * Purpose: identifies by MAC address which peer transmitted the frame
  14005. * value: MAC address lower 4 bytes
  14006. * - TA_47_32 (transmitter MAC addr 47:32)
  14007. * Bits 15:0
  14008. * Purpose: identifies by MAC address which peer transmitted the frame
  14009. * value: MAC address upper 2 bytes
  14010. * - PN_31_0
  14011. * Bits 31:0
  14012. * Purpose: Identifies pn of rx frame
  14013. * value: PN lower 4 bytes
  14014. * - PN_47_32
  14015. * Bits 15:0
  14016. * Purpose: Identifies pn of rx frame
  14017. * value:
  14018. * TKIP or CCMP: PN upper 2 bytes
  14019. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14020. */
  14021. enum htt_rx_ofld_pkt_err_type {
  14022. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14023. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14024. };
  14025. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14026. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14027. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14028. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14029. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14030. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14031. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14032. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14033. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14034. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14035. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14036. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14037. do { \
  14038. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14039. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14040. } while (0)
  14041. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14042. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14043. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14044. do { \
  14045. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14046. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14047. } while (0)
  14048. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14049. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14050. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14051. do { \
  14052. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14053. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14054. } while (0)
  14055. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14056. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14058. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14060. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14063. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14066. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14068. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14069. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14071. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14072. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14073. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14074. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14075. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14076. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14077. do { \
  14078. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14079. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14080. } while (0)
  14081. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14082. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14083. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14084. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14085. do { \
  14086. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14087. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14088. } while (0)
  14089. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14090. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14091. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14092. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14093. do { \
  14094. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14095. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14096. } while (0)
  14097. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14098. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14099. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14100. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14101. do { \
  14102. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14103. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14104. } while (0)
  14105. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14106. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14107. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14108. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14109. do { \
  14110. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14111. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14112. } while (0)
  14113. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14114. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14115. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14116. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14117. do { \
  14118. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14119. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14120. } while (0)
  14121. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14122. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14123. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14124. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14125. do { \
  14126. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14127. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14128. } while (0)
  14129. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14130. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14131. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14132. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14133. do { \
  14134. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14135. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14136. } while (0)
  14137. /**
  14138. * @brief target -> host peer rate report message
  14139. *
  14140. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14141. *
  14142. * @details
  14143. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14144. * justified rate of all the peers.
  14145. *
  14146. * |31 24|23 16|15 8|7 0|
  14147. * |----------------+----------------+----------------+----------------|
  14148. * | peer_count | | msg_type |
  14149. * |-------------------------------------------------------------------|
  14150. * : Payload (variant number of peer rate report) :
  14151. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14152. * Header fields:
  14153. * - msg_type
  14154. * Bits 7:0
  14155. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14156. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14157. * - reserved
  14158. * Bits 15:8
  14159. * Purpose:
  14160. * value:
  14161. * - peer_count
  14162. * Bits 31:16
  14163. * Purpose: Specify how many peer rate report elements are present in the payload.
  14164. * value:
  14165. *
  14166. * Payload:
  14167. * There are variant number of peer rate report follow the first 32 bits.
  14168. * The peer rate report is defined as follows.
  14169. *
  14170. * |31 20|19 16|15 0|
  14171. * |-----------------------+---------+---------------------------------|-
  14172. * | reserved | phy | peer_id | \
  14173. * |-------------------------------------------------------------------| -> report #0
  14174. * | rate | /
  14175. * |-----------------------+---------+---------------------------------|-
  14176. * | reserved | phy | peer_id | \
  14177. * |-------------------------------------------------------------------| -> report #1
  14178. * | rate | /
  14179. * |-----------------------+---------+---------------------------------|-
  14180. * | reserved | phy | peer_id | \
  14181. * |-------------------------------------------------------------------| -> report #2
  14182. * | rate | /
  14183. * |-------------------------------------------------------------------|-
  14184. * : :
  14185. * : :
  14186. * : :
  14187. * :-------------------------------------------------------------------:
  14188. *
  14189. * - peer_id
  14190. * Bits 15:0
  14191. * Purpose: identify the peer
  14192. * value:
  14193. * - phy
  14194. * Bits 19:16
  14195. * Purpose: identify which phy is in use
  14196. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14197. * Please see enum htt_peer_report_phy_type for detail.
  14198. * - reserved
  14199. * Bits 31:20
  14200. * Purpose:
  14201. * value:
  14202. * - rate
  14203. * Bits 31:0
  14204. * Purpose: represent the justified rate of the peer specified by peer_id
  14205. * value:
  14206. */
  14207. enum htt_peer_rate_report_phy_type {
  14208. HTT_PEER_RATE_REPORT_11B = 0,
  14209. HTT_PEER_RATE_REPORT_11A_G,
  14210. HTT_PEER_RATE_REPORT_11N,
  14211. HTT_PEER_RATE_REPORT_11AC,
  14212. };
  14213. #define HTT_PEER_RATE_REPORT_SIZE 8
  14214. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14215. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14216. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14217. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14218. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14219. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14220. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14221. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14222. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14223. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14224. do { \
  14225. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14226. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14227. } while (0)
  14228. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14229. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14230. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14231. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14232. do { \
  14233. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14234. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14235. } while (0)
  14236. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14237. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14238. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14239. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14240. do { \
  14241. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14242. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14243. } while (0)
  14244. /**
  14245. * @brief target -> host flow pool map message
  14246. *
  14247. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14248. *
  14249. * @details
  14250. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14251. * a flow of descriptors.
  14252. *
  14253. * This message is in TLV format and indicates the parameters to be setup a
  14254. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14255. * receive descriptors from a specified pool.
  14256. *
  14257. * The message would appear as follows:
  14258. *
  14259. * |31 24|23 16|15 8|7 0|
  14260. * |----------------+----------------+----------------+----------------|
  14261. * header | reserved | num_flows | msg_type |
  14262. * |-------------------------------------------------------------------|
  14263. * | |
  14264. * : payload :
  14265. * | |
  14266. * |-------------------------------------------------------------------|
  14267. *
  14268. * The header field is one DWORD long and is interpreted as follows:
  14269. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14270. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14271. * this message
  14272. * b'16-31 - reserved: These bits are reserved for future use
  14273. *
  14274. * Payload:
  14275. * The payload would contain multiple objects of the following structure. Each
  14276. * object represents a flow.
  14277. *
  14278. * |31 24|23 16|15 8|7 0|
  14279. * |----------------+----------------+----------------+----------------|
  14280. * header | reserved | num_flows | msg_type |
  14281. * |-------------------------------------------------------------------|
  14282. * payload0| flow_type |
  14283. * |-------------------------------------------------------------------|
  14284. * | flow_id |
  14285. * |-------------------------------------------------------------------|
  14286. * | reserved0 | flow_pool_id |
  14287. * |-------------------------------------------------------------------|
  14288. * | reserved1 | flow_pool_size |
  14289. * |-------------------------------------------------------------------|
  14290. * | reserved2 |
  14291. * |-------------------------------------------------------------------|
  14292. * payload1| flow_type |
  14293. * |-------------------------------------------------------------------|
  14294. * | flow_id |
  14295. * |-------------------------------------------------------------------|
  14296. * | reserved0 | flow_pool_id |
  14297. * |-------------------------------------------------------------------|
  14298. * | reserved1 | flow_pool_size |
  14299. * |-------------------------------------------------------------------|
  14300. * | reserved2 |
  14301. * |-------------------------------------------------------------------|
  14302. * | . |
  14303. * | . |
  14304. * | . |
  14305. * |-------------------------------------------------------------------|
  14306. *
  14307. * Each payload is 5 DWORDS long and is interpreted as follows:
  14308. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14309. * this flow is associated. It can be VDEV, peer,
  14310. * or tid (AC). Based on enum htt_flow_type.
  14311. *
  14312. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14313. * object. For flow_type vdev it is set to the
  14314. * vdevid, for peer it is peerid and for tid, it is
  14315. * tid_num.
  14316. *
  14317. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14318. * in the host for this flow
  14319. * b'16:31 - reserved0: This field in reserved for the future. In case
  14320. * we have a hierarchical implementation (HCM) of
  14321. * pools, it can be used to indicate the ID of the
  14322. * parent-pool.
  14323. *
  14324. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14325. * Descriptors for this flow will be
  14326. * allocated from this pool in the host.
  14327. * b'16:31 - reserved1: This field in reserved for the future. In case
  14328. * we have a hierarchical implementation of pools,
  14329. * it can be used to indicate the max number of
  14330. * descriptors in the pool. The b'0:15 can be used
  14331. * to indicate min number of descriptors in the
  14332. * HCM scheme.
  14333. *
  14334. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14335. * we have a hierarchical implementation of pools,
  14336. * b'0:15 can be used to indicate the
  14337. * priority-based borrowing (PBB) threshold of
  14338. * the flow's pool. The b'16:31 are still left
  14339. * reserved.
  14340. */
  14341. enum htt_flow_type {
  14342. FLOW_TYPE_VDEV = 0,
  14343. /* Insert new flow types above this line */
  14344. };
  14345. PREPACK struct htt_flow_pool_map_payload_t {
  14346. A_UINT32 flow_type;
  14347. A_UINT32 flow_id;
  14348. A_UINT32 flow_pool_id:16,
  14349. reserved0:16;
  14350. A_UINT32 flow_pool_size:16,
  14351. reserved1:16;
  14352. A_UINT32 reserved2;
  14353. } POSTPACK;
  14354. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14355. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14356. (sizeof(struct htt_flow_pool_map_payload_t))
  14357. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14358. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14359. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14360. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14361. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14362. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14363. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14364. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14365. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14366. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14367. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14368. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14369. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14370. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14371. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14372. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14373. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14374. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14375. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14376. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14377. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14378. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14379. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14380. do { \
  14381. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14382. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14383. } while (0)
  14384. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14385. do { \
  14386. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14387. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14388. } while (0)
  14389. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14390. do { \
  14391. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14392. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14393. } while (0)
  14394. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14395. do { \
  14396. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14397. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14398. } while (0)
  14399. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14400. do { \
  14401. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14402. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14403. } while (0)
  14404. /**
  14405. * @brief target -> host flow pool unmap message
  14406. *
  14407. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14408. *
  14409. * @details
  14410. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14411. * down a flow of descriptors.
  14412. * This message indicates that for the flow (whose ID is provided) is wanting
  14413. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14414. * pool of descriptors from where descriptors are being allocated for this
  14415. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14416. * be unmapped by the host.
  14417. *
  14418. * The message would appear as follows:
  14419. *
  14420. * |31 24|23 16|15 8|7 0|
  14421. * |----------------+----------------+----------------+----------------|
  14422. * | reserved0 | msg_type |
  14423. * |-------------------------------------------------------------------|
  14424. * | flow_type |
  14425. * |-------------------------------------------------------------------|
  14426. * | flow_id |
  14427. * |-------------------------------------------------------------------|
  14428. * | reserved1 | flow_pool_id |
  14429. * |-------------------------------------------------------------------|
  14430. *
  14431. * The message is interpreted as follows:
  14432. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14433. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14434. * b'8:31 - reserved0: Reserved for future use
  14435. *
  14436. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14437. * this flow is associated. It can be VDEV, peer,
  14438. * or tid (AC). Based on enum htt_flow_type.
  14439. *
  14440. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14441. * object. For flow_type vdev it is set to the
  14442. * vdevid, for peer it is peerid and for tid, it is
  14443. * tid_num.
  14444. *
  14445. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14446. * used in the host for this flow
  14447. * b'16:31 - reserved0: This field in reserved for the future.
  14448. *
  14449. */
  14450. PREPACK struct htt_flow_pool_unmap_t {
  14451. A_UINT32 msg_type:8,
  14452. reserved0:24;
  14453. A_UINT32 flow_type;
  14454. A_UINT32 flow_id;
  14455. A_UINT32 flow_pool_id:16,
  14456. reserved1:16;
  14457. } POSTPACK;
  14458. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14459. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14460. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14461. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14462. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14463. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14464. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14465. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14466. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14467. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14468. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14469. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14470. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14471. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14472. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14473. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14474. do { \
  14475. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14476. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14477. } while (0)
  14478. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14479. do { \
  14480. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14481. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14482. } while (0)
  14483. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14484. do { \
  14485. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14486. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14487. } while (0)
  14488. /**
  14489. * @brief target -> host SRING setup done message
  14490. *
  14491. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14492. *
  14493. * @details
  14494. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14495. * SRNG ring setup is done
  14496. *
  14497. * This message indicates whether the last setup operation is successful.
  14498. * It will be sent to host when host set respose_required bit in
  14499. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14500. * The message would appear as follows:
  14501. *
  14502. * |31 24|23 16|15 8|7 0|
  14503. * |--------------- +----------------+----------------+----------------|
  14504. * | setup_status | ring_id | pdev_id | msg_type |
  14505. * |-------------------------------------------------------------------|
  14506. *
  14507. * The message is interpreted as follows:
  14508. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14509. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14510. * b'8:15 - pdev_id:
  14511. * 0 (for rings at SOC/UMAC level),
  14512. * 1/2/3 mac id (for rings at LMAC level)
  14513. * b'16:23 - ring_id: Identify the ring which is set up
  14514. * More details can be got from enum htt_srng_ring_id
  14515. * b'24:31 - setup_status: Indicate status of setup operation
  14516. * Refer to htt_ring_setup_status
  14517. */
  14518. PREPACK struct htt_sring_setup_done_t {
  14519. A_UINT32 msg_type: 8,
  14520. pdev_id: 8,
  14521. ring_id: 8,
  14522. setup_status: 8;
  14523. } POSTPACK;
  14524. enum htt_ring_setup_status {
  14525. htt_ring_setup_status_ok = 0,
  14526. htt_ring_setup_status_error,
  14527. };
  14528. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14529. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14530. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14531. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14532. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14533. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14534. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14535. do { \
  14536. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14537. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14538. } while (0)
  14539. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14540. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14541. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14542. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14543. HTT_SRING_SETUP_DONE_RING_ID_S)
  14544. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14545. do { \
  14546. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14547. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14548. } while (0)
  14549. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14550. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14551. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14552. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14553. HTT_SRING_SETUP_DONE_STATUS_S)
  14554. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14555. do { \
  14556. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14557. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14558. } while (0)
  14559. /**
  14560. * @brief target -> flow map flow info
  14561. *
  14562. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14563. *
  14564. * @details
  14565. * HTT TX map flow entry with tqm flow pointer
  14566. * Sent from firmware to host to add tqm flow pointer in corresponding
  14567. * flow search entry. Flow metadata is replayed back to host as part of this
  14568. * struct to enable host to find the specific flow search entry
  14569. *
  14570. * The message would appear as follows:
  14571. *
  14572. * |31 28|27 18|17 14|13 8|7 0|
  14573. * |-------+------------------------------------------+----------------|
  14574. * | rsvd0 | fse_hsh_idx | msg_type |
  14575. * |-------------------------------------------------------------------|
  14576. * | rsvd1 | tid | peer_id |
  14577. * |-------------------------------------------------------------------|
  14578. * | tqm_flow_pntr_lo |
  14579. * |-------------------------------------------------------------------|
  14580. * | tqm_flow_pntr_hi |
  14581. * |-------------------------------------------------------------------|
  14582. * | fse_meta_data |
  14583. * |-------------------------------------------------------------------|
  14584. *
  14585. * The message is interpreted as follows:
  14586. *
  14587. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14588. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14589. *
  14590. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14591. * for this flow entry
  14592. *
  14593. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14594. *
  14595. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14596. *
  14597. * dword1 - b'14:17 - tid
  14598. *
  14599. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14600. *
  14601. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14602. *
  14603. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14604. *
  14605. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14606. * given by host
  14607. */
  14608. PREPACK struct htt_tx_map_flow_info {
  14609. A_UINT32
  14610. msg_type: 8,
  14611. fse_hsh_idx: 20,
  14612. rsvd0: 4;
  14613. A_UINT32
  14614. peer_id: 14,
  14615. tid: 4,
  14616. rsvd1: 14;
  14617. A_UINT32 tqm_flow_pntr_lo;
  14618. A_UINT32 tqm_flow_pntr_hi;
  14619. struct htt_tx_flow_metadata fse_meta_data;
  14620. } POSTPACK;
  14621. /* DWORD 0 */
  14622. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14623. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14624. /* DWORD 1 */
  14625. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14626. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14627. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14628. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14629. /* DWORD 0 */
  14630. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14631. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14632. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14633. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14634. do { \
  14635. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14636. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14637. } while (0)
  14638. /* DWORD 1 */
  14639. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14640. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14641. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14642. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14643. do { \
  14644. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14645. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14646. } while (0)
  14647. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14648. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14649. HTT_TX_MAP_FLOW_INFO_TID_S)
  14650. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14651. do { \
  14652. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14653. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14654. } while (0)
  14655. /*
  14656. * htt_dbg_ext_stats_status -
  14657. * present - The requested stats have been delivered in full.
  14658. * This indicates that either the stats information was contained
  14659. * in its entirety within this message, or else this message
  14660. * completes the delivery of the requested stats info that was
  14661. * partially delivered through earlier STATS_CONF messages.
  14662. * partial - The requested stats have been delivered in part.
  14663. * One or more subsequent STATS_CONF messages with the same
  14664. * cookie value will be sent to deliver the remainder of the
  14665. * information.
  14666. * error - The requested stats could not be delivered, for example due
  14667. * to a shortage of memory to construct a message holding the
  14668. * requested stats.
  14669. * invalid - The requested stat type is either not recognized, or the
  14670. * target is configured to not gather the stats type in question.
  14671. */
  14672. enum htt_dbg_ext_stats_status {
  14673. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14674. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14675. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14676. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14677. };
  14678. /**
  14679. * @brief target -> host ppdu stats upload
  14680. *
  14681. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14682. *
  14683. * @details
  14684. * The following field definitions describe the format of the HTT target
  14685. * to host ppdu stats indication message.
  14686. *
  14687. *
  14688. * |31 16|15 12|11 10|9 8|7 0 |
  14689. * |----------------------------------------------------------------------|
  14690. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14691. * |----------------------------------------------------------------------|
  14692. * | ppdu_id |
  14693. * |----------------------------------------------------------------------|
  14694. * | Timestamp in us |
  14695. * |----------------------------------------------------------------------|
  14696. * | reserved |
  14697. * |----------------------------------------------------------------------|
  14698. * | type-specific stats info |
  14699. * | (see htt_ppdu_stats.h) |
  14700. * |----------------------------------------------------------------------|
  14701. * Header fields:
  14702. * - MSG_TYPE
  14703. * Bits 7:0
  14704. * Purpose: Identifies this is a PPDU STATS indication
  14705. * message.
  14706. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14707. * - mac_id
  14708. * Bits 9:8
  14709. * Purpose: mac_id of this ppdu_id
  14710. * Value: 0-3
  14711. * - pdev_id
  14712. * Bits 11:10
  14713. * Purpose: pdev_id of this ppdu_id
  14714. * Value: 0-3
  14715. * 0 (for rings at SOC level),
  14716. * 1/2/3 PDEV -> 0/1/2
  14717. * - payload_size
  14718. * Bits 31:16
  14719. * Purpose: total tlv size
  14720. * Value: payload_size in bytes
  14721. */
  14722. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14723. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14724. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14725. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14726. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14727. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14728. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14729. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14730. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14731. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14732. do { \
  14733. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14734. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14735. } while (0)
  14736. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14737. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14738. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14739. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14740. do { \
  14741. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14742. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14743. } while (0)
  14744. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14745. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14746. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14747. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14748. do { \
  14749. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14750. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14751. } while (0)
  14752. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14753. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14754. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14755. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14756. do { \
  14757. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14758. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14759. } while (0)
  14760. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14761. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14762. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14763. /* htt_t2h_ppdu_stats_ind_hdr_t
  14764. * This struct contains the fields within the header of the
  14765. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14766. * stats info.
  14767. * This struct assumes little-endian layout, and thus is only
  14768. * suitable for use within processors known to be little-endian
  14769. * (such as the target).
  14770. * In contrast, the above macros provide endian-portable methods
  14771. * to get and set the bitfields within this PPDU_STATS_IND header.
  14772. */
  14773. typedef struct {
  14774. A_UINT32 msg_type: 8, /* bits 7:0 */
  14775. mac_id: 2, /* bits 9:8 */
  14776. pdev_id: 2, /* bits 11:10 */
  14777. reserved1: 4, /* bits 15:12 */
  14778. payload_size: 16; /* bits 31:16 */
  14779. A_UINT32 ppdu_id;
  14780. A_UINT32 timestamp_us;
  14781. A_UINT32 reserved2;
  14782. } htt_t2h_ppdu_stats_ind_hdr_t;
  14783. /**
  14784. * @brief target -> host extended statistics upload
  14785. *
  14786. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14787. *
  14788. * @details
  14789. * The following field definitions describe the format of the HTT target
  14790. * to host stats upload confirmation message.
  14791. * The message contains a cookie echoed from the HTT host->target stats
  14792. * upload request, which identifies which request the confirmation is
  14793. * for, and a single stats can span over multiple HTT stats indication
  14794. * due to the HTT message size limitation so every HTT ext stats indication
  14795. * will have tag-length-value stats information elements.
  14796. * The tag-length header for each HTT stats IND message also includes a
  14797. * status field, to indicate whether the request for the stat type in
  14798. * question was fully met, partially met, unable to be met, or invalid
  14799. * (if the stat type in question is disabled in the target).
  14800. * A Done bit 1's indicate the end of the of stats info elements.
  14801. *
  14802. *
  14803. * |31 16|15 12|11|10 8|7 5|4 0|
  14804. * |--------------------------------------------------------------|
  14805. * | reserved | msg type |
  14806. * |--------------------------------------------------------------|
  14807. * | cookie LSBs |
  14808. * |--------------------------------------------------------------|
  14809. * | cookie MSBs |
  14810. * |--------------------------------------------------------------|
  14811. * | stats entry length | rsvd | D| S | stat type |
  14812. * |--------------------------------------------------------------|
  14813. * | type-specific stats info |
  14814. * | (see htt_stats.h) |
  14815. * |--------------------------------------------------------------|
  14816. * Header fields:
  14817. * - MSG_TYPE
  14818. * Bits 7:0
  14819. * Purpose: Identifies this is a extended statistics upload confirmation
  14820. * message.
  14821. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14822. * - COOKIE_LSBS
  14823. * Bits 31:0
  14824. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14825. * message with its preceding host->target stats request message.
  14826. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14827. * - COOKIE_MSBS
  14828. * Bits 31:0
  14829. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14830. * message with its preceding host->target stats request message.
  14831. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14832. *
  14833. * Stats Information Element tag-length header fields:
  14834. * - STAT_TYPE
  14835. * Bits 7:0
  14836. * Purpose: identifies the type of statistics info held in the
  14837. * following information element
  14838. * Value: htt_dbg_ext_stats_type
  14839. * - STATUS
  14840. * Bits 10:8
  14841. * Purpose: indicate whether the requested stats are present
  14842. * Value: htt_dbg_ext_stats_status
  14843. * - DONE
  14844. * Bits 11
  14845. * Purpose:
  14846. * Indicates the completion of the stats entry, this will be the last
  14847. * stats conf HTT segment for the requested stats type.
  14848. * Value:
  14849. * 0 -> the stats retrieval is ongoing
  14850. * 1 -> the stats retrieval is complete
  14851. * - LENGTH
  14852. * Bits 31:16
  14853. * Purpose: indicate the stats information size
  14854. * Value: This field specifies the number of bytes of stats information
  14855. * that follows the element tag-length header.
  14856. * It is expected but not required that this length is a multiple of
  14857. * 4 bytes.
  14858. */
  14859. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14860. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14861. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14862. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14863. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14864. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14865. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14866. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14867. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14868. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14869. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14870. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14871. do { \
  14872. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14873. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14874. } while (0)
  14875. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14876. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14877. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14878. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14879. do { \
  14880. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14881. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14882. } while (0)
  14883. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14884. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14885. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14886. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14887. do { \
  14888. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14889. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14890. } while (0)
  14891. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14892. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14893. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14894. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14895. do { \
  14896. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14897. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14898. } while (0)
  14899. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14900. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14901. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14902. /**
  14903. * @brief target -> host streaming statistics upload
  14904. *
  14905. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14906. *
  14907. * @details
  14908. * The following field definitions describe the format of the HTT target
  14909. * to host streaming stats upload indication message.
  14910. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14911. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14912. * use the STREAMING_STATS_REQ message to halt the target's production of
  14913. * STREAMING_STATS_IND messages.
  14914. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14915. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14916. *
  14917. * |31 8|7 0|
  14918. * |--------------------------------------------------------------|
  14919. * | reserved | msg type |
  14920. * |--------------------------------------------------------------|
  14921. * | type-specific stats info |
  14922. * | (see htt_stats.h) |
  14923. * |--------------------------------------------------------------|
  14924. * Header fields:
  14925. * - MSG_TYPE
  14926. * Bits 7:0
  14927. * Purpose: Identifies this as a streaming statistics upload indication
  14928. * message.
  14929. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14930. */
  14931. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14932. typedef enum {
  14933. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14934. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14935. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14936. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14937. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14938. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14939. /* Reserved from 128 - 255 for target internal use.*/
  14940. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14941. } HTT_PEER_TYPE;
  14942. /** macro to convert MAC address from char array to HTT word format */
  14943. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14944. (phtt_mac_addr)->mac_addr31to0 = \
  14945. (((c_macaddr)[0] << 0) | \
  14946. ((c_macaddr)[1] << 8) | \
  14947. ((c_macaddr)[2] << 16) | \
  14948. ((c_macaddr)[3] << 24)); \
  14949. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14950. } while (0)
  14951. /**
  14952. * @brief target -> host monitor mac header indication message
  14953. *
  14954. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14955. *
  14956. * @details
  14957. * The following diagram shows the format of the monitor mac header message
  14958. * sent from the target to the host.
  14959. * This message is primarily sent when promiscuous rx mode is enabled.
  14960. * One message is sent per rx PPDU.
  14961. *
  14962. * |31 24|23 16|15 8|7 0|
  14963. * |-------------------------------------------------------------|
  14964. * | peer_id | reserved0 | msg_type |
  14965. * |-------------------------------------------------------------|
  14966. * | reserved1 | num_mpdu |
  14967. * |-------------------------------------------------------------|
  14968. * | struct hw_rx_desc |
  14969. * | (see wal_rx_desc.h) |
  14970. * |-------------------------------------------------------------|
  14971. * | struct ieee80211_frame_addr4 |
  14972. * | (see ieee80211_defs.h) |
  14973. * |-------------------------------------------------------------|
  14974. * | struct ieee80211_frame_addr4 |
  14975. * | (see ieee80211_defs.h) |
  14976. * |-------------------------------------------------------------|
  14977. * | ...... |
  14978. * |-------------------------------------------------------------|
  14979. *
  14980. * Header fields:
  14981. * - msg_type
  14982. * Bits 7:0
  14983. * Purpose: Identifies this is a monitor mac header indication message.
  14984. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14985. * - peer_id
  14986. * Bits 31:16
  14987. * Purpose: Software peer id given by host during association,
  14988. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14989. * for rx PPDUs received from unassociated peers.
  14990. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14991. * - num_mpdu
  14992. * Bits 15:0
  14993. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14994. * delivered within the message.
  14995. * Value: 1 to 32
  14996. * num_mpdu is limited to a maximum value of 32, due to buffer
  14997. * size limits. For PPDUs with more than 32 MPDUs, only the
  14998. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14999. * the PPDU will be provided.
  15000. */
  15001. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15002. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15003. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15004. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15005. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15006. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15007. do { \
  15008. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15009. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15010. } while (0)
  15011. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15012. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15013. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15014. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15015. do { \
  15016. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15017. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15018. } while (0)
  15019. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15020. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15021. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15022. /**
  15023. * @brief target -> host flow pool resize Message
  15024. *
  15025. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15026. *
  15027. * @details
  15028. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15029. * the flow pool associated with the specified ID is resized
  15030. *
  15031. * The message would appear as follows:
  15032. *
  15033. * |31 16|15 8|7 0|
  15034. * |---------------------------------+----------------+----------------|
  15035. * | reserved0 | Msg type |
  15036. * |-------------------------------------------------------------------|
  15037. * | flow pool new size | flow pool ID |
  15038. * |-------------------------------------------------------------------|
  15039. *
  15040. * The message is interpreted as follows:
  15041. * b'0:7 - msg_type: This will be set to 0x21
  15042. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15043. *
  15044. * b'0:15 - flow pool ID: Existing flow pool ID
  15045. *
  15046. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15047. *
  15048. */
  15049. PREPACK struct htt_flow_pool_resize_t {
  15050. A_UINT32 msg_type:8,
  15051. reserved0:24;
  15052. A_UINT32 flow_pool_id:16,
  15053. flow_pool_new_size:16;
  15054. } POSTPACK;
  15055. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15056. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15057. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15058. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15059. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15060. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15061. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15062. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15063. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15064. do { \
  15065. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15066. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15067. } while (0)
  15068. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15069. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15070. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15071. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15072. do { \
  15073. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15074. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15075. } while (0)
  15076. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15077. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15078. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15079. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15080. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15081. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15082. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15083. /*
  15084. * The read and write indices point to the data within the host buffer.
  15085. * Because the first 4 bytes of the host buffer is used for the read index and
  15086. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15087. * The read index and write index are the byte offsets from the base of the
  15088. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15089. * Refer the ASCII text picture below.
  15090. */
  15091. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15092. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15093. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15094. /*
  15095. ***************************************************************************
  15096. *
  15097. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15098. *
  15099. ***************************************************************************
  15100. *
  15101. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15102. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15103. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15104. * written into the Host memory region mentioned below.
  15105. *
  15106. * Read index is updated by the Host. At any point of time, the read index will
  15107. * indicate the index that will next be read by the Host. The read index is
  15108. * in units of bytes offset from the base of the meta-data buffer.
  15109. *
  15110. * Write index is updated by the FW. At any point of time, the write index will
  15111. * indicate from where the FW can start writing any new data. The write index is
  15112. * in units of bytes offset from the base of the meta-data buffer.
  15113. *
  15114. * If the Host is not fast enough in reading the CFR data, any new capture data
  15115. * would be dropped if there is no space left to write the new captures.
  15116. *
  15117. * The last 4 bytes of the memory region will have the magic pattern
  15118. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15119. * not overrun the host buffer.
  15120. *
  15121. * ,--------------------. read and write indices store the
  15122. * | | byte offset from the base of the
  15123. * | ,--------+--------. meta-data buffer to the next
  15124. * | | | | location within the data buffer
  15125. * | | v v that will be read / written
  15126. * ************************************************************************
  15127. * * Read * Write * * Magic *
  15128. * * index * index * CFR data1 ...... CFR data N * pattern *
  15129. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15130. * ************************************************************************
  15131. * |<---------- data buffer ---------->|
  15132. *
  15133. * |<----------------- meta-data buffer allocated in Host ----------------|
  15134. *
  15135. * Note:
  15136. * - Considering the 4 bytes needed to store the Read index (R) and the
  15137. * Write index (W), the initial value is as follows:
  15138. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15139. * - Buffer empty condition:
  15140. * R = W
  15141. *
  15142. * Regarding CFR data format:
  15143. * --------------------------
  15144. *
  15145. * Each CFR tone is stored in HW as 16-bits with the following format:
  15146. * {bits[15:12], bits[11:6], bits[5:0]} =
  15147. * {unsigned exponent (4 bits),
  15148. * signed mantissa_real (6 bits),
  15149. * signed mantissa_imag (6 bits)}
  15150. *
  15151. * CFR_real = mantissa_real * 2^(exponent-5)
  15152. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15153. *
  15154. *
  15155. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15156. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15157. *
  15158. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15159. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15160. * .
  15161. * .
  15162. * .
  15163. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15164. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15165. */
  15166. /* Bandwidth of peer CFR captures */
  15167. typedef enum {
  15168. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15169. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15170. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15171. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15172. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15173. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15174. } HTT_PEER_CFR_CAPTURE_BW;
  15175. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15176. * was captured
  15177. */
  15178. typedef enum {
  15179. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15180. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15181. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15182. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15183. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15184. } HTT_PEER_CFR_CAPTURE_MODE;
  15185. typedef enum {
  15186. /* This message type is currently used for the below purpose:
  15187. *
  15188. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15189. * wmi_peer_cfr_capture_cmd.
  15190. * If payload_present bit is set to 0 then the associated memory region
  15191. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15192. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15193. * message; the CFR dump will be present at the end of the message,
  15194. * after the chan_phy_mode.
  15195. */
  15196. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15197. /* Always keep this last */
  15198. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15199. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15200. /**
  15201. * @brief target -> host CFR dump completion indication message definition
  15202. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15203. *
  15204. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15205. *
  15206. * @details
  15207. * The following diagram shows the format of the Channel Frequency Response
  15208. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15209. * the channel capture of a peer is copied by Firmware into the Host memory
  15210. *
  15211. * **************************************************************************
  15212. *
  15213. * Message format when the CFR capture message type is
  15214. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15215. *
  15216. * **************************************************************************
  15217. *
  15218. * |31 16|15 |8|7 0|
  15219. * |----------------------------------------------------------------|
  15220. * header: | reserved |P| msg_type |
  15221. * word 0 | | | |
  15222. * |----------------------------------------------------------------|
  15223. * payload: | cfr_capture_msg_type |
  15224. * word 1 | |
  15225. * |----------------------------------------------------------------|
  15226. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15227. * word 2 | | | | | | | | |
  15228. * |----------------------------------------------------------------|
  15229. * | mac_addr31to0 |
  15230. * word 3 | |
  15231. * |----------------------------------------------------------------|
  15232. * | unused / reserved | mac_addr47to32 |
  15233. * word 4 | | |
  15234. * |----------------------------------------------------------------|
  15235. * | index |
  15236. * word 5 | |
  15237. * |----------------------------------------------------------------|
  15238. * | length |
  15239. * word 6 | |
  15240. * |----------------------------------------------------------------|
  15241. * | timestamp |
  15242. * word 7 | |
  15243. * |----------------------------------------------------------------|
  15244. * | counter |
  15245. * word 8 | |
  15246. * |----------------------------------------------------------------|
  15247. * | chan_mhz |
  15248. * word 9 | |
  15249. * |----------------------------------------------------------------|
  15250. * | band_center_freq1 |
  15251. * word 10 | |
  15252. * |----------------------------------------------------------------|
  15253. * | band_center_freq2 |
  15254. * word 11 | |
  15255. * |----------------------------------------------------------------|
  15256. * | chan_phy_mode |
  15257. * word 12 | |
  15258. * |----------------------------------------------------------------|
  15259. * where,
  15260. * P - payload present bit (payload_present explained below)
  15261. * req_id - memory request id (mem_req_id explained below)
  15262. * S - status field (status explained below)
  15263. * capbw - capture bandwidth (capture_bw explained below)
  15264. * mode - mode of capture (mode explained below)
  15265. * sts - space time streams (sts_count explained below)
  15266. * chbw - channel bandwidth (channel_bw explained below)
  15267. * captype - capture type (cap_type explained below)
  15268. *
  15269. * The following field definitions describe the format of the CFR dump
  15270. * completion indication sent from the target to the host
  15271. *
  15272. * Header fields:
  15273. *
  15274. * Word 0
  15275. * - msg_type
  15276. * Bits 7:0
  15277. * Purpose: Identifies this as CFR TX completion indication
  15278. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15279. * - payload_present
  15280. * Bit 8
  15281. * Purpose: Identifies how CFR data is sent to host
  15282. * Value: 0 - If CFR Payload is written to host memory
  15283. * 1 - If CFR Payload is sent as part of HTT message
  15284. * (This is the requirement for SDIO/USB where it is
  15285. * not possible to write CFR data to host memory)
  15286. * - reserved
  15287. * Bits 31:9
  15288. * Purpose: Reserved
  15289. * Value: 0
  15290. *
  15291. * Payload fields:
  15292. *
  15293. * Word 1
  15294. * - cfr_capture_msg_type
  15295. * Bits 31:0
  15296. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15297. * to specify the format used for the remainder of the message
  15298. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15299. * (currently only MSG_TYPE_1 is defined)
  15300. *
  15301. * Word 2
  15302. * - mem_req_id
  15303. * Bits 6:0
  15304. * Purpose: Contain the mem request id of the region where the CFR capture
  15305. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15306. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15307. this value is invalid)
  15308. * - status
  15309. * Bit 7
  15310. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15311. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15312. * - capture_bw
  15313. * Bits 10:8
  15314. * Purpose: Carry the bandwidth of the CFR capture
  15315. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15316. * - mode
  15317. * Bits 13:11
  15318. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15319. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15320. * - sts_count
  15321. * Bits 16:14
  15322. * Purpose: Carry the number of space time streams
  15323. * Value: Number of space time streams
  15324. * - channel_bw
  15325. * Bits 19:17
  15326. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15327. * measurement
  15328. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15329. * - cap_type
  15330. * Bits 23:20
  15331. * Purpose: Carry the type of the capture
  15332. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15333. * - vdev_id
  15334. * Bits 31:24
  15335. * Purpose: Carry the virtual device id
  15336. * Value: vdev ID
  15337. *
  15338. * Word 3
  15339. * - mac_addr31to0
  15340. * Bits 31:0
  15341. * Purpose: Contain the bits 31:0 of the peer MAC address
  15342. * Value: Bits 31:0 of the peer MAC address
  15343. *
  15344. * Word 4
  15345. * - mac_addr47to32
  15346. * Bits 15:0
  15347. * Purpose: Contain the bits 47:32 of the peer MAC address
  15348. * Value: Bits 47:32 of the peer MAC address
  15349. *
  15350. * Word 5
  15351. * - index
  15352. * Bits 31:0
  15353. * Purpose: Contain the index at which this CFR dump was written in the Host
  15354. * allocated memory. This index is the number of bytes from the base address.
  15355. * Value: Index position
  15356. *
  15357. * Word 6
  15358. * - length
  15359. * Bits 31:0
  15360. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15361. * Value: Length of the CFR capture of the peer
  15362. *
  15363. * Word 7
  15364. * - timestamp
  15365. * Bits 31:0
  15366. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15367. * clock used for this timestamp is private to the target and not visible to
  15368. * the host i.e., Host can interpret only the relative timestamp deltas from
  15369. * one message to the next, but can't interpret the absolute timestamp from a
  15370. * single message.
  15371. * Value: Timestamp in microseconds
  15372. *
  15373. * Word 8
  15374. * - counter
  15375. * Bits 31:0
  15376. * Purpose: Carry the count of the current CFR capture from FW. This is
  15377. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15378. * in host memory)
  15379. * Value: Count of the current CFR capture
  15380. *
  15381. * Word 9
  15382. * - chan_mhz
  15383. * Bits 31:0
  15384. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15385. * Value: Primary 20 channel frequency
  15386. *
  15387. * Word 10
  15388. * - band_center_freq1
  15389. * Bits 31:0
  15390. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15391. * Value: Center frequency 1 in MHz
  15392. *
  15393. * Word 11
  15394. * - band_center_freq2
  15395. * Bits 31:0
  15396. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15397. * the VDEV
  15398. * 80plus80 mode
  15399. * Value: Center frequency 2 in MHz
  15400. *
  15401. * Word 12
  15402. * - chan_phy_mode
  15403. * Bits 31:0
  15404. * Purpose: Carry the phy mode of the channel, of the VDEV
  15405. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15406. */
  15407. PREPACK struct htt_cfr_dump_ind_type_1 {
  15408. A_UINT32 mem_req_id:7,
  15409. status:1,
  15410. capture_bw:3,
  15411. mode:3,
  15412. sts_count:3,
  15413. channel_bw:3,
  15414. cap_type:4,
  15415. vdev_id:8;
  15416. htt_mac_addr addr;
  15417. A_UINT32 index;
  15418. A_UINT32 length;
  15419. A_UINT32 timestamp;
  15420. A_UINT32 counter;
  15421. struct htt_chan_change_msg chan;
  15422. } POSTPACK;
  15423. PREPACK struct htt_cfr_dump_compl_ind {
  15424. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15425. union {
  15426. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15427. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15428. /* If there is a need to change the memory layout and its associated
  15429. * HTT indication format, a new CFR capture message type can be
  15430. * introduced and added into this union.
  15431. */
  15432. };
  15433. } POSTPACK;
  15434. /*
  15435. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15436. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15437. */
  15438. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15439. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15440. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15441. do { \
  15442. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15443. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15444. } while(0)
  15445. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15446. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15447. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15448. /*
  15449. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15450. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15451. */
  15452. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15453. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15454. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15455. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15456. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15457. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15458. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15459. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15460. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15461. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15462. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15463. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15464. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15465. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15466. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15467. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15468. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15469. do { \
  15470. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15471. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15472. } while (0)
  15473. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15474. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15475. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15476. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15477. do { \
  15478. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15479. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15480. } while (0)
  15481. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15482. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15483. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15484. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15485. do { \
  15486. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15487. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15488. } while (0)
  15489. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15490. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15491. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15492. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15493. do { \
  15494. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15495. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15496. } while (0)
  15497. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15498. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15499. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15500. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15501. do { \
  15502. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15503. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15504. } while (0)
  15505. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15506. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15507. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15508. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15509. do { \
  15510. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15511. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15512. } while (0)
  15513. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15514. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15515. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15516. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15517. do { \
  15518. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15519. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15520. } while (0)
  15521. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15522. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15523. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15524. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15525. do { \
  15526. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15527. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15528. } while (0)
  15529. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15530. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15531. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15532. /**
  15533. * @brief target -> host peer (PPDU) stats message
  15534. *
  15535. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15536. *
  15537. * @details
  15538. * This message is generated by FW when FW is sending stats to host
  15539. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15540. * This message is sent autonomously by the target rather than upon request
  15541. * by the host.
  15542. * The following field definitions describe the format of the HTT target
  15543. * to host peer stats indication message.
  15544. *
  15545. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15546. * or more PPDU stats records.
  15547. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15548. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15549. * then the message would start with the
  15550. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15551. * below.
  15552. *
  15553. * |31 16|15|14|13 11|10 9|8|7 0|
  15554. * |-------------------------------------------------------------|
  15555. * | reserved |MSG_TYPE |
  15556. * |-------------------------------------------------------------|
  15557. * rec 0 | TLV header |
  15558. * rec 0 |-------------------------------------------------------------|
  15559. * rec 0 | ppdu successful bytes |
  15560. * rec 0 |-------------------------------------------------------------|
  15561. * rec 0 | ppdu retry bytes |
  15562. * rec 0 |-------------------------------------------------------------|
  15563. * rec 0 | ppdu failed bytes |
  15564. * rec 0 |-------------------------------------------------------------|
  15565. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15566. * rec 0 |-------------------------------------------------------------|
  15567. * rec 0 | retried MSDUs | successful MSDUs |
  15568. * rec 0 |-------------------------------------------------------------|
  15569. * rec 0 | TX duration | failed MSDUs |
  15570. * rec 0 |-------------------------------------------------------------|
  15571. * ...
  15572. * |-------------------------------------------------------------|
  15573. * rec N | TLV header |
  15574. * rec N |-------------------------------------------------------------|
  15575. * rec N | ppdu successful bytes |
  15576. * rec N |-------------------------------------------------------------|
  15577. * rec N | ppdu retry bytes |
  15578. * rec N |-------------------------------------------------------------|
  15579. * rec N | ppdu failed bytes |
  15580. * rec N |-------------------------------------------------------------|
  15581. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15582. * rec N |-------------------------------------------------------------|
  15583. * rec N | retried MSDUs | successful MSDUs |
  15584. * rec N |-------------------------------------------------------------|
  15585. * rec N | TX duration | failed MSDUs |
  15586. * rec N |-------------------------------------------------------------|
  15587. *
  15588. * where:
  15589. * A = is A-MPDU flag
  15590. * BA = block-ack failure flags
  15591. * BW = bandwidth spec
  15592. * SG = SGI enabled spec
  15593. * S = skipped rate ctrl
  15594. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15595. *
  15596. * Header
  15597. * ------
  15598. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15599. * dword0 - b'8:31 - reserved : Reserved for future use
  15600. *
  15601. * payload include below peer_stats information
  15602. * --------------------------------------------
  15603. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15604. * @tx_success_bytes : total successful bytes in the PPDU.
  15605. * @tx_retry_bytes : total retried bytes in the PPDU.
  15606. * @tx_failed_bytes : total failed bytes in the PPDU.
  15607. * @tx_ratecode : rate code used for the PPDU.
  15608. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15609. * @ba_ack_failed : BA/ACK failed for this PPDU
  15610. * b00 -> BA received
  15611. * b01 -> BA failed once
  15612. * b10 -> BA failed twice, when HW retry is enabled.
  15613. * @bw : BW
  15614. * b00 -> 20 MHz
  15615. * b01 -> 40 MHz
  15616. * b10 -> 80 MHz
  15617. * b11 -> 160 MHz (or 80+80)
  15618. * @sg : SGI enabled
  15619. * @s : skipped ratectrl
  15620. * @peer_id : peer id
  15621. * @tx_success_msdus : successful MSDUs
  15622. * @tx_retry_msdus : retried MSDUs
  15623. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15624. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15625. */
  15626. /**
  15627. * @brief target -> host backpressure event
  15628. *
  15629. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15630. *
  15631. * @details
  15632. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15633. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15634. * This message will only be sent if the backpressure condition has existed
  15635. * continuously for an initial period (100 ms).
  15636. * Repeat messages with updated information will be sent after each
  15637. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15638. * This message indicates the ring id along with current head and tail index
  15639. * locations (i.e. write and read indices).
  15640. * The backpressure time indicates the time in ms for which continous
  15641. * backpressure has been observed in the ring.
  15642. *
  15643. * The message format is as follows:
  15644. *
  15645. * |31 24|23 16|15 8|7 0|
  15646. * |----------------+----------------+----------------+----------------|
  15647. * | ring_id | ring_type | pdev_id | msg_type |
  15648. * |-------------------------------------------------------------------|
  15649. * | tail_idx | head_idx |
  15650. * |-------------------------------------------------------------------|
  15651. * | backpressure_time_ms |
  15652. * |-------------------------------------------------------------------|
  15653. *
  15654. * The message is interpreted as follows:
  15655. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15656. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15657. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15658. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15659. the msg is for LMAC ring.
  15660. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15661. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15662. * htt_backpressure_lmac_ring_id. This represents
  15663. * the ring id for which continous backpressure is seen
  15664. *
  15665. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15666. * the ring indicated by the ring_id
  15667. *
  15668. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15669. * the ring indicated by the ring id
  15670. *
  15671. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15672. * backpressure has been seen in the ring
  15673. * indicated by the ring_id.
  15674. * Units = milliseconds
  15675. */
  15676. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15677. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15678. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15679. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15680. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15681. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15682. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15683. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15684. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15685. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15686. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15687. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15688. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15689. do { \
  15690. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15691. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15692. } while (0)
  15693. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15694. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15695. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15696. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15697. do { \
  15698. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15699. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15700. } while (0)
  15701. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15702. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15703. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15704. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15705. do { \
  15706. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15707. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15708. } while (0)
  15709. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15710. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15711. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15712. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15713. do { \
  15714. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15715. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15716. } while (0)
  15717. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15718. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15719. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15720. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15721. do { \
  15722. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15723. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15724. } while (0)
  15725. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15726. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15727. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15728. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15729. do { \
  15730. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15731. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15732. } while (0)
  15733. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15734. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15735. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15736. enum htt_backpressure_ring_type {
  15737. HTT_SW_RING_TYPE_UMAC,
  15738. HTT_SW_RING_TYPE_LMAC,
  15739. HTT_SW_RING_TYPE_MAX,
  15740. };
  15741. /* Ring id for which the message is sent to host */
  15742. enum htt_backpressure_umac_ringid {
  15743. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15744. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15745. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15746. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15747. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15748. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15749. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15750. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15751. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15752. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15753. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15754. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15755. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15756. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15757. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15758. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15759. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15760. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15761. HTT_SW_UMAC_RING_IDX_MAX,
  15762. };
  15763. enum htt_backpressure_lmac_ringid {
  15764. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15765. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15766. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15767. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15768. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15769. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15770. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15771. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15772. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15773. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15774. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15775. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15776. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15777. HTT_SW_LMAC_RING_IDX_MAX,
  15778. };
  15779. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15780. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15781. pdev_id: 8,
  15782. ring_type: 8, /* htt_backpressure_ring_type */
  15783. /*
  15784. * ring_id holds an enum value from either
  15785. * htt_backpressure_umac_ringid or
  15786. * htt_backpressure_lmac_ringid, based on
  15787. * the ring_type setting.
  15788. */
  15789. ring_id: 8;
  15790. A_UINT16 head_idx;
  15791. A_UINT16 tail_idx;
  15792. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15793. } POSTPACK;
  15794. /*
  15795. * Defines two 32 bit words that can be used by the target to indicate a per
  15796. * user RU allocation and rate information.
  15797. *
  15798. * This information is currently provided in the "sw_response_reference_ptr"
  15799. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15800. * "rx_ppdu_end_user_stats" TLV.
  15801. *
  15802. * VALID:
  15803. * The consumer of these words must explicitly check the valid bit,
  15804. * and only attempt interpretation of any of the remaining fields if
  15805. * the valid bit is set to 1.
  15806. *
  15807. * VERSION:
  15808. * The consumer of these words must also explicitly check the version bit,
  15809. * and only use the V0 definition if the VERSION field is set to 0.
  15810. *
  15811. * Version 1 is currently undefined, with the exception of the VALID and
  15812. * VERSION fields.
  15813. *
  15814. * Version 0:
  15815. *
  15816. * The fields below are duplicated per BW.
  15817. *
  15818. * The consumer must determine which BW field to use, based on the UL OFDMA
  15819. * PPDU BW indicated by HW.
  15820. *
  15821. * RU_START: RU26 start index for the user.
  15822. * Note that this is always using the RU26 index, regardless
  15823. * of the actual RU assigned to the user
  15824. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15825. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15826. *
  15827. * For example, 20MHz (the value in the top row is RU_START)
  15828. *
  15829. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15830. * RU Size 1 (52): | | | | | |
  15831. * RU Size 2 (106): | | | |
  15832. * RU Size 3 (242): | |
  15833. *
  15834. * RU_SIZE: Indicates the RU size, as defined by enum
  15835. * htt_ul_ofdma_user_info_ru_size.
  15836. *
  15837. * LDPC: LDPC enabled (if 0, BCC is used)
  15838. *
  15839. * DCM: DCM enabled
  15840. *
  15841. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15842. * |---------------------------------+--------------------------------|
  15843. * |Ver|Valid| FW internal |
  15844. * |---------------------------------+--------------------------------|
  15845. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15846. * |---------------------------------+--------------------------------|
  15847. */
  15848. enum htt_ul_ofdma_user_info_ru_size {
  15849. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15850. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15851. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15852. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15853. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15854. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15855. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15856. };
  15857. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15858. struct htt_ul_ofdma_user_info_v0 {
  15859. A_UINT32 word0;
  15860. A_UINT32 word1;
  15861. };
  15862. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15863. A_UINT32 w0_fw_rsvd:30; \
  15864. A_UINT32 w0_valid:1; \
  15865. A_UINT32 w0_version:1;
  15866. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15867. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15868. };
  15869. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15870. A_UINT32 w1_nss:3; \
  15871. A_UINT32 w1_mcs:4; \
  15872. A_UINT32 w1_ldpc:1; \
  15873. A_UINT32 w1_dcm:1; \
  15874. A_UINT32 w1_ru_start:7; \
  15875. A_UINT32 w1_ru_size:3; \
  15876. A_UINT32 w1_trig_type:4; \
  15877. A_UINT32 w1_unused:9;
  15878. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15879. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15880. };
  15881. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15882. A_UINT32 w0_fw_rsvd:27; \
  15883. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15884. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15885. A_UINT32 w0_version:1; /* set to a value of “1” to indicate picking htt_ul_ofdma_user_info_v1_bitmap (field aligns with V0 definition) */
  15886. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15887. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15888. };
  15889. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15890. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15891. A_UINT32 w1_trig_type:4; \
  15892. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15893. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15894. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15895. };
  15896. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15897. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15898. union {
  15899. A_UINT32 word0;
  15900. struct {
  15901. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15902. };
  15903. };
  15904. union {
  15905. A_UINT32 word1;
  15906. struct {
  15907. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15908. };
  15909. };
  15910. } POSTPACK;
  15911. /*
  15912. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15913. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15914. * this should be picked.
  15915. */
  15916. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15917. union {
  15918. A_UINT32 word0;
  15919. struct {
  15920. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15921. };
  15922. };
  15923. union {
  15924. A_UINT32 word1;
  15925. struct {
  15926. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15927. };
  15928. };
  15929. } POSTPACK;
  15930. enum HTT_UL_OFDMA_TRIG_TYPE {
  15931. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15932. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15933. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15934. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15935. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15936. };
  15937. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15938. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15939. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15940. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15941. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15942. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15943. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15944. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15945. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15946. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15947. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15948. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15949. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15950. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15951. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15952. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15953. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15954. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15955. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15956. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15957. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15958. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15959. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15960. /*--- word 0 ---*/
  15961. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15962. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15963. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15964. do { \
  15965. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15966. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15967. } while (0)
  15968. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15969. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15970. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15971. do { \
  15972. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15973. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15974. } while (0)
  15975. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15976. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15977. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15978. do { \
  15979. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15980. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15981. } while (0)
  15982. /*--- word 1 ---*/
  15983. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15984. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15985. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15986. do { \
  15987. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15988. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15989. } while (0)
  15990. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15991. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15992. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15993. do { \
  15994. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15995. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15996. } while (0)
  15997. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15998. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15999. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16000. do { \
  16001. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16002. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16003. } while (0)
  16004. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16005. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16006. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16007. do { \
  16008. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16009. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16010. } while (0)
  16011. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16012. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16013. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16014. do { \
  16015. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16016. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16017. } while (0)
  16018. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16019. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16020. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16021. do { \
  16022. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16023. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16024. } while (0)
  16025. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16026. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16027. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16028. do { \
  16029. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16030. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16031. } while (0)
  16032. /**
  16033. * @brief target -> host channel calibration data message
  16034. *
  16035. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16036. *
  16037. * @brief host -> target channel calibration data message
  16038. *
  16039. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16040. *
  16041. * @details
  16042. * The following field definitions describe the format of the channel
  16043. * calibration data message sent from the target to the host when
  16044. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16045. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16046. * The message is defined as htt_chan_caldata_msg followed by a variable
  16047. * number of 32-bit character values.
  16048. *
  16049. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16050. * |------------------------------------------------------------------|
  16051. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16052. * |------------------------------------------------------------------|
  16053. * | payload size | mhz |
  16054. * |------------------------------------------------------------------|
  16055. * | center frequency 2 | center frequency 1 |
  16056. * |------------------------------------------------------------------|
  16057. * | check sum |
  16058. * |------------------------------------------------------------------|
  16059. * | payload |
  16060. * |------------------------------------------------------------------|
  16061. * message info field:
  16062. * - MSG_TYPE
  16063. * Bits 7:0
  16064. * Purpose: identifies this as a channel calibration data message
  16065. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16066. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16067. * - SUB_TYPE
  16068. * Bits 11:8
  16069. * Purpose: T2H: indicates whether target is providing chan cal data
  16070. * to the host to store, or requesting that the host
  16071. * download previously-stored data.
  16072. * H2T: indicates whether the host is providing the requested
  16073. * channel cal data, or if it is rejecting the data
  16074. * request because it does not have the requested data.
  16075. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16076. * - CHKSUM_VALID
  16077. * Bit 12
  16078. * Purpose: indicates if the checksum field is valid
  16079. * value:
  16080. * - FRAG
  16081. * Bit 19:16
  16082. * Purpose: indicates the fragment index for message
  16083. * value: 0 for first fragment, 1 for second fragment, ...
  16084. * - APPEND
  16085. * Bit 20
  16086. * Purpose: indicates if this is the last fragment
  16087. * value: 0 = final fragment, 1 = more fragments will be appended
  16088. *
  16089. * channel and payload size field
  16090. * - MHZ
  16091. * Bits 15:0
  16092. * Purpose: indicates the channel primary frequency
  16093. * Value:
  16094. * - PAYLOAD_SIZE
  16095. * Bits 31:16
  16096. * Purpose: indicates the bytes of calibration data in payload
  16097. * Value:
  16098. *
  16099. * center frequency field
  16100. * - CENTER FREQUENCY 1
  16101. * Bits 15:0
  16102. * Purpose: indicates the channel center frequency
  16103. * Value: channel center frequency, in MHz units
  16104. * - CENTER FREQUENCY 2
  16105. * Bits 31:16
  16106. * Purpose: indicates the secondary channel center frequency,
  16107. * only for 11acvht 80plus80 mode
  16108. * Value: secondary channel center frequeny, in MHz units, if applicable
  16109. *
  16110. * checksum field
  16111. * - CHECK_SUM
  16112. * Bits 31:0
  16113. * Purpose: check the payload data, it is just for this fragment.
  16114. * This is intended for the target to check that the channel
  16115. * calibration data returned by the host is the unmodified data
  16116. * that was previously provided to the host by the target.
  16117. * value: checksum of fragment payload
  16118. */
  16119. PREPACK struct htt_chan_caldata_msg {
  16120. /* DWORD 0: message info */
  16121. A_UINT32
  16122. msg_type: 8,
  16123. sub_type: 4 ,
  16124. chksum_valid: 1, /** 1:valid, 0:invalid */
  16125. reserved1: 3,
  16126. frag_idx: 4, /** fragment index for calibration data */
  16127. appending: 1, /** 0: no fragment appending,
  16128. * 1: extra fragment appending */
  16129. reserved2: 11;
  16130. /* DWORD 1: channel and payload size */
  16131. A_UINT32
  16132. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16133. payload_size: 16; /** unit: bytes */
  16134. /* DWORD 2: center frequency */
  16135. A_UINT32
  16136. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16137. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16138. * valid only for 11acvht 80plus80 mode */
  16139. /* DWORD 3: check sum */
  16140. A_UINT32 chksum;
  16141. /* variable length for calibration data */
  16142. A_UINT32 payload[1/* or more */];
  16143. } POSTPACK;
  16144. /* T2H SUBTYPE */
  16145. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16146. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16147. /* H2T SUBTYPE */
  16148. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16149. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16150. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16151. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16152. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16153. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16154. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16155. do { \
  16156. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16157. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16158. } while (0)
  16159. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16160. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16161. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16162. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16163. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16164. do { \
  16165. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16166. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16167. } while (0)
  16168. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16169. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16170. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16171. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16172. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16173. do { \
  16174. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16175. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16176. } while (0)
  16177. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16178. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16179. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16180. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16181. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16182. do { \
  16183. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16184. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16185. } while (0)
  16186. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16187. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16188. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16189. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16190. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16191. do { \
  16192. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16193. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16194. } while (0)
  16195. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16196. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16197. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16198. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16199. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16200. do { \
  16201. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16202. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16203. } while (0)
  16204. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16205. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16206. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16207. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16208. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16209. do { \
  16210. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16211. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16212. } while (0)
  16213. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16214. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16215. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16216. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16217. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16218. do { \
  16219. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16220. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16221. } while (0)
  16222. /**
  16223. * @brief target -> host FSE CMEM based send
  16224. *
  16225. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16226. *
  16227. * @details
  16228. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16229. * FSE placement in CMEM is enabled.
  16230. *
  16231. * This message sends the non-secure CMEM base address.
  16232. * It will be sent to host in response to message
  16233. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16234. * The message would appear as follows:
  16235. *
  16236. * |31 24|23 16|15 8|7 0|
  16237. * |----------------+----------------+----------------+----------------|
  16238. * | reserved | num_entries | msg_type |
  16239. * |----------------+----------------+----------------+----------------|
  16240. * | base_address_lo |
  16241. * |----------------+----------------+----------------+----------------|
  16242. * | base_address_hi |
  16243. * |-------------------------------------------------------------------|
  16244. *
  16245. * The message is interpreted as follows:
  16246. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16247. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16248. * b'8:15 - number_entries: Indicated the number of entries
  16249. * programmed.
  16250. * b'16:31 - reserved.
  16251. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16252. * CMEM base address
  16253. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16254. * CMEM base address
  16255. */
  16256. PREPACK struct htt_cmem_base_send_t {
  16257. A_UINT32 msg_type: 8,
  16258. num_entries: 8,
  16259. reserved: 16;
  16260. A_UINT32 base_address_lo;
  16261. A_UINT32 base_address_hi;
  16262. } POSTPACK;
  16263. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16264. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16265. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16266. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16267. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16268. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16269. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16270. do { \
  16271. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16272. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16273. } while (0)
  16274. /**
  16275. * @brief - HTT PPDU ID format
  16276. *
  16277. * @details
  16278. * The following field definitions describe the format of the PPDU ID.
  16279. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16280. *
  16281. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16282. * +--------------------------------------------------------------------------
  16283. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16284. * +--------------------------------------------------------------------------
  16285. *
  16286. * sch id :Schedule command id
  16287. * Bits [11 : 0] : monotonically increasing counter to track the
  16288. * PPDU posted to a specific transmit queue.
  16289. *
  16290. * hwq_id: Hardware Queue ID.
  16291. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16292. *
  16293. * mac_id: MAC ID
  16294. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16295. *
  16296. * seq_idx: Sequence index.
  16297. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16298. * a particular TXOP.
  16299. *
  16300. * tqm_cmd: HWSCH/TQM flag.
  16301. * Bit [23] : Always set to 0.
  16302. *
  16303. * seq_cmd_type: Sequence command type.
  16304. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16305. * Refer to enum HTT_STATS_FTYPE for values.
  16306. */
  16307. PREPACK struct htt_ppdu_id {
  16308. A_UINT32
  16309. sch_id: 12,
  16310. hwq_id: 5,
  16311. mac_id: 2,
  16312. seq_idx: 2,
  16313. reserved1: 2,
  16314. tqm_cmd: 1,
  16315. seq_cmd_type: 6,
  16316. reserved2: 2;
  16317. } POSTPACK;
  16318. #define HTT_PPDU_ID_SCH_ID_S 0
  16319. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16320. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16321. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16322. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16323. do { \
  16324. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16325. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16326. } while (0)
  16327. #define HTT_PPDU_ID_HWQ_ID_S 12
  16328. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16329. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16330. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16331. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16332. do { \
  16333. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16334. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16335. } while (0)
  16336. #define HTT_PPDU_ID_MAC_ID_S 17
  16337. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16338. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16339. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16340. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16341. do { \
  16342. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16343. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16344. } while (0)
  16345. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16346. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16347. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16348. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16349. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16350. do { \
  16351. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16352. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16353. } while (0)
  16354. #define HTT_PPDU_ID_TQM_CMD_S 23
  16355. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16356. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16357. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16358. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16359. do { \
  16360. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16361. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16362. } while (0)
  16363. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16364. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16365. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16366. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16367. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16368. do { \
  16369. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16370. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16371. } while (0)
  16372. /**
  16373. * @brief target -> RX PEER METADATA V0 format
  16374. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16375. * message from target, and will confirm to the target which peer metadata
  16376. * version to use in the wmi_init message.
  16377. *
  16378. * The following diagram shows the format of the RX PEER METADATA.
  16379. *
  16380. * |31 24|23 16|15 8|7 0|
  16381. * |-----------------------------------------------------------------------|
  16382. * | Reserved | VDEV ID | PEER ID |
  16383. * |-----------------------------------------------------------------------|
  16384. */
  16385. PREPACK struct htt_rx_peer_metadata_v0 {
  16386. A_UINT32
  16387. peer_id: 16,
  16388. vdev_id: 8,
  16389. reserved1: 8;
  16390. } POSTPACK;
  16391. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16392. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16393. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16394. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16395. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16396. do { \
  16397. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16398. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16399. } while (0)
  16400. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16401. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16402. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16403. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16404. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16405. do { \
  16406. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16407. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16408. } while (0)
  16409. /**
  16410. * @brief target -> RX PEER METADATA V1 format
  16411. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16412. * message from target, and will confirm to the target which peer metadata
  16413. * version to use in the wmi_init message.
  16414. *
  16415. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16416. *
  16417. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16418. * |-----------------------------------------------------------------------|
  16419. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16420. * |-----------------------------------------------------------------------|
  16421. */
  16422. PREPACK struct htt_rx_peer_metadata_v1 {
  16423. A_UINT32
  16424. peer_id: 13,
  16425. ml_peer_valid: 1,
  16426. reserved1: 2,
  16427. vdev_id: 8,
  16428. lmac_id: 2,
  16429. chip_id: 3,
  16430. reserved2: 3;
  16431. } POSTPACK;
  16432. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16433. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16434. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16435. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16436. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16437. do { \
  16438. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16439. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16440. } while (0)
  16441. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16442. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16443. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16444. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16445. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16446. do { \
  16447. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16448. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16449. } while (0)
  16450. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16451. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16452. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16453. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16454. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16455. do { \
  16456. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16457. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16458. } while (0)
  16459. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16460. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16461. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16462. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16463. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16464. do { \
  16465. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16466. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16467. } while (0)
  16468. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16469. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16470. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16471. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16472. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16473. do { \
  16474. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16475. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16476. } while (0)
  16477. /*
  16478. * In some systems, the host SW wants to specify priorities between
  16479. * different MSDU / flow queues within the same peer-TID.
  16480. * The below enums are used for the host to identify to the target
  16481. * which MSDU queue's priority it wants to adjust.
  16482. */
  16483. /*
  16484. * The MSDUQ index describe index of TCL HW, where each index is
  16485. * used for queuing particular types of MSDUs.
  16486. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16487. */
  16488. enum HTT_MSDUQ_INDEX {
  16489. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16490. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16491. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16492. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16493. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16494. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16495. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16496. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16497. HTT_MSDUQ_MAX_INDEX,
  16498. };
  16499. /* MSDU qtype definition */
  16500. enum HTT_MSDU_QTYPE {
  16501. /*
  16502. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16503. * relative priority. Instead, the relative priority of CRIT_0 versus
  16504. * CRIT_1 is controlled by the FW, through the configuration parameters
  16505. * it applies to the queues.
  16506. */
  16507. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16508. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16509. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16510. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16511. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16512. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16513. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16514. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16515. /* New MSDU_QTYPE should be added above this line */
  16516. /*
  16517. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16518. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16519. * any host/target message definitions. The QTYPE_MAX value can
  16520. * only be used internally within the host or within the target.
  16521. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16522. * it must regard the unexpected value as a default qtype value,
  16523. * or ignore it.
  16524. */
  16525. HTT_MSDU_QTYPE_MAX,
  16526. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16527. };
  16528. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16529. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16530. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16531. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16532. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16533. };
  16534. /**
  16535. * @brief target -> host mlo timestamp offset indication
  16536. *
  16537. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16538. *
  16539. * @details
  16540. * The following field definitions describe the format of the HTT target
  16541. * to host mlo timestamp offset indication message.
  16542. *
  16543. *
  16544. * |31 16|15 12|11 10|9 8|7 0 |
  16545. * |----------------------------------------------------------------------|
  16546. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16547. * |----------------------------------------------------------------------|
  16548. * | Sync time stamp lo in us |
  16549. * |----------------------------------------------------------------------|
  16550. * | Sync time stamp hi in us |
  16551. * |----------------------------------------------------------------------|
  16552. * | mlo time stamp offset lo in us |
  16553. * |----------------------------------------------------------------------|
  16554. * | mlo time stamp offset hi in us |
  16555. * |----------------------------------------------------------------------|
  16556. * | mlo time stamp offset clocks in clock ticks |
  16557. * |----------------------------------------------------------------------|
  16558. * |31 26|25 16|15 0 |
  16559. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16560. * | | compensation in clks | |
  16561. * |----------------------------------------------------------------------|
  16562. * |31 22|21 0 |
  16563. * | rsvd 3 | mlo time stamp comp timer period |
  16564. * |----------------------------------------------------------------------|
  16565. * The message is interpreted as follows:
  16566. *
  16567. * dword0 - b'0:7 - msg_type: This will be set to
  16568. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16569. * value: 0x28
  16570. *
  16571. * dword0 - b'9:8 - pdev_id
  16572. *
  16573. * dword0 - b'11:10 - chip_id
  16574. *
  16575. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16576. *
  16577. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16578. *
  16579. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16580. * which last sync interrupt was received
  16581. *
  16582. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16583. * which last sync interrupt was received
  16584. *
  16585. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16586. *
  16587. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16588. *
  16589. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16590. *
  16591. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16592. *
  16593. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16594. * for sub us resolution
  16595. *
  16596. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16597. *
  16598. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16599. * is applied, in us
  16600. *
  16601. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16602. */
  16603. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16604. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16605. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16606. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16607. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16608. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16609. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16610. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16611. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16612. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16613. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16614. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16615. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16616. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16617. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16618. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16619. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16620. do { \
  16621. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16622. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16623. } while (0)
  16624. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16625. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16626. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16627. do { \
  16628. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16629. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16630. } while (0)
  16631. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16632. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16633. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16634. do { \
  16635. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16636. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16637. } while (0)
  16638. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16639. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16640. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16641. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16642. do { \
  16643. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16644. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16645. } while (0)
  16646. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16647. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16648. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16649. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16650. do { \
  16651. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16652. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16653. } while (0)
  16654. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16655. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16656. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16657. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16658. do { \
  16659. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16660. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16661. } while (0)
  16662. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16663. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16664. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16665. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16666. do { \
  16667. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16668. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16669. } while (0)
  16670. typedef struct {
  16671. A_UINT32 msg_type: 8, /* bits 7:0 */
  16672. pdev_id: 2, /* bits 9:8 */
  16673. chip_id: 2, /* bits 11:10 */
  16674. reserved1: 4, /* bits 15:12 */
  16675. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16676. A_UINT32 sync_timestamp_lo_us;
  16677. A_UINT32 sync_timestamp_hi_us;
  16678. A_UINT32 mlo_timestamp_offset_lo_us;
  16679. A_UINT32 mlo_timestamp_offset_hi_us;
  16680. A_UINT32 mlo_timestamp_offset_clks;
  16681. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16682. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16683. reserved2: 6; /* bits 31:26 */
  16684. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16685. reserved3: 10; /* bits 31:22 */
  16686. } htt_t2h_mlo_offset_ind_t;
  16687. /*
  16688. * @brief target -> host VDEV TX RX STATS
  16689. *
  16690. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16691. *
  16692. * @details
  16693. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16694. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16695. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16696. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16697. * periodically by target even in the absence of any further HTT request
  16698. * messages from host.
  16699. *
  16700. * The message is formatted as follows:
  16701. *
  16702. * |31 16|15 8|7 0|
  16703. * |---------------------------------+----------------+----------------|
  16704. * | payload_size | pdev_id | msg_type |
  16705. * |---------------------------------+----------------+----------------|
  16706. * | reserved0 |
  16707. * |-------------------------------------------------------------------|
  16708. * | reserved1 |
  16709. * |-------------------------------------------------------------------|
  16710. * | reserved2 |
  16711. * |-------------------------------------------------------------------|
  16712. * | |
  16713. * | VDEV specific Tx Rx stats info |
  16714. * | |
  16715. * |-------------------------------------------------------------------|
  16716. *
  16717. * The message is interpreted as follows:
  16718. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16719. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16720. * b'8:15 - pdev_id
  16721. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16722. * message header fields (msg_type through reserved2)
  16723. * dword1 - b'0:31 - reserved0.
  16724. * dword2 - b'0:31 - reserved1.
  16725. * dword3 - b'0:31 - reserved2.
  16726. */
  16727. typedef struct {
  16728. A_UINT32 msg_type: 8,
  16729. pdev_id: 8,
  16730. payload_size: 16;
  16731. A_UINT32 reserved0;
  16732. A_UINT32 reserved1;
  16733. A_UINT32 reserved2;
  16734. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16735. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16736. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16737. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16738. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16739. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16740. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16741. do { \
  16742. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16743. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16744. } while (0)
  16745. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16746. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16747. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16748. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16749. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16750. do { \
  16751. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16752. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16753. } while (0)
  16754. /* SOC related stats */
  16755. typedef struct {
  16756. htt_tlv_hdr_t tlv_hdr;
  16757. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16758. * This can be due to either the peer is deleted or deletion is ongoing
  16759. * */
  16760. A_UINT32 inv_peers_msdu_drop_count_lo;
  16761. A_UINT32 inv_peers_msdu_drop_count_hi;
  16762. } htt_t2h_soc_txrx_stats_common_tlv;
  16763. /* VDEV HW Tx/Rx stats */
  16764. typedef struct {
  16765. htt_tlv_hdr_t tlv_hdr;
  16766. A_UINT32 vdev_id;
  16767. /* Rx msdu byte cnt */
  16768. A_UINT32 rx_msdu_byte_cnt_lo;
  16769. A_UINT32 rx_msdu_byte_cnt_hi;
  16770. /* Rx msdu cnt */
  16771. A_UINT32 rx_msdu_cnt_lo;
  16772. A_UINT32 rx_msdu_cnt_hi;
  16773. /* tx msdu byte cnt */
  16774. A_UINT32 tx_msdu_byte_cnt_lo;
  16775. A_UINT32 tx_msdu_byte_cnt_hi;
  16776. /* tx msdu cnt */
  16777. A_UINT32 tx_msdu_cnt_lo;
  16778. A_UINT32 tx_msdu_cnt_hi;
  16779. /* tx excessive retry discarded msdu cnt */
  16780. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16781. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16782. /* TX congestion ctrl msdu drop cnt */
  16783. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16784. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16785. /* discarded tx msdus cnt coz of time to live expiry */
  16786. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16787. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16788. /* tx excessive retry discarded msdu byte cnt */
  16789. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16790. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16791. /* TX congestion ctrl msdu drop byte cnt */
  16792. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16793. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16794. /* discarded tx msdus byte cnt coz of time to live expiry */
  16795. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16796. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16797. /* TQM bypass frame cnt */
  16798. A_UINT32 tqm_bypass_frame_cnt_lo;
  16799. A_UINT32 tqm_bypass_frame_cnt_hi;
  16800. /* TQM bypass byte cnt */
  16801. A_UINT32 tqm_bypass_byte_cnt_lo;
  16802. A_UINT32 tqm_bypass_byte_cnt_hi;
  16803. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16804. /*
  16805. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16806. *
  16807. * @details
  16808. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16809. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16810. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16811. * the default MSDU queues of each of the specified TIDs for the peer
  16812. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16813. * If the default MSDU queues of a given TID within the peer are not linked
  16814. * to a service class, the svc_class_id field for that TID will have a
  16815. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16816. * queues for that TID are not mapped to any service class.
  16817. *
  16818. * |31 16|15 8|7 0|
  16819. * |------------------------------+--------------+--------------|
  16820. * | peer ID | reserved | msg type |
  16821. * |------------------------------+--------------+------+-------|
  16822. * | reserved | svc class ID | TID |
  16823. * |------------------------------------------------------------|
  16824. * ...
  16825. * |------------------------------------------------------------|
  16826. * | reserved | svc class ID | TID |
  16827. * |------------------------------------------------------------|
  16828. * Header fields:
  16829. * dword0 - b'7:0 - msg_type: This will be set to
  16830. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16831. * b'31:16 - peer ID
  16832. * dword1 - b'7:0 - TID
  16833. * b'15:8 - svc class ID
  16834. * (dword2, etc. same format as dword1)
  16835. */
  16836. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16837. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16838. A_UINT32 msg_type :8,
  16839. reserved0 :8,
  16840. peer_id :16;
  16841. struct {
  16842. A_UINT32 tid :8,
  16843. svc_class_id :8,
  16844. reserved1 :16;
  16845. } tid_reports[1/*or more*/];
  16846. } POSTPACK;
  16847. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16848. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16849. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16850. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16851. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16852. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16853. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16854. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16855. do { \
  16856. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16857. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16858. } while (0)
  16859. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16860. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16861. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16862. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16863. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16864. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16865. do { \
  16866. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16867. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16868. } while (0)
  16869. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16870. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16871. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16872. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16873. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16874. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16875. do { \
  16876. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16877. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16878. } while (0)
  16879. /*
  16880. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16881. *
  16882. * @details
  16883. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16884. * flow if the flow is seen the associated service class is conveyed to the
  16885. * target via TCL Data Command. Target on the other hand internally creates the
  16886. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16887. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16888. * the newly created MSDUQ
  16889. *
  16890. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16891. * |------------------------------+------------------------+--------------|
  16892. * | peer ID | HTT qtype | msg type |
  16893. * |---------------------------------+--------------+--+---+-------+------|
  16894. * | reserved |AST list index|FO|WC | HLOS | remap|
  16895. * | | | | | TID | TID |
  16896. * |---------------------+------------------------------------------------|
  16897. * | reserved1 | tgt_opaque_id |
  16898. * |---------------------+------------------------------------------------|
  16899. *
  16900. * Header fields:
  16901. *
  16902. * dword0 - b'7:0 - msg_type: This will be set to
  16903. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16904. * b'15:8 - HTT qtype
  16905. * b'31:16 - peer ID
  16906. *
  16907. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16908. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16909. * hlos_tid : Common to Lithium and Beryllium
  16910. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16911. * TCL Data Command : Beryllium
  16912. * b10 - flow_override (FO), as sent by host in
  16913. * TCL Data Command: Beryllium
  16914. * b11:14 - ast_list_idx
  16915. * Array index into the list of extension AST entries
  16916. * (not the actual AST 16-bit index).
  16917. * The ast_list_idx is one-based, with the following
  16918. * range of values:
  16919. * - legacy targets supporting 16 user-defined
  16920. * MSDU queues: 1-2
  16921. * - legacy targets supporting 48 user-defined
  16922. * MSDU queues: 1-6
  16923. * - new targets: 0 (peer_id is used instead)
  16924. * Note that since ast_list_idx is one-based,
  16925. * the host will need to subtract 1 to use it as an
  16926. * index into a list of extension AST entries.
  16927. * b15:31 - reserved
  16928. *
  16929. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16930. * unique MSDUQ id in firmware
  16931. * b'24:31 - reserved1
  16932. */
  16933. PREPACK struct htt_t2h_sawf_msduq_event {
  16934. A_UINT32 msg_type : 8,
  16935. htt_qtype : 8,
  16936. peer_id :16;
  16937. A_UINT32 remap_tid : 4,
  16938. hlos_tid : 4,
  16939. who_classify_info_sel : 2,
  16940. flow_override : 1,
  16941. ast_list_idx : 4,
  16942. reserved :17;
  16943. A_UINT32 tgt_opaque_id :24,
  16944. reserved1 : 8;
  16945. } POSTPACK;
  16946. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16947. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16948. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16949. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16950. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16951. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16952. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16953. do { \
  16954. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16955. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16956. } while (0)
  16957. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16958. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16959. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16960. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16961. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16962. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16963. do { \
  16964. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16965. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16966. } while (0)
  16967. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16968. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16969. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16970. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16971. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16972. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16973. do { \
  16974. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16975. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16976. } while (0)
  16977. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16978. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16979. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16980. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16981. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16982. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16983. do { \
  16984. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16985. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16986. } while (0)
  16987. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16988. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16989. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16990. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16991. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16992. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16993. do { \
  16994. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16995. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16996. } while (0)
  16997. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16998. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16999. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17000. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17001. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17002. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17003. do { \
  17004. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17005. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17006. } while (0)
  17007. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17008. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17009. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17010. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17011. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17012. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17013. do { \
  17014. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17015. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17016. } while (0)
  17017. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17018. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17019. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17020. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17021. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17022. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17023. do { \
  17024. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17025. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17026. } while (0)
  17027. /**
  17028. * @brief target -> PPDU id format indication
  17029. *
  17030. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17031. *
  17032. * @details
  17033. * The following field definitions describe the format of the HTT target
  17034. * to host PPDU ID format indication message.
  17035. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17036. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17037. * seq_idx :- Sequence control index of this PPDU.
  17038. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17039. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17040. * tqm_cmd:-
  17041. *
  17042. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17043. * |--------------------------------------------------+------------------------|
  17044. * | rsvd0 | msg type |
  17045. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17046. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17047. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17048. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17049. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17050. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17051. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17052. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17053. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17054. * Where: OF = bit offset, NB = number of bits, V = valid
  17055. * The message is interpreted as follows:
  17056. *
  17057. * dword0 - b'7:0 - msg_type: This will be set to
  17058. * HTT_T2H_PPDU_ID_FMT_IND
  17059. * value: 0x30
  17060. *
  17061. * dword0 - b'31:8 - reserved
  17062. *
  17063. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17064. *
  17065. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17066. *
  17067. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17068. *
  17069. * dword1 - b'15:11 - reserved for future use
  17070. *
  17071. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17072. *
  17073. * dword1 - b'21:17 - number of bits in ring_id
  17074. *
  17075. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17076. *
  17077. * dword1 - b'31:27 - reserved for future use
  17078. *
  17079. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17080. *
  17081. * dword2 - b'5:1 - number of bits in sequence index
  17082. *
  17083. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17084. *
  17085. * dword2 - b'15:11 - reserved for future use
  17086. *
  17087. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17088. *
  17089. * dword2 - b'21:17 - number of bits in link_id
  17090. *
  17091. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17092. *
  17093. * dword2 - b'31:27 - reserved for future use
  17094. *
  17095. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17096. *
  17097. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17098. *
  17099. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17100. *
  17101. * dword3 - b'15:11 - reserved for future use
  17102. *
  17103. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17104. *
  17105. * dword3 - b'21:17 - number of bits in tqm_cmd
  17106. *
  17107. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17108. *
  17109. * dword3 - b'31:27 - reserved for future use
  17110. *
  17111. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17112. *
  17113. * dword4 - b'5:1 - number of bits in mac_id
  17114. *
  17115. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17116. *
  17117. * dword4 - b'15:11 - reserved for future use
  17118. *
  17119. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17120. *
  17121. * dword4 - b'21:17 - number of bits in crc
  17122. *
  17123. * dword4 - b'26:22 - offset of crc (in number of bits)
  17124. *
  17125. * dword4 - b'31:27 - reserved for future use
  17126. *
  17127. */
  17128. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17129. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17130. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17131. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17132. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17133. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17134. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17135. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17136. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17137. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17138. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17139. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17140. /* macros for accessing lower 16 bits in dword */
  17141. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17142. do { \
  17143. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17144. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17145. } while (0)
  17146. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17147. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17148. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17149. do { \
  17150. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17151. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17152. } while (0)
  17153. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17154. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17155. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17156. do { \
  17157. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17158. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17159. } while (0)
  17160. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17161. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17162. /* macros for accessing upper 16 bits in dword */
  17163. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17164. do { \
  17165. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17166. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17167. } while (0)
  17168. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17169. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17170. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17171. do { \
  17172. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17173. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17174. } while (0)
  17175. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17176. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17177. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17178. do { \
  17179. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17180. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17181. } while (0)
  17182. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17183. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17184. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17185. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17186. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17187. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17188. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17189. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17190. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17191. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17192. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17193. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17194. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17195. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17196. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17197. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17198. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17199. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17200. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17201. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17202. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17203. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17204. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17205. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17206. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17207. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17208. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17209. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17210. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17211. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17212. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17213. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17214. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17215. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17216. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17217. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17218. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17219. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17220. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17221. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17222. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17223. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17224. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17225. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17226. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17227. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17228. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17229. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17230. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17231. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17232. /* offsets in number dwords */
  17233. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17234. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17235. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17236. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17237. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17238. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17239. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17240. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17241. typedef struct {
  17242. A_UINT32 msg_type: 8, /* bits 7:0 */
  17243. rsvd0: 24;/* bits 31:8 */
  17244. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17245. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17246. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17247. rsvd1: 5, /* bits 15:11 */
  17248. ring_id_valid: 1, /* bits 16:16 */
  17249. ring_id_bits: 5, /* bits 21:17 */
  17250. ring_id_offset: 5, /* bits 26:22 */
  17251. rsvd2: 5; /* bits 31:27 */
  17252. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17253. seq_idx_bits: 5, /* bits 5:1 */
  17254. seq_idx_offset: 5, /* bits 10:6 */
  17255. rsvd3: 5, /* bits 15:11 */
  17256. link_id_valid: 1, /* bits 16:16 */
  17257. link_id_bits: 5, /* bits 21:17 */
  17258. link_id_offset: 5, /* bits 26:22 */
  17259. rsvd4: 5; /* bits 31:27 */
  17260. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17261. seq_cmd_type_bits: 5, /* bits 5:1 */
  17262. seq_cmd_type_offset: 5, /* bits 10:6 */
  17263. rsvd5: 5, /* bits 15:11 */
  17264. tqm_cmd_valid: 1, /* bits 16:16 */
  17265. tqm_cmd_bits: 5, /* bits 21:17 */
  17266. tqm_cmd_offset: 5, /* bits 26:12 */
  17267. rsvd6: 5; /* bits 31:27 */
  17268. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17269. mac_id_bits: 5, /* bits 5:1 */
  17270. mac_id_offset: 5, /* bits 10:6 */
  17271. rsvd8: 5, /* bits 15:11 */
  17272. crc_valid: 1, /* bits 16:16 */
  17273. crc_bits: 5, /* bits 21:17 */
  17274. crc_offset: 5, /* bits 26:12 */
  17275. rsvd9: 5; /* bits 31:27 */
  17276. } htt_t2h_ppdu_id_fmt_ind_t;
  17277. #endif