htt.h 878 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103
  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_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  728. HTT_STATS_MAX_TAG,
  729. } htt_stats_tlv_tag_t;
  730. /* retain deprecated enum name as an alias for the current enum name */
  731. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  732. #define HTT_STATS_TLV_TAG_M 0x00000fff
  733. #define HTT_STATS_TLV_TAG_S 0
  734. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  735. #define HTT_STATS_TLV_LENGTH_S 12
  736. #define HTT_STATS_TLV_TAG_GET(_var) \
  737. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  738. HTT_STATS_TLV_TAG_S)
  739. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  740. do { \
  741. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  742. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  743. } while (0)
  744. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  745. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  746. HTT_STATS_TLV_LENGTH_S)
  747. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  748. do { \
  749. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  750. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  751. } while (0)
  752. /*=== host -> target messages ===============================================*/
  753. enum htt_h2t_msg_type {
  754. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  755. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  756. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  757. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  758. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  759. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  760. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  761. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  762. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  763. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  764. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  765. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  766. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  767. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  768. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  769. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  770. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  771. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  772. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  773. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  774. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  775. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  776. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  777. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  778. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  779. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  780. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  781. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  782. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  783. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  784. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  785. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  786. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  787. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  788. /* keep this last */
  789. HTT_H2T_NUM_MSGS
  790. };
  791. /*
  792. * HTT host to target message type -
  793. * stored in bits 7:0 of the first word of the message
  794. */
  795. #define HTT_H2T_MSG_TYPE_M 0xff
  796. #define HTT_H2T_MSG_TYPE_S 0
  797. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  798. do { \
  799. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  800. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  801. } while (0)
  802. #define HTT_H2T_MSG_TYPE_GET(word) \
  803. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  804. /**
  805. * @brief host -> target version number request message definition
  806. *
  807. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  808. *
  809. *
  810. * |31 24|23 16|15 8|7 0|
  811. * |----------------+----------------+----------------+----------------|
  812. * | reserved | msg type |
  813. * |-------------------------------------------------------------------|
  814. * : option request TLV (optional) |
  815. * :...................................................................:
  816. *
  817. * The VER_REQ message may consist of a single 4-byte word, or may be
  818. * extended with TLVs that specify which HTT options the host is requesting
  819. * from the target.
  820. * The following option TLVs may be appended to the VER_REQ message:
  821. * - HL_SUPPRESS_TX_COMPL_IND
  822. * - HL_MAX_TX_QUEUE_GROUPS
  823. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  824. * may be appended to the VER_REQ message (but only one TLV of each type).
  825. *
  826. * Header fields:
  827. * - MSG_TYPE
  828. * Bits 7:0
  829. * Purpose: identifies this as a version number request message
  830. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  831. */
  832. #define HTT_VER_REQ_BYTES 4
  833. /* TBDXXX: figure out a reasonable number */
  834. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  835. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  836. /**
  837. * @brief HTT tx MSDU descriptor
  838. *
  839. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  840. *
  841. * @details
  842. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  843. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  844. * the target firmware needs for the FW's tx processing, particularly
  845. * for creating the HW msdu descriptor.
  846. * The same HTT tx descriptor is used for HL and LL systems, though
  847. * a few fields within the tx descriptor are used only by LL or
  848. * only by HL.
  849. * The HTT tx descriptor is defined in two manners: by a struct with
  850. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  851. * definitions.
  852. * The target should use the struct def, for simplicitly and clarity,
  853. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  854. * neutral. Specifically, the host shall use the get/set macros built
  855. * around the mask + shift defs.
  856. */
  857. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  858. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  859. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  860. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  861. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  862. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  863. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  864. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  865. #define HTT_TX_VDEV_ID_WORD 0
  866. #define HTT_TX_VDEV_ID_MASK 0x3f
  867. #define HTT_TX_VDEV_ID_SHIFT 16
  868. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  869. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  870. #define HTT_TX_MSDU_LEN_DWORD 1
  871. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  872. /*
  873. * HTT_VAR_PADDR macros
  874. * Allow physical / bus addresses to be either a single 32-bit value,
  875. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  876. */
  877. #define HTT_VAR_PADDR32(var_name) \
  878. A_UINT32 var_name
  879. #define HTT_VAR_PADDR64_LE(var_name) \
  880. struct { \
  881. /* little-endian: lo precedes hi */ \
  882. A_UINT32 lo; \
  883. A_UINT32 hi; \
  884. } var_name
  885. /*
  886. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  887. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  888. * addresses are stored in a XXX-bit field.
  889. * This macro is used to define both htt_tx_msdu_desc32_t and
  890. * htt_tx_msdu_desc64_t structs.
  891. */
  892. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  893. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  894. { \
  895. /* DWORD 0: flags and meta-data */ \
  896. A_UINT32 \
  897. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  898. \
  899. /* pkt_subtype - \
  900. * Detailed specification of the tx frame contents, extending the \
  901. * general specification provided by pkt_type. \
  902. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  903. * pkt_type | pkt_subtype \
  904. * ============================================================== \
  905. * 802.3 | bit 0:3 - Reserved \
  906. * | bit 4: 0x0 - Copy-Engine Classification Results \
  907. * | not appended to the HTT message \
  908. * | 0x1 - Copy-Engine Classification Results \
  909. * | appended to the HTT message in the \
  910. * | format: \
  911. * | [HTT tx desc, frame header, \
  912. * | CE classification results] \
  913. * | The CE classification results begin \
  914. * | at the next 4-byte boundary after \
  915. * | the frame header. \
  916. * ------------+------------------------------------------------- \
  917. * Eth2 | bit 0:3 - Reserved \
  918. * | bit 4: 0x0 - Copy-Engine Classification Results \
  919. * | not appended to the HTT message \
  920. * | 0x1 - Copy-Engine Classification Results \
  921. * | appended to the HTT message. \
  922. * | See the above specification of the \
  923. * | CE classification results location. \
  924. * ------------+------------------------------------------------- \
  925. * native WiFi | bit 0:3 - Reserved \
  926. * | bit 4: 0x0 - Copy-Engine Classification Results \
  927. * | not appended to the HTT message \
  928. * | 0x1 - Copy-Engine Classification Results \
  929. * | appended to the HTT message. \
  930. * | See the above specification of the \
  931. * | CE classification results location. \
  932. * ------------+------------------------------------------------- \
  933. * mgmt | 0x0 - 802.11 MAC header absent \
  934. * | 0x1 - 802.11 MAC header present \
  935. * ------------+------------------------------------------------- \
  936. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  937. * | 0x1 - 802.11 MAC header present \
  938. * | bit 1: 0x0 - allow aggregation \
  939. * | 0x1 - don't allow aggregation \
  940. * | bit 2: 0x0 - perform encryption \
  941. * | 0x1 - don't perform encryption \
  942. * | bit 3: 0x0 - perform tx classification / queuing \
  943. * | 0x1 - don't perform tx classification; \
  944. * | insert the frame into the "misc" \
  945. * | tx queue \
  946. * | bit 4: 0x0 - Copy-Engine Classification Results \
  947. * | not appended to the HTT message \
  948. * | 0x1 - Copy-Engine Classification Results \
  949. * | appended to the HTT message. \
  950. * | See the above specification of the \
  951. * | CE classification results location. \
  952. */ \
  953. pkt_subtype: 5, \
  954. \
  955. /* pkt_type - \
  956. * General specification of the tx frame contents. \
  957. * The htt_pkt_type enum should be used to specify and check the \
  958. * value of this field. \
  959. */ \
  960. pkt_type: 3, \
  961. \
  962. /* vdev_id - \
  963. * ID for the vdev that is sending this tx frame. \
  964. * For certain non-standard packet types, e.g. pkt_type == raw \
  965. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  966. * This field is used primarily for determining where to queue \
  967. * broadcast and multicast frames. \
  968. */ \
  969. vdev_id: 6, \
  970. /* ext_tid - \
  971. * The extended traffic ID. \
  972. * If the TID is unknown, the extended TID is set to \
  973. * HTT_TX_EXT_TID_INVALID. \
  974. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  975. * value of the QoS TID. \
  976. * If the tx frame is non-QoS data, then the extended TID is set to \
  977. * HTT_TX_EXT_TID_NON_QOS. \
  978. * If the tx frame is multicast or broadcast, then the extended TID \
  979. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  980. */ \
  981. ext_tid: 5, \
  982. \
  983. /* postponed - \
  984. * This flag indicates whether the tx frame has been downloaded to \
  985. * the target before but discarded by the target, and now is being \
  986. * downloaded again; or if this is a new frame that is being \
  987. * downloaded for the first time. \
  988. * This flag allows the target to determine the correct order for \
  989. * transmitting new vs. old frames. \
  990. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  991. * This flag only applies to HL systems, since in LL systems, \
  992. * the tx flow control is handled entirely within the target. \
  993. */ \
  994. postponed: 1, \
  995. \
  996. /* extension - \
  997. * This flag indicates whether a HTT tx MSDU extension descriptor \
  998. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  999. * \
  1000. * 0x0 - no extension MSDU descriptor is present \
  1001. * 0x1 - an extension MSDU descriptor immediately follows the \
  1002. * regular MSDU descriptor \
  1003. */ \
  1004. extension: 1, \
  1005. \
  1006. /* cksum_offload - \
  1007. * This flag indicates whether checksum offload is enabled or not \
  1008. * for this frame. Target FW use this flag to turn on HW checksumming \
  1009. * 0x0 - No checksum offload \
  1010. * 0x1 - L3 header checksum only \
  1011. * 0x2 - L4 checksum only \
  1012. * 0x3 - L3 header checksum + L4 checksum \
  1013. */ \
  1014. cksum_offload: 2, \
  1015. \
  1016. /* tx_comp_req - \
  1017. * This flag indicates whether Tx Completion \
  1018. * from fw is required or not. \
  1019. * This flag is only relevant if tx completion is not \
  1020. * universally enabled. \
  1021. * For all LL systems, tx completion is mandatory, \
  1022. * so this flag will be irrelevant. \
  1023. * For HL systems tx completion is optional, but HL systems in which \
  1024. * the bus throughput exceeds the WLAN throughput will \
  1025. * probably want to always use tx completion, and thus \
  1026. * would not check this flag. \
  1027. * This flag is required when tx completions are not used universally, \
  1028. * but are still required for certain tx frames for which \
  1029. * an OTA delivery acknowledgment is needed by the host. \
  1030. * In practice, this would be for HL systems in which the \
  1031. * bus throughput is less than the WLAN throughput. \
  1032. * \
  1033. * 0x0 - Tx Completion Indication from Fw not required \
  1034. * 0x1 - Tx Completion Indication from Fw is required \
  1035. */ \
  1036. tx_compl_req: 1; \
  1037. \
  1038. \
  1039. /* DWORD 1: MSDU length and ID */ \
  1040. A_UINT32 \
  1041. len: 16, /* MSDU length, in bytes */ \
  1042. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1043. * and this id is used to calculate fragmentation \
  1044. * descriptor pointer inside the target based on \
  1045. * the base address, configured inside the target. \
  1046. */ \
  1047. \
  1048. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1049. /* frags_desc_ptr - \
  1050. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1051. * where the tx frame's fragments reside in memory. \
  1052. * This field only applies to LL systems, since in HL systems the \
  1053. * (degenerate single-fragment) fragmentation descriptor is created \
  1054. * within the target. \
  1055. */ \
  1056. _paddr__frags_desc_ptr_; \
  1057. \
  1058. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1059. /* \
  1060. * Peer ID : Target can use this value to know which peer-id packet \
  1061. * destined to. \
  1062. * It's intended to be specified by host in case of NAWDS. \
  1063. */ \
  1064. A_UINT16 peerid; \
  1065. \
  1066. /* \
  1067. * Channel frequency: This identifies the desired channel \
  1068. * frequency (in mhz) for tx frames. This is used by FW to help \
  1069. * determine when it is safe to transmit or drop frames for \
  1070. * off-channel operation. \
  1071. * The default value of zero indicates to FW that the corresponding \
  1072. * VDEV's home channel (if there is one) is the desired channel \
  1073. * frequency. \
  1074. */ \
  1075. A_UINT16 chanfreq; \
  1076. \
  1077. /* Reason reserved is commented is increasing the htt structure size \
  1078. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1079. * A_UINT32 reserved_dword3_bits0_31; \
  1080. */ \
  1081. } POSTPACK
  1082. /* define a htt_tx_msdu_desc32_t type */
  1083. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1084. /* define a htt_tx_msdu_desc64_t type */
  1085. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1086. /*
  1087. * Make htt_tx_msdu_desc_t be an alias for either
  1088. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1089. */
  1090. #if HTT_PADDR64
  1091. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1092. #else
  1093. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1094. #endif
  1095. /* decriptor information for Management frame*/
  1096. /*
  1097. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1098. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1099. */
  1100. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1101. extern A_UINT32 mgmt_hdr_len;
  1102. PREPACK struct htt_mgmt_tx_desc_t {
  1103. A_UINT32 msg_type;
  1104. #if HTT_PADDR64
  1105. A_UINT64 frag_paddr; /* DMAble address of the data */
  1106. #else
  1107. A_UINT32 frag_paddr; /* DMAble address of the data */
  1108. #endif
  1109. A_UINT32 desc_id; /* returned to host during completion
  1110. * to free the meory*/
  1111. A_UINT32 len; /* Fragment length */
  1112. A_UINT32 vdev_id; /* virtual device ID*/
  1113. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1114. } POSTPACK;
  1115. PREPACK struct htt_mgmt_tx_compl_ind {
  1116. A_UINT32 desc_id;
  1117. A_UINT32 status;
  1118. } POSTPACK;
  1119. /*
  1120. * This SDU header size comes from the summation of the following:
  1121. * 1. Max of:
  1122. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1123. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1124. * b. 802.11 header, for raw frames: 36 bytes
  1125. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1126. * QoS header, HT header)
  1127. * c. 802.3 header, for ethernet frames: 14 bytes
  1128. * (destination address, source address, ethertype / length)
  1129. * 2. Max of:
  1130. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1131. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1132. * 3. 802.1Q VLAN header: 4 bytes
  1133. * 4. LLC/SNAP header: 8 bytes
  1134. */
  1135. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1136. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1137. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1138. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1139. A_COMPILE_TIME_ASSERT(
  1140. htt_encap_hdr_size_max_check_nwifi,
  1141. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1142. A_COMPILE_TIME_ASSERT(
  1143. htt_encap_hdr_size_max_check_enet,
  1144. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1145. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1146. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1147. #define HTT_TX_HDR_SIZE_802_1Q 4
  1148. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1149. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1150. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1151. HTT_TX_HDR_SIZE_802_1Q + \
  1152. HTT_TX_HDR_SIZE_LLC_SNAP)
  1153. #define HTT_HL_TX_FRM_HDR_LEN \
  1154. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1155. #define HTT_LL_TX_FRM_HDR_LEN \
  1156. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1157. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1158. /* dword 0 */
  1159. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1160. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1161. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1162. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1163. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1164. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1165. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1166. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1167. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1168. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1169. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1170. #define HTT_TX_DESC_PKT_TYPE_S 13
  1171. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1172. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1173. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1174. #define HTT_TX_DESC_VDEV_ID_S 16
  1175. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1176. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1177. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1178. #define HTT_TX_DESC_EXT_TID_S 22
  1179. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1180. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1181. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1182. #define HTT_TX_DESC_POSTPONED_S 27
  1183. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1184. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1185. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1186. #define HTT_TX_DESC_EXTENSION_S 28
  1187. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1188. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1189. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1190. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1191. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1192. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1193. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1194. #define HTT_TX_DESC_TX_COMP_S 31
  1195. /* dword 1 */
  1196. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1197. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1198. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1199. #define HTT_TX_DESC_FRM_LEN_S 0
  1200. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1201. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1202. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1203. #define HTT_TX_DESC_FRM_ID_S 16
  1204. /* dword 2 */
  1205. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1206. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1207. /* for systems using 64-bit format for bus addresses */
  1208. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1209. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1211. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1212. /* for systems using 32-bit format for bus addresses */
  1213. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1214. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1215. /* dword 3 */
  1216. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1217. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1218. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1219. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1220. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1221. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1222. #if HTT_PADDR64
  1223. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1224. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1225. #else
  1226. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1227. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1228. #endif
  1229. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1230. #define HTT_TX_DESC_PEER_ID_S 0
  1231. /*
  1232. * TEMPORARY:
  1233. * The original definitions for the PEER_ID fields contained typos
  1234. * (with _DESC_PADDR appended to this PEER_ID field name).
  1235. * Retain deprecated original names for PEER_ID fields until all code that
  1236. * refers to them has been updated.
  1237. */
  1238. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1239. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1240. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1241. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1242. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1243. HTT_TX_DESC_PEER_ID_M
  1244. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1245. HTT_TX_DESC_PEER_ID_S
  1246. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1247. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1248. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1249. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1250. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1251. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1252. #if HTT_PADDR64
  1253. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1254. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1255. #else
  1256. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1257. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1258. #endif
  1259. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1260. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1261. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1262. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1263. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1264. do { \
  1265. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1266. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1267. } while (0)
  1268. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1269. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1270. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1273. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1274. } while (0)
  1275. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1276. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1277. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1278. do { \
  1279. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1280. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1281. } while (0)
  1282. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1283. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1284. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1285. do { \
  1286. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1287. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1288. } while (0)
  1289. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1290. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1291. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1295. } while (0)
  1296. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1297. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1298. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1302. } while (0)
  1303. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1304. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1305. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1306. do { \
  1307. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1308. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1309. } while (0)
  1310. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1311. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1312. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1316. } while (0)
  1317. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1318. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1319. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1323. } while (0)
  1324. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1325. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1326. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1330. } while (0)
  1331. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1332. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1333. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1337. } while (0)
  1338. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1339. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1340. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1344. } while (0)
  1345. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1346. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1347. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1348. do { \
  1349. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1350. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1351. } while (0)
  1352. /* enums used in the HTT tx MSDU extension descriptor */
  1353. enum {
  1354. htt_tx_guard_interval_regular = 0,
  1355. htt_tx_guard_interval_short = 1,
  1356. };
  1357. enum {
  1358. htt_tx_preamble_type_ofdm = 0,
  1359. htt_tx_preamble_type_cck = 1,
  1360. htt_tx_preamble_type_ht = 2,
  1361. htt_tx_preamble_type_vht = 3,
  1362. };
  1363. enum {
  1364. htt_tx_bandwidth_5MHz = 0,
  1365. htt_tx_bandwidth_10MHz = 1,
  1366. htt_tx_bandwidth_20MHz = 2,
  1367. htt_tx_bandwidth_40MHz = 3,
  1368. htt_tx_bandwidth_80MHz = 4,
  1369. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1370. };
  1371. /**
  1372. * @brief HTT tx MSDU extension descriptor
  1373. * @details
  1374. * If the target supports HTT tx MSDU extension descriptors, the host has
  1375. * the option of appending the following struct following the regular
  1376. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1377. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1378. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1379. * tx specs for each frame.
  1380. */
  1381. PREPACK struct htt_tx_msdu_desc_ext_t {
  1382. /* DWORD 0: flags */
  1383. A_UINT32
  1384. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1385. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1386. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1387. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1388. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1389. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1390. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1391. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1392. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1393. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1394. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1395. /* DWORD 1: tx power, tx rate, tx BW */
  1396. A_UINT32
  1397. /* pwr -
  1398. * Specify what power the tx frame needs to be transmitted at.
  1399. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1400. * The value needs to be appropriately sign-extended when extracting
  1401. * the value from the message and storing it in a variable that is
  1402. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1403. * automatically handles this sign-extension.)
  1404. * If the transmission uses multiple tx chains, this power spec is
  1405. * the total transmit power, assuming incoherent combination of
  1406. * per-chain power to produce the total power.
  1407. */
  1408. pwr: 8,
  1409. /* mcs_mask -
  1410. * Specify the allowable values for MCS index (modulation and coding)
  1411. * to use for transmitting the frame.
  1412. *
  1413. * For HT / VHT preamble types, this mask directly corresponds to
  1414. * the HT or VHT MCS indices that are allowed. For each bit N set
  1415. * within the mask, MCS index N is allowed for transmitting the frame.
  1416. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1417. * rates versus OFDM rates, so the host has the option of specifying
  1418. * that the target must transmit the frame with CCK or OFDM rates
  1419. * (not HT or VHT), but leaving the decision to the target whether
  1420. * to use CCK or OFDM.
  1421. *
  1422. * For CCK and OFDM, the bits within this mask are interpreted as
  1423. * follows:
  1424. * bit 0 -> CCK 1 Mbps rate is allowed
  1425. * bit 1 -> CCK 2 Mbps rate is allowed
  1426. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1427. * bit 3 -> CCK 11 Mbps rate is allowed
  1428. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1429. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1430. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1431. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1432. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1433. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1434. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1435. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1436. *
  1437. * The MCS index specification needs to be compatible with the
  1438. * bandwidth mask specification. For example, a MCS index == 9
  1439. * specification is inconsistent with a preamble type == VHT,
  1440. * Nss == 1, and channel bandwidth == 20 MHz.
  1441. *
  1442. * Furthermore, the host has only a limited ability to specify to
  1443. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1444. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1445. */
  1446. mcs_mask: 12,
  1447. /* nss_mask -
  1448. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1449. * Each bit in this mask corresponds to a Nss value:
  1450. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1451. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1452. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1453. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1454. * The values in the Nss mask must be suitable for the recipient, e.g.
  1455. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1456. * recipient which only supports 2x2 MIMO.
  1457. */
  1458. nss_mask: 4,
  1459. /* guard_interval -
  1460. * Specify a htt_tx_guard_interval enum value to indicate whether
  1461. * the transmission should use a regular guard interval or a
  1462. * short guard interval.
  1463. */
  1464. guard_interval: 1,
  1465. /* preamble_type_mask -
  1466. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1467. * may choose from for transmitting this frame.
  1468. * The bits in this mask correspond to the values in the
  1469. * htt_tx_preamble_type enum. For example, to allow the target
  1470. * to transmit the frame as either CCK or OFDM, this field would
  1471. * be set to
  1472. * (1 << htt_tx_preamble_type_ofdm) |
  1473. * (1 << htt_tx_preamble_type_cck)
  1474. */
  1475. preamble_type_mask: 4,
  1476. reserved1_31_29: 3; /* unused, set to 0x0 */
  1477. /* DWORD 2: tx chain mask, tx retries */
  1478. A_UINT32
  1479. /* chain_mask - specify which chains to transmit from */
  1480. chain_mask: 4,
  1481. /* retry_limit -
  1482. * Specify the maximum number of transmissions, including the
  1483. * initial transmission, to attempt before giving up if no ack
  1484. * is received.
  1485. * If the tx rate is specified, then all retries shall use the
  1486. * same rate as the initial transmission.
  1487. * If no tx rate is specified, the target can choose whether to
  1488. * retain the original rate during the retransmissions, or to
  1489. * fall back to a more robust rate.
  1490. */
  1491. retry_limit: 4,
  1492. /* bandwidth_mask -
  1493. * Specify what channel widths may be used for the transmission.
  1494. * A value of zero indicates "don't care" - the target may choose
  1495. * the transmission bandwidth.
  1496. * The bits within this mask correspond to the htt_tx_bandwidth
  1497. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1498. * The bandwidth_mask must be consistent with the preamble_type_mask
  1499. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1500. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1501. */
  1502. bandwidth_mask: 6,
  1503. reserved2_31_14: 18; /* unused, set to 0x0 */
  1504. /* DWORD 3: tx expiry time (TSF) LSBs */
  1505. A_UINT32 expire_tsf_lo;
  1506. /* DWORD 4: tx expiry time (TSF) MSBs */
  1507. A_UINT32 expire_tsf_hi;
  1508. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1509. } POSTPACK;
  1510. /* DWORD 0 */
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1531. /* DWORD 1 */
  1532. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1533. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1534. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1535. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1536. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1537. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1538. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1539. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1540. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1541. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1542. /* DWORD 2 */
  1543. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1544. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1545. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1546. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1547. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1548. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1549. /* DWORD 0 */
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1551. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1552. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1554. do { \
  1555. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1556. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1557. } while (0)
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1559. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1560. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1562. do { \
  1563. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1564. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1565. } while (0)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1567. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1568. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1570. do { \
  1571. HTT_CHECK_SET_VAL( \
  1572. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1573. ((_var) |= ((_val) \
  1574. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1575. } while (0)
  1576. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1577. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1578. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1580. do { \
  1581. HTT_CHECK_SET_VAL( \
  1582. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1583. ((_var) |= ((_val) \
  1584. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1585. } while (0)
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1588. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1589. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1590. do { \
  1591. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1592. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1596. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1600. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1601. } while (0)
  1602. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1604. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1605. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1608. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1609. } while (0)
  1610. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1611. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1612. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1613. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1614. do { \
  1615. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1616. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1617. } while (0)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1619. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1620. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1621. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1622. do { \
  1623. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1624. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1625. } while (0)
  1626. /* DWORD 1 */
  1627. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1629. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1630. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1631. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1632. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1633. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1634. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1635. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1636. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1638. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1639. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1654. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1655. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1662. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1663. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1667. } while (0)
  1668. /* DWORD 2 */
  1669. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1671. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1672. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1679. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1680. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1687. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1688. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1692. } while (0)
  1693. typedef enum {
  1694. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1695. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1696. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1697. } htt_11ax_ltf_subtype_t;
  1698. typedef enum {
  1699. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1700. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1701. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1702. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1703. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1704. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1705. } htt_tx_ext2_preamble_type_t;
  1706. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1707. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1708. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1709. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1718. /**
  1719. * @brief HTT tx MSDU extension descriptor v2
  1720. * @details
  1721. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1722. * is received as tcl_exit_base->host_meta_info in firmware.
  1723. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1724. * are already part of tcl_exit_base.
  1725. */
  1726. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1727. /* DWORD 0: flags */
  1728. A_UINT32
  1729. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1730. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1731. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1732. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1733. valid_retries : 1, /* if set, tx retries spec is valid */
  1734. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1735. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1736. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1737. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1738. valid_key_flags : 1, /* if set, key flags is valid */
  1739. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1740. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1741. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1742. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1743. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1744. 1 = ENCRYPT,
  1745. 2 ~ 3 - Reserved */
  1746. /* retry_limit -
  1747. * Specify the maximum number of transmissions, including the
  1748. * initial transmission, to attempt before giving up if no ack
  1749. * is received.
  1750. * If the tx rate is specified, then all retries shall use the
  1751. * same rate as the initial transmission.
  1752. * If no tx rate is specified, the target can choose whether to
  1753. * retain the original rate during the retransmissions, or to
  1754. * fall back to a more robust rate.
  1755. */
  1756. retry_limit : 4,
  1757. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1758. * Valid only for 11ax preamble types HE_SU
  1759. * and HE_EXT_SU
  1760. */
  1761. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1762. * Valid only for 11ax preamble types HE_SU
  1763. * and HE_EXT_SU
  1764. */
  1765. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1766. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1767. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1768. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1769. */
  1770. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1771. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1772. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1773. * Use cases:
  1774. * Any time firmware uses TQM-BYPASS for Data
  1775. * TID, firmware expect host to set this bit.
  1776. */
  1777. /* DWORD 1: tx power, tx rate */
  1778. A_UINT32
  1779. power : 8, /* unit of the power field is 0.5 dbm
  1780. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1781. * signed value ranging from -64dbm to 63.5 dbm
  1782. */
  1783. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1784. * Setting more than one MCS isn't currently
  1785. * supported by the target (but is supported
  1786. * in the interface in case in the future
  1787. * the target supports specifications of
  1788. * a limited set of MCS values.
  1789. */
  1790. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1791. * Setting more than one Nss isn't currently
  1792. * supported by the target (but is supported
  1793. * in the interface in case in the future
  1794. * the target supports specifications of
  1795. * a limited set of Nss values.
  1796. */
  1797. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1798. update_peer_cache : 1; /* When set these custom values will be
  1799. * used for all packets, until the next
  1800. * update via this ext header.
  1801. * This is to make sure not all packets
  1802. * need to include this header.
  1803. */
  1804. /* DWORD 2: tx chain mask, tx retries */
  1805. A_UINT32
  1806. /* chain_mask - specify which chains to transmit from */
  1807. chain_mask : 8,
  1808. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1809. * TODO: Update Enum values for key_flags
  1810. */
  1811. /*
  1812. * Channel frequency: This identifies the desired channel
  1813. * frequency (in MHz) for tx frames. This is used by FW to help
  1814. * determine when it is safe to transmit or drop frames for
  1815. * off-channel operation.
  1816. * The default value of zero indicates to FW that the corresponding
  1817. * VDEV's home channel (if there is one) is the desired channel
  1818. * frequency.
  1819. */
  1820. chanfreq : 16;
  1821. /* DWORD 3: tx expiry time (TSF) LSBs */
  1822. A_UINT32 expire_tsf_lo;
  1823. /* DWORD 4: tx expiry time (TSF) MSBs */
  1824. A_UINT32 expire_tsf_hi;
  1825. /* DWORD 5: flags to control routing / processing of the MSDU */
  1826. A_UINT32
  1827. /* learning_frame
  1828. * When this flag is set, this frame will be dropped by FW
  1829. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1830. */
  1831. learning_frame : 1,
  1832. /* send_as_standalone
  1833. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1834. * i.e. with no A-MSDU or A-MPDU aggregation.
  1835. * The scope is extended to other use-cases.
  1836. */
  1837. send_as_standalone : 1,
  1838. /* is_host_opaque_valid
  1839. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1840. * with valid information.
  1841. */
  1842. is_host_opaque_valid : 1,
  1843. traffic_end_indication: 1,
  1844. rsvd0 : 28;
  1845. /* DWORD 6 : Host opaque cookie for special frames */
  1846. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1847. rsvd1 : 16;
  1848. /*
  1849. * This structure can be expanded further up to 40 bytes
  1850. * by adding further DWORDs as needed.
  1851. */
  1852. } POSTPACK;
  1853. /* DWORD 0 */
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1880. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1881. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1882. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1883. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1884. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1885. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1886. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1887. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1888. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1889. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1890. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1891. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1892. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1893. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1894. /* DWORD 1 */
  1895. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1896. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1897. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1898. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1899. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1900. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1901. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1902. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1903. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1904. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1905. /* DWORD 2 */
  1906. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1907. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1908. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1909. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1910. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1911. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1912. /* DWORD 5 */
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1919. /* DWORD 6 */
  1920. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1921. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1922. /* DWORD 0 */
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1924. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1925. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1927. do { \
  1928. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1929. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1930. } while (0)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1932. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1935. do { \
  1936. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1937. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1938. } while (0)
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1940. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1941. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1943. do { \
  1944. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1945. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1946. } while (0)
  1947. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1948. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1949. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1951. do { \
  1952. HTT_CHECK_SET_VAL( \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1954. ((_var) |= ((_val) \
  1955. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL( \
  1979. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1980. ((_var) |= ((_val) \
  1981. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1982. } while (0)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1984. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1985. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1986. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1990. } while (0)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1998. } while (0)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2025. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2026. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2030. } while (0)
  2031. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2032. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2033. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2034. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2038. } while (0)
  2039. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2040. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2041. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2042. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2043. do { \
  2044. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2045. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2046. } while (0)
  2047. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2048. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2049. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2050. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2051. do { \
  2052. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2053. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2054. } while (0)
  2055. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2056. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2057. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2058. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2059. do { \
  2060. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2061. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2062. } while (0)
  2063. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2064. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2065. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2066. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2070. } while (0)
  2071. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2072. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2073. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2074. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2078. } while (0)
  2079. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2081. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2082. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2086. } while (0)
  2087. /* DWORD 1 */
  2088. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2089. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2090. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2091. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2092. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2093. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2094. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2095. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2096. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2097. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2098. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2099. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2100. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2104. } while (0)
  2105. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2106. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2107. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2108. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2112. } while (0)
  2113. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2114. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2115. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2116. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2117. do { \
  2118. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2119. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2120. } while (0)
  2121. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2122. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2123. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2124. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2128. } while (0)
  2129. /* DWORD 2 */
  2130. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2131. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2132. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2133. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2134. do { \
  2135. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2136. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2137. } while (0)
  2138. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2139. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2140. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2141. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2142. do { \
  2143. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2144. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2145. } while (0)
  2146. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2147. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2148. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2149. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2150. do { \
  2151. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2152. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2153. } while (0)
  2154. /* DWORD 5 */
  2155. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2156. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2157. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2158. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2162. } while (0)
  2163. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2164. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2165. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2166. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2170. } while (0)
  2171. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2172. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2173. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2174. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2178. } while (0)
  2179. /* DWORD 6 */
  2180. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2181. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2182. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2183. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2187. } while (0)
  2188. typedef enum {
  2189. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2190. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2191. } htt_tcl_metadata_type;
  2192. /**
  2193. * @brief HTT TCL command number format
  2194. * @details
  2195. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2196. * available to firmware as tcl_exit_base->tcl_status_number.
  2197. * For regular / multicast packets host will send vdev and mac id and for
  2198. * NAWDS packets, host will send peer id.
  2199. * A_UINT32 is used to avoid endianness conversion problems.
  2200. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2201. */
  2202. typedef struct {
  2203. A_UINT32
  2204. type: 1, /* vdev_id based or peer_id based */
  2205. rsvd: 31;
  2206. } htt_tx_tcl_vdev_or_peer_t;
  2207. typedef struct {
  2208. A_UINT32
  2209. type: 1, /* vdev_id based or peer_id based */
  2210. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2211. vdev_id: 8,
  2212. pdev_id: 2,
  2213. host_inspected:1,
  2214. rsvd: 19;
  2215. } htt_tx_tcl_vdev_metadata;
  2216. typedef struct {
  2217. A_UINT32
  2218. type: 1, /* vdev_id based or peer_id based */
  2219. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2220. peer_id: 14,
  2221. rsvd: 16;
  2222. } htt_tx_tcl_peer_metadata;
  2223. PREPACK struct htt_tx_tcl_metadata {
  2224. union {
  2225. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2226. htt_tx_tcl_vdev_metadata vdev_meta;
  2227. htt_tx_tcl_peer_metadata peer_meta;
  2228. };
  2229. } POSTPACK;
  2230. /* DWORD 0 */
  2231. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2232. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2233. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2234. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2235. /* VDEV metadata */
  2236. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2237. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2238. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2239. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2240. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2241. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2242. /* PEER metadata */
  2243. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2244. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2245. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2246. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2247. HTT_TX_TCL_METADATA_TYPE_S)
  2248. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2249. do { \
  2250. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2251. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2252. } while (0)
  2253. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2254. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2255. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2256. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2257. do { \
  2258. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2259. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2260. } while (0)
  2261. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2262. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2263. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2264. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2265. do { \
  2266. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2267. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2268. } while (0)
  2269. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2270. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2271. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2272. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2276. } while (0)
  2277. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2278. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2279. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2280. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2284. } while (0)
  2285. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2286. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2287. HTT_TX_TCL_METADATA_PEER_ID_S)
  2288. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2289. do { \
  2290. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2291. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2292. } while (0)
  2293. /*------------------------------------------------------------------
  2294. * V2 Version of TCL Data Command
  2295. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2296. * MLO global_seq all flavours of TCL Data Cmd.
  2297. *-----------------------------------------------------------------*/
  2298. typedef enum {
  2299. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2300. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2301. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2302. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2303. } htt_tcl_metadata_type_v2;
  2304. /**
  2305. * @brief HTT TCL command number format
  2306. * @details
  2307. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2308. * available to firmware as tcl_exit_base->tcl_status_number.
  2309. * A_UINT32 is used to avoid endianness conversion problems.
  2310. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2311. */
  2312. typedef struct {
  2313. A_UINT32
  2314. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2315. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2316. vdev_id: 8,
  2317. pdev_id: 2,
  2318. host_inspected:1,
  2319. rsvd: 2,
  2320. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2321. } htt_tx_tcl_vdev_metadata_v2;
  2322. typedef struct {
  2323. A_UINT32
  2324. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2325. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2326. peer_id: 13,
  2327. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2328. } htt_tx_tcl_peer_metadata_v2;
  2329. typedef struct {
  2330. A_UINT32
  2331. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2332. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2333. svc_class_id: 8,
  2334. rsvd: 5,
  2335. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2336. } htt_tx_tcl_svc_class_id_metadata;
  2337. typedef struct {
  2338. A_UINT32
  2339. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2340. host_inspected: 1,
  2341. global_seq_no: 12,
  2342. rsvd: 1,
  2343. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2344. } htt_tx_tcl_global_seq_metadata;
  2345. PREPACK struct htt_tx_tcl_metadata_v2 {
  2346. union {
  2347. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2348. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2349. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2350. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2351. };
  2352. } POSTPACK;
  2353. /* DWORD 0 */
  2354. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2355. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2356. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2357. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2358. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2359. /* VDEV V2 metadata */
  2360. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2361. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2362. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2363. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2364. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2365. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2366. /* PEER V2 metadata */
  2367. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2368. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2369. /* SVC_CLASS_ID metadata */
  2370. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2371. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2372. /* Global Seq no metadata */
  2373. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2374. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2375. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2376. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2377. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2378. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2379. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2380. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2381. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2382. do { \
  2383. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2384. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2385. } while (0)
  2386. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2387. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2388. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2389. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2390. do { \
  2391. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2392. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2393. } while (0)
  2394. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2395. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2396. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2397. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2398. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2399. do { \
  2400. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2401. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2402. } while (0)
  2403. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2404. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2405. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2406. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2407. do { \
  2408. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2409. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2410. } while (0)
  2411. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2412. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2413. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2414. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2418. } while (0)
  2419. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2420. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2421. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2422. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2423. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2427. } while (0)
  2428. /*----- Get and Set V2 type field in Service Class fields ----*/
  2429. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2430. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2431. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2432. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2433. do { \
  2434. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2435. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2436. } while (0)
  2437. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2438. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2439. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2440. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2441. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2445. } while (0)
  2446. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2447. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2448. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2449. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2453. } while (0)
  2454. /*------------------------------------------------------------------
  2455. * End V2 Version of TCL Data Command
  2456. *-----------------------------------------------------------------*/
  2457. typedef enum {
  2458. HTT_TX_FW2WBM_TX_STATUS_OK,
  2459. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2460. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2461. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2462. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2463. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2464. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2465. HTT_TX_FW2WBM_TX_STATUS_MAX
  2466. } htt_tx_fw2wbm_tx_status_t;
  2467. typedef enum {
  2468. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2469. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2470. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2471. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2472. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2473. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2474. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2475. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2476. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2477. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2478. } htt_tx_fw2wbm_reinject_reason_t;
  2479. /**
  2480. * @brief HTT TX WBM Completion from firmware to host
  2481. * @details
  2482. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2483. * DWORD 3 and 4 for software based completions (Exception frames and
  2484. * TQM bypass frames)
  2485. * For software based completions, wbm_release_ring->release_source_module will
  2486. * be set to release_source_fw
  2487. */
  2488. PREPACK struct htt_tx_wbm_completion {
  2489. A_UINT32
  2490. sch_cmd_id: 24,
  2491. exception_frame: 1, /* If set, this packet was queued via exception path */
  2492. rsvd0_31_25: 7;
  2493. A_UINT32
  2494. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2495. * reception of an ACK or BA, this field indicates
  2496. * the RSSI of the received ACK or BA frame.
  2497. * When the frame is removed as result of a direct
  2498. * remove command from the SW, this field is set
  2499. * to 0x0 (which is never a valid value when real
  2500. * RSSI is available).
  2501. * Units: dB w.r.t noise floor
  2502. */
  2503. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2504. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2505. rsvd1_31_16: 16;
  2506. } POSTPACK;
  2507. /* DWORD 0 */
  2508. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2509. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2510. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2511. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2512. /* DWORD 1 */
  2513. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2514. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2515. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2516. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2517. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2518. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2519. /* DWORD 0 */
  2520. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2521. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2522. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2523. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2524. do { \
  2525. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2526. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2527. } while (0)
  2528. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2529. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2530. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2531. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2532. do { \
  2533. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2534. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2535. } while (0)
  2536. /* DWORD 1 */
  2537. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2538. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2539. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2540. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2541. do { \
  2542. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2543. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2544. } while (0)
  2545. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2546. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2547. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2548. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2549. do { \
  2550. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2551. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2552. } while (0)
  2553. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2554. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2555. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2556. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2557. do { \
  2558. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2559. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2560. } while (0)
  2561. /**
  2562. * @brief HTT TX WBM Completion from firmware to host
  2563. * @details
  2564. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2565. * (WBM) offload HW.
  2566. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2567. * For software based completions, release_source_module will
  2568. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2569. * struct wbm_release_ring and then switch to this after looking at
  2570. * release_source_module.
  2571. */
  2572. PREPACK struct htt_tx_wbm_completion_v2 {
  2573. A_UINT32
  2574. used_by_hw0; /* Refer to struct wbm_release_ring */
  2575. A_UINT32
  2576. used_by_hw1; /* Refer to struct wbm_release_ring */
  2577. A_UINT32
  2578. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2579. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2580. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2581. exception_frame: 1,
  2582. rsvd0: 12, /* For future use */
  2583. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2584. rsvd1: 1; /* For future use */
  2585. A_UINT32
  2586. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2587. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2588. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2589. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2590. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2591. */
  2592. A_UINT32
  2593. data1: 32;
  2594. A_UINT32
  2595. data2: 32;
  2596. A_UINT32
  2597. used_by_hw3; /* Refer to struct wbm_release_ring */
  2598. } POSTPACK;
  2599. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2600. /* DWORD 3 */
  2601. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2602. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2603. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2604. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2605. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2606. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2607. /* DWORD 3 */
  2608. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2609. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2610. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2611. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2612. do { \
  2613. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2614. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2615. } while (0)
  2616. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2617. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2618. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2619. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2620. do { \
  2621. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2622. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2623. } while (0)
  2624. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2625. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2626. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2627. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2628. do { \
  2629. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2630. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2631. } while (0)
  2632. /**
  2633. * @brief HTT TX WBM Completion from firmware to host (V3)
  2634. * @details
  2635. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2636. * (WBM) offload HW.
  2637. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2638. * For software based completions, release_source_module will
  2639. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2640. * struct wbm_release_ring and then switch to this after looking at
  2641. * release_source_module.
  2642. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2643. * by new generations of targets.
  2644. */
  2645. PREPACK struct htt_tx_wbm_completion_v3 {
  2646. A_UINT32
  2647. used_by_hw0; /* Refer to struct wbm_release_ring */
  2648. A_UINT32
  2649. used_by_hw1; /* Refer to struct wbm_release_ring */
  2650. A_UINT32
  2651. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2652. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2653. used_by_hw3: 15;
  2654. A_UINT32
  2655. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2656. exception_frame: 1,
  2657. rsvd0: 27; /* For future use */
  2658. A_UINT32
  2659. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2660. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2661. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2662. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2663. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2664. */
  2665. A_UINT32
  2666. data1: 32;
  2667. A_UINT32
  2668. data2: 32;
  2669. A_UINT32
  2670. rsvd1: 20,
  2671. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2672. } POSTPACK;
  2673. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2674. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2675. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2676. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2677. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2678. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2679. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2680. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2681. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2682. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2683. do { \
  2684. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2685. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2686. } while (0)
  2687. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2688. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2689. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2690. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2691. do { \
  2692. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2693. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2694. } while (0)
  2695. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2696. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2697. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2698. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2699. do { \
  2700. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2701. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2702. } while (0)
  2703. typedef enum {
  2704. TX_FRAME_TYPE_UNDEFINED = 0,
  2705. TX_FRAME_TYPE_EAPOL = 1,
  2706. } htt_tx_wbm_status_frame_type;
  2707. /**
  2708. * @brief HTT TX WBM transmit status from firmware to host
  2709. * @details
  2710. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2711. * (WBM) offload HW.
  2712. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2713. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2714. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2715. */
  2716. PREPACK struct htt_tx_wbm_transmit_status {
  2717. A_UINT32
  2718. sch_cmd_id: 24,
  2719. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2720. * reception of an ACK or BA, this field indicates
  2721. * the RSSI of the received ACK or BA frame.
  2722. * When the frame is removed as result of a direct
  2723. * remove command from the SW, this field is set
  2724. * to 0x0 (which is never a valid value when real
  2725. * RSSI is available).
  2726. * Units: dB w.r.t noise floor
  2727. */
  2728. A_UINT32
  2729. sw_peer_id: 16,
  2730. tid_num: 5,
  2731. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2732. * and tid_num fields contain valid data.
  2733. * If this "valid" flag is not set, the
  2734. * sw_peer_id and tid_num fields must be ignored.
  2735. */
  2736. mcast: 1,
  2737. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2738. * contains valid data.
  2739. */
  2740. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2741. reserved: 4;
  2742. A_UINT32
  2743. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2744. * packets in the wbm completion path
  2745. */
  2746. } POSTPACK;
  2747. /* DWORD 4 */
  2748. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2749. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2750. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2751. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2752. /* DWORD 5 */
  2753. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2754. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2755. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2756. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2757. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2758. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2759. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2760. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2761. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2762. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2763. /* DWORD 4 */
  2764. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2765. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2766. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2767. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2768. do { \
  2769. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2770. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2771. } while (0)
  2772. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2773. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2774. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2775. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2778. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2779. } while (0)
  2780. /* DWORD 5 */
  2781. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2782. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2783. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2784. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2785. do { \
  2786. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2787. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2788. } while (0)
  2789. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2790. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2791. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2792. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2795. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2796. } while (0)
  2797. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2798. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2799. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2800. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2801. do { \
  2802. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2803. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2804. } while (0)
  2805. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2806. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2807. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2808. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2809. do { \
  2810. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2811. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2812. } while (0)
  2813. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2814. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2815. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2816. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2819. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2820. } while (0)
  2821. /**
  2822. * @brief HTT TX WBM reinject status from firmware to host
  2823. * @details
  2824. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2825. * (WBM) offload HW.
  2826. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2827. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2828. */
  2829. PREPACK struct htt_tx_wbm_reinject_status {
  2830. A_UINT32
  2831. reserved0: 32;
  2832. A_UINT32
  2833. reserved1: 32;
  2834. A_UINT32
  2835. reserved2: 32;
  2836. } POSTPACK;
  2837. /**
  2838. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2839. * @details
  2840. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2841. * (WBM) offload HW.
  2842. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2843. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2844. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2845. * STA side.
  2846. */
  2847. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2848. A_UINT32
  2849. mec_sa_addr_31_0;
  2850. A_UINT32
  2851. mec_sa_addr_47_32: 16,
  2852. sa_ast_index: 16;
  2853. A_UINT32
  2854. vdev_id: 8,
  2855. reserved0: 24;
  2856. } POSTPACK;
  2857. /* DWORD 4 - mec_sa_addr_31_0 */
  2858. /* DWORD 5 */
  2859. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2860. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2861. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2862. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2863. /* DWORD 6 */
  2864. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2865. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2866. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2867. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2868. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2869. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2870. do { \
  2871. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2872. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2873. } while (0)
  2874. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2875. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2876. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2877. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2878. do { \
  2879. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2880. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2881. } while (0)
  2882. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2883. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2884. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2885. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2886. do { \
  2887. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2888. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2889. } while (0)
  2890. typedef enum {
  2891. TX_FLOW_PRIORITY_BE,
  2892. TX_FLOW_PRIORITY_HIGH,
  2893. TX_FLOW_PRIORITY_LOW,
  2894. } htt_tx_flow_priority_t;
  2895. typedef enum {
  2896. TX_FLOW_LATENCY_SENSITIVE,
  2897. TX_FLOW_LATENCY_INSENSITIVE,
  2898. } htt_tx_flow_latency_t;
  2899. typedef enum {
  2900. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2901. TX_FLOW_INTERACTIVE_TRAFFIC,
  2902. TX_FLOW_PERIODIC_TRAFFIC,
  2903. TX_FLOW_BURSTY_TRAFFIC,
  2904. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2905. } htt_tx_flow_traffic_pattern_t;
  2906. /**
  2907. * @brief HTT TX Flow search metadata format
  2908. * @details
  2909. * Host will set this metadata in flow table's flow search entry along with
  2910. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2911. * firmware and TQM ring if the flow search entry wins.
  2912. * This metadata is available to firmware in that first MSDU's
  2913. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2914. * to one of the available flows for specific tid and returns the tqm flow
  2915. * pointer as part of htt_tx_map_flow_info message.
  2916. */
  2917. PREPACK struct htt_tx_flow_metadata {
  2918. A_UINT32
  2919. rsvd0_1_0: 2,
  2920. tid: 4,
  2921. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2922. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2923. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2924. * Else choose final tid based on latency, priority.
  2925. */
  2926. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2927. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2928. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2929. } POSTPACK;
  2930. /* DWORD 0 */
  2931. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2932. #define HTT_TX_FLOW_METADATA_TID_S 2
  2933. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2934. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2935. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2936. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2937. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2938. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2939. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2940. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2941. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2942. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2943. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2944. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2945. /* DWORD 0 */
  2946. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2947. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2948. HTT_TX_FLOW_METADATA_TID_S)
  2949. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2952. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2953. } while (0)
  2954. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2955. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2956. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2957. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2960. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2961. } while (0)
  2962. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2963. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2964. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2965. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2968. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2969. } while (0)
  2970. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2971. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2972. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2973. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2974. do { \
  2975. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2976. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2977. } while (0)
  2978. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2979. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2980. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2981. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2982. do { \
  2983. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2984. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2985. } while (0)
  2986. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2987. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2988. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2989. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2990. do { \
  2991. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2992. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2993. } while (0)
  2994. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2995. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2996. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2997. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2998. do { \
  2999. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3000. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3001. } while (0)
  3002. /**
  3003. * @brief host -> target ADD WDS Entry
  3004. *
  3005. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3006. *
  3007. * @brief host -> target DELETE WDS Entry
  3008. *
  3009. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3010. *
  3011. * @details
  3012. * HTT wds entry from source port learning
  3013. * Host will learn wds entries from rx and send this message to firmware
  3014. * to enable firmware to configure/delete AST entries for wds clients.
  3015. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3016. * and when SA's entry is deleted, firmware removes this AST entry
  3017. *
  3018. * The message would appear as follows:
  3019. *
  3020. * |31 30|29 |17 16|15 8|7 0|
  3021. * |----------------+----------------+----------------+----------------|
  3022. * | rsvd0 |PDVID| vdev_id | msg_type |
  3023. * |-------------------------------------------------------------------|
  3024. * | sa_addr_31_0 |
  3025. * |-------------------------------------------------------------------|
  3026. * | | ta_peer_id | sa_addr_47_32 |
  3027. * |-------------------------------------------------------------------|
  3028. * Where PDVID = pdev_id
  3029. *
  3030. * The message is interpreted as follows:
  3031. *
  3032. * dword0 - b'0:7 - msg_type: This will be set to
  3033. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3034. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3035. *
  3036. * dword0 - b'8:15 - vdev_id
  3037. *
  3038. * dword0 - b'16:17 - pdev_id
  3039. *
  3040. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3041. *
  3042. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3043. *
  3044. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3045. *
  3046. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3047. */
  3048. PREPACK struct htt_wds_entry {
  3049. A_UINT32
  3050. msg_type: 8,
  3051. vdev_id: 8,
  3052. pdev_id: 2,
  3053. rsvd0: 14;
  3054. A_UINT32 sa_addr_31_0;
  3055. A_UINT32
  3056. sa_addr_47_32: 16,
  3057. ta_peer_id: 14,
  3058. rsvd2: 2;
  3059. } POSTPACK;
  3060. /* DWORD 0 */
  3061. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3062. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3063. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3064. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3065. /* DWORD 2 */
  3066. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3067. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3068. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3069. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3070. /* DWORD 0 */
  3071. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3072. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3073. HTT_WDS_ENTRY_VDEV_ID_S)
  3074. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3075. do { \
  3076. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3077. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3078. } while (0)
  3079. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3080. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3081. HTT_WDS_ENTRY_PDEV_ID_S)
  3082. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3083. do { \
  3084. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3085. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3086. } while (0)
  3087. /* DWORD 2 */
  3088. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3089. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3090. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3091. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3092. do { \
  3093. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3094. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3095. } while (0)
  3096. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3097. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3098. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3099. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3100. do { \
  3101. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3102. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3103. } while (0)
  3104. /**
  3105. * @brief MAC DMA rx ring setup specification
  3106. *
  3107. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3108. *
  3109. * @details
  3110. * To allow for dynamic rx ring reconfiguration and to avoid race
  3111. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3112. * it uses. Instead, it sends this message to the target, indicating how
  3113. * the rx ring used by the host should be set up and maintained.
  3114. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3115. * specifications.
  3116. *
  3117. * |31 16|15 8|7 0|
  3118. * |---------------------------------------------------------------|
  3119. * header: | reserved | num rings | msg type |
  3120. * |---------------------------------------------------------------|
  3121. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3122. #if HTT_PADDR64
  3123. * | FW_IDX shadow register physical address (bits 63:32) |
  3124. #endif
  3125. * |---------------------------------------------------------------|
  3126. * | rx ring base physical address (bits 31:0) |
  3127. #if HTT_PADDR64
  3128. * | rx ring base physical address (bits 63:32) |
  3129. #endif
  3130. * |---------------------------------------------------------------|
  3131. * | rx ring buffer size | rx ring length |
  3132. * |---------------------------------------------------------------|
  3133. * | FW_IDX initial value | enabled flags |
  3134. * |---------------------------------------------------------------|
  3135. * | MSDU payload offset | 802.11 header offset |
  3136. * |---------------------------------------------------------------|
  3137. * | PPDU end offset | PPDU start offset |
  3138. * |---------------------------------------------------------------|
  3139. * | MPDU end offset | MPDU start offset |
  3140. * |---------------------------------------------------------------|
  3141. * | MSDU end offset | MSDU start offset |
  3142. * |---------------------------------------------------------------|
  3143. * | frag info offset | rx attention offset |
  3144. * |---------------------------------------------------------------|
  3145. * payload 2, if present, has the same format as payload 1
  3146. * Header fields:
  3147. * - MSG_TYPE
  3148. * Bits 7:0
  3149. * Purpose: identifies this as an rx ring configuration message
  3150. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3151. * - NUM_RINGS
  3152. * Bits 15:8
  3153. * Purpose: indicates whether the host is setting up one rx ring or two
  3154. * Value: 1 or 2
  3155. * Payload:
  3156. * for systems using 64-bit format for bus addresses:
  3157. * - IDX_SHADOW_REG_PADDR_LO
  3158. * Bits 31:0
  3159. * Value: lower 4 bytes of physical address of the host's
  3160. * FW_IDX shadow register
  3161. * - IDX_SHADOW_REG_PADDR_HI
  3162. * Bits 31:0
  3163. * Value: upper 4 bytes of physical address of the host's
  3164. * FW_IDX shadow register
  3165. * - RING_BASE_PADDR_LO
  3166. * Bits 31:0
  3167. * Value: lower 4 bytes of physical address of the host's rx ring
  3168. * - RING_BASE_PADDR_HI
  3169. * Bits 31:0
  3170. * Value: uppper 4 bytes of physical address of the host's rx ring
  3171. * for systems using 32-bit format for bus addresses:
  3172. * - IDX_SHADOW_REG_PADDR
  3173. * Bits 31:0
  3174. * Value: physical address of the host's FW_IDX shadow register
  3175. * - RING_BASE_PADDR
  3176. * Bits 31:0
  3177. * Value: physical address of the host's rx ring
  3178. * - RING_LEN
  3179. * Bits 15:0
  3180. * Value: number of elements in the rx ring
  3181. * - RING_BUF_SZ
  3182. * Bits 31:16
  3183. * Value: size of the buffers referenced by the rx ring, in byte units
  3184. * - ENABLED_FLAGS
  3185. * Bits 15:0
  3186. * Value: 1-bit flags to show whether different rx fields are enabled
  3187. * bit 0: 802.11 header enabled (1) or disabled (0)
  3188. * bit 1: MSDU payload enabled (1) or disabled (0)
  3189. * bit 2: PPDU start enabled (1) or disabled (0)
  3190. * bit 3: PPDU end enabled (1) or disabled (0)
  3191. * bit 4: MPDU start enabled (1) or disabled (0)
  3192. * bit 5: MPDU end enabled (1) or disabled (0)
  3193. * bit 6: MSDU start enabled (1) or disabled (0)
  3194. * bit 7: MSDU end enabled (1) or disabled (0)
  3195. * bit 8: rx attention enabled (1) or disabled (0)
  3196. * bit 9: frag info enabled (1) or disabled (0)
  3197. * bit 10: unicast rx enabled (1) or disabled (0)
  3198. * bit 11: multicast rx enabled (1) or disabled (0)
  3199. * bit 12: ctrl rx enabled (1) or disabled (0)
  3200. * bit 13: mgmt rx enabled (1) or disabled (0)
  3201. * bit 14: null rx enabled (1) or disabled (0)
  3202. * bit 15: phy data rx enabled (1) or disabled (0)
  3203. * - IDX_INIT_VAL
  3204. * Bits 31:16
  3205. * Purpose: Specify the initial value for the FW_IDX.
  3206. * Value: the number of buffers initially present in the host's rx ring
  3207. * - OFFSET_802_11_HDR
  3208. * Bits 15:0
  3209. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3210. * - OFFSET_MSDU_PAYLOAD
  3211. * Bits 31:16
  3212. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3213. * - OFFSET_PPDU_START
  3214. * Bits 15:0
  3215. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3216. * - OFFSET_PPDU_END
  3217. * Bits 31:16
  3218. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3219. * - OFFSET_MPDU_START
  3220. * Bits 15:0
  3221. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3222. * - OFFSET_MPDU_END
  3223. * Bits 31:16
  3224. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3225. * - OFFSET_MSDU_START
  3226. * Bits 15:0
  3227. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3228. * - OFFSET_MSDU_END
  3229. * Bits 31:16
  3230. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3231. * - OFFSET_RX_ATTN
  3232. * Bits 15:0
  3233. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3234. * - OFFSET_FRAG_INFO
  3235. * Bits 31:16
  3236. * Value: offset in QUAD-bytes of frag info table
  3237. */
  3238. /* header fields */
  3239. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3240. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3241. /* payload fields */
  3242. /* for systems using a 64-bit format for bus addresses */
  3243. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3244. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3245. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3246. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3247. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3248. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3249. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3250. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3251. /* for systems using a 32-bit format for bus addresses */
  3252. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3253. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3254. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3255. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3256. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3257. #define HTT_RX_RING_CFG_LEN_S 0
  3258. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3259. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3260. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3261. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3262. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3263. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3264. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3265. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3266. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3267. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3268. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3269. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3270. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3271. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3272. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3273. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3274. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3275. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3276. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3277. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3278. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3279. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3280. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3281. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3282. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3283. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3284. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3285. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3286. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3287. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3288. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3289. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3290. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3291. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3292. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3293. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3294. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3295. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3296. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3297. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3298. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3299. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3300. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3301. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3302. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3303. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3304. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3305. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3306. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3307. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3308. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3309. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3310. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3311. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3312. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3313. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3314. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3315. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3316. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3317. #if HTT_PADDR64
  3318. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3319. #else
  3320. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3321. #endif
  3322. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3323. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3324. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3325. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3326. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3327. do { \
  3328. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3329. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3330. } while (0)
  3331. /* degenerate case for 32-bit fields */
  3332. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3333. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3334. ((_var) = (_val))
  3335. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3336. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3337. ((_var) = (_val))
  3338. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3339. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3340. ((_var) = (_val))
  3341. /* degenerate case for 32-bit fields */
  3342. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3343. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3344. ((_var) = (_val))
  3345. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3346. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3347. ((_var) = (_val))
  3348. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3349. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3350. ((_var) = (_val))
  3351. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3352. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3353. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3354. do { \
  3355. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3356. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3357. } while (0)
  3358. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3359. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3360. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3361. do { \
  3362. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3363. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3364. } while (0)
  3365. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3366. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3367. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3368. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3369. do { \
  3370. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3371. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3372. } while (0)
  3373. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3374. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3375. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3376. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3377. do { \
  3378. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3379. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3380. } while (0)
  3381. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3382. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3383. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3384. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3385. do { \
  3386. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3387. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3388. } while (0)
  3389. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3390. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3391. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3392. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3395. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3396. } while (0)
  3397. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3398. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3399. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3400. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3403. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3404. } while (0)
  3405. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3406. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3407. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3408. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3411. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3412. } while (0)
  3413. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3414. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3415. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3416. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3419. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3420. } while (0)
  3421. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3422. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3423. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3424. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3427. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3428. } while (0)
  3429. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3430. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3431. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3432. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3435. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3436. } while (0)
  3437. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3438. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3439. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3440. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3443. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3444. } while (0)
  3445. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3446. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3447. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3448. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3451. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3452. } while (0)
  3453. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3454. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3455. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3456. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3459. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3460. } while (0)
  3461. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3462. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3463. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3464. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3467. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3468. } while (0)
  3469. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3470. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3471. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3472. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3475. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3476. } while (0)
  3477. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3478. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3479. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3480. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3483. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3484. } while (0)
  3485. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3486. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3487. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3488. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3491. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3492. } while (0)
  3493. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3494. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3495. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3496. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3499. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3500. } while (0)
  3501. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3502. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3503. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3504. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3507. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3508. } while (0)
  3509. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3510. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3511. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3512. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3515. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3516. } while (0)
  3517. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3518. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3519. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3520. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3523. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3524. } while (0)
  3525. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3526. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3527. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3528. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3531. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3532. } while (0)
  3533. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3534. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3535. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3536. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3539. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3540. } while (0)
  3541. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3542. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3543. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3544. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3547. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3548. } while (0)
  3549. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3550. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3551. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3552. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3555. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3556. } while (0)
  3557. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3558. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3559. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3560. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3563. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3564. } while (0)
  3565. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3566. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3567. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3568. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3571. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3572. } while (0)
  3573. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3574. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3575. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3576. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3579. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3580. } while (0)
  3581. /**
  3582. * @brief host -> target FW statistics retrieve
  3583. *
  3584. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3585. *
  3586. * @details
  3587. * The following field definitions describe the format of the HTT host
  3588. * to target FW stats retrieve message. The message specifies the type of
  3589. * stats host wants to retrieve.
  3590. *
  3591. * |31 24|23 16|15 8|7 0|
  3592. * |-----------------------------------------------------------|
  3593. * | stats types request bitmask | msg type |
  3594. * |-----------------------------------------------------------|
  3595. * | stats types reset bitmask | reserved |
  3596. * |-----------------------------------------------------------|
  3597. * | stats type | config value |
  3598. * |-----------------------------------------------------------|
  3599. * | cookie LSBs |
  3600. * |-----------------------------------------------------------|
  3601. * | cookie MSBs |
  3602. * |-----------------------------------------------------------|
  3603. * Header fields:
  3604. * - MSG_TYPE
  3605. * Bits 7:0
  3606. * Purpose: identifies this is a stats upload request message
  3607. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3608. * - UPLOAD_TYPES
  3609. * Bits 31:8
  3610. * Purpose: identifies which types of FW statistics to upload
  3611. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3612. * - RESET_TYPES
  3613. * Bits 31:8
  3614. * Purpose: identifies which types of FW statistics to reset
  3615. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3616. * - CFG_VAL
  3617. * Bits 23:0
  3618. * Purpose: give an opaque configuration value to the specified stats type
  3619. * Value: stats-type specific configuration value
  3620. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3621. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3622. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3623. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3624. * - CFG_STAT_TYPE
  3625. * Bits 31:24
  3626. * Purpose: specify which stats type (if any) the config value applies to
  3627. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3628. * a valid configuration specification
  3629. * - COOKIE_LSBS
  3630. * Bits 31:0
  3631. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3632. * message with its preceding host->target stats request message.
  3633. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3634. * - COOKIE_MSBS
  3635. * Bits 31:0
  3636. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3637. * message with its preceding host->target stats request message.
  3638. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3639. */
  3640. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3641. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3642. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3643. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3644. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3645. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3646. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3647. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3648. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3649. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3650. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3651. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3652. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3653. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3656. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3657. } while (0)
  3658. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3659. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3660. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3661. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3664. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3665. } while (0)
  3666. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3667. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3668. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3669. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3672. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3673. } while (0)
  3674. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3675. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3676. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3677. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3680. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3681. } while (0)
  3682. /**
  3683. * @brief host -> target HTT out-of-band sync request
  3684. *
  3685. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3686. *
  3687. * @details
  3688. * The HTT SYNC tells the target to suspend processing of subsequent
  3689. * HTT host-to-target messages until some other target agent locally
  3690. * informs the target HTT FW that the current sync counter is equal to
  3691. * or greater than (in a modulo sense) the sync counter specified in
  3692. * the SYNC message.
  3693. * This allows other host-target components to synchronize their operation
  3694. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3695. * security key has been downloaded to and activated by the target.
  3696. * In the absence of any explicit synchronization counter value
  3697. * specification, the target HTT FW will use zero as the default current
  3698. * sync value.
  3699. *
  3700. * |31 24|23 16|15 8|7 0|
  3701. * |-----------------------------------------------------------|
  3702. * | reserved | sync count | msg type |
  3703. * |-----------------------------------------------------------|
  3704. * Header fields:
  3705. * - MSG_TYPE
  3706. * Bits 7:0
  3707. * Purpose: identifies this as a sync message
  3708. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3709. * - SYNC_COUNT
  3710. * Bits 15:8
  3711. * Purpose: specifies what sync value the HTT FW will wait for from
  3712. * an out-of-band specification to resume its operation
  3713. * Value: in-band sync counter value to compare against the out-of-band
  3714. * counter spec.
  3715. * The HTT target FW will suspend its host->target message processing
  3716. * as long as
  3717. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3718. */
  3719. #define HTT_H2T_SYNC_MSG_SZ 4
  3720. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3721. #define HTT_H2T_SYNC_COUNT_S 8
  3722. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3723. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3724. HTT_H2T_SYNC_COUNT_S)
  3725. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3728. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3729. } while (0)
  3730. /**
  3731. * @brief host -> target HTT aggregation configuration
  3732. *
  3733. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3734. */
  3735. #define HTT_AGGR_CFG_MSG_SZ 4
  3736. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3737. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3738. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3739. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3740. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3741. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3742. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3743. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3744. do { \
  3745. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3746. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3747. } while (0)
  3748. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3749. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3750. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3751. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3752. do { \
  3753. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3754. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3755. } while (0)
  3756. /**
  3757. * @brief host -> target HTT configure max amsdu info per vdev
  3758. *
  3759. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3760. *
  3761. * @details
  3762. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3763. *
  3764. * |31 21|20 16|15 8|7 0|
  3765. * |-----------------------------------------------------------|
  3766. * | reserved | vdev id | max amsdu | msg type |
  3767. * |-----------------------------------------------------------|
  3768. * Header fields:
  3769. * - MSG_TYPE
  3770. * Bits 7:0
  3771. * Purpose: identifies this as a aggr cfg ex message
  3772. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3773. * - MAX_NUM_AMSDU_SUBFRM
  3774. * Bits 15:8
  3775. * Purpose: max MSDUs per A-MSDU
  3776. * - VDEV_ID
  3777. * Bits 20:16
  3778. * Purpose: ID of the vdev to which this limit is applied
  3779. */
  3780. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3781. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3782. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3783. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3784. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3785. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3786. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3787. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3788. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3789. do { \
  3790. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3791. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3792. } while (0)
  3793. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3794. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3795. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3796. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3797. do { \
  3798. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3799. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3800. } while (0)
  3801. /**
  3802. * @brief HTT WDI_IPA Config Message
  3803. *
  3804. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3805. *
  3806. * @details
  3807. * The HTT WDI_IPA config message is created/sent by host at driver
  3808. * init time. It contains information about data structures used on
  3809. * WDI_IPA TX and RX path.
  3810. * TX CE ring is used for pushing packet metadata from IPA uC
  3811. * to WLAN FW
  3812. * TX Completion ring is used for generating TX completions from
  3813. * WLAN FW to IPA uC
  3814. * RX Indication ring is used for indicating RX packets from FW
  3815. * to IPA uC
  3816. * RX Ring2 is used as either completion ring or as second
  3817. * indication ring. when Ring2 is used as completion ring, IPA uC
  3818. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3819. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3820. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3821. * indicated in RX Indication ring. Please see WDI_IPA specification
  3822. * for more details.
  3823. * |31 24|23 16|15 8|7 0|
  3824. * |----------------+----------------+----------------+----------------|
  3825. * | tx pkt pool size | Rsvd | msg_type |
  3826. * |-------------------------------------------------------------------|
  3827. * | tx comp ring base (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | tx comp ring base (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | tx comp ring size |
  3833. * |-------------------------------------------------------------------|
  3834. * | tx comp WR_IDX physical address (bits 31:0) |
  3835. #if HTT_PADDR64
  3836. * | tx comp WR_IDX physical address (bits 63:32) |
  3837. #endif
  3838. * |-------------------------------------------------------------------|
  3839. * | tx CE WR_IDX physical address (bits 31:0) |
  3840. #if HTT_PADDR64
  3841. * | tx CE WR_IDX physical address (bits 63:32) |
  3842. #endif
  3843. * |-------------------------------------------------------------------|
  3844. * | rx indication ring base (bits 31:0) |
  3845. #if HTT_PADDR64
  3846. * | rx indication ring base (bits 63:32) |
  3847. #endif
  3848. * |-------------------------------------------------------------------|
  3849. * | rx indication ring size |
  3850. * |-------------------------------------------------------------------|
  3851. * | rx ind RD_IDX physical address (bits 31:0) |
  3852. #if HTT_PADDR64
  3853. * | rx ind RD_IDX physical address (bits 63:32) |
  3854. #endif
  3855. * |-------------------------------------------------------------------|
  3856. * | rx ind WR_IDX physical address (bits 31:0) |
  3857. #if HTT_PADDR64
  3858. * | rx ind WR_IDX physical address (bits 63:32) |
  3859. #endif
  3860. * |-------------------------------------------------------------------|
  3861. * |-------------------------------------------------------------------|
  3862. * | rx ring2 base (bits 31:0) |
  3863. #if HTT_PADDR64
  3864. * | rx ring2 base (bits 63:32) |
  3865. #endif
  3866. * |-------------------------------------------------------------------|
  3867. * | rx ring2 size |
  3868. * |-------------------------------------------------------------------|
  3869. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3870. #if HTT_PADDR64
  3871. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3872. #endif
  3873. * |-------------------------------------------------------------------|
  3874. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3875. #if HTT_PADDR64
  3876. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3877. #endif
  3878. * |-------------------------------------------------------------------|
  3879. *
  3880. * Header fields:
  3881. * Header fields:
  3882. * - MSG_TYPE
  3883. * Bits 7:0
  3884. * Purpose: Identifies this as WDI_IPA config message
  3885. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3886. * - TX_PKT_POOL_SIZE
  3887. * Bits 15:0
  3888. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3889. * WDI_IPA TX path
  3890. * For systems using 32-bit format for bus addresses:
  3891. * - TX_COMP_RING_BASE_ADDR
  3892. * Bits 31:0
  3893. * Purpose: TX Completion Ring base address in DDR
  3894. * - TX_COMP_RING_SIZE
  3895. * Bits 31:0
  3896. * Purpose: TX Completion Ring size (must be power of 2)
  3897. * - TX_COMP_WR_IDX_ADDR
  3898. * Bits 31:0
  3899. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3900. * updates the Write Index for WDI_IPA TX completion ring
  3901. * - TX_CE_WR_IDX_ADDR
  3902. * Bits 31:0
  3903. * Purpose: DDR address where IPA uC
  3904. * updates the WR Index for TX CE ring
  3905. * (needed for fusion platforms)
  3906. * - RX_IND_RING_BASE_ADDR
  3907. * Bits 31:0
  3908. * Purpose: RX Indication Ring base address in DDR
  3909. * - RX_IND_RING_SIZE
  3910. * Bits 31:0
  3911. * Purpose: RX Indication Ring size
  3912. * - RX_IND_RD_IDX_ADDR
  3913. * Bits 31:0
  3914. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3915. * RX indication ring
  3916. * - RX_IND_WR_IDX_ADDR
  3917. * Bits 31:0
  3918. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3919. * updates the Write Index for WDI_IPA RX indication ring
  3920. * - RX_RING2_BASE_ADDR
  3921. * Bits 31:0
  3922. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3923. * - RX_RING2_SIZE
  3924. * Bits 31:0
  3925. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3926. * - RX_RING2_RD_IDX_ADDR
  3927. * Bits 31:0
  3928. * Purpose: If Second RX ring is Indication ring, DDR address where
  3929. * IPA uC updates the Read Index for Ring2.
  3930. * If Second RX ring is completion ring, this is NOT used
  3931. * - RX_RING2_WR_IDX_ADDR
  3932. * Bits 31:0
  3933. * Purpose: If Second RX ring is Indication ring, DDR address where
  3934. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3935. * If second RX ring is completion ring, DDR address where
  3936. * IPA uC updates the Write Index for Ring 2.
  3937. * For systems using 64-bit format for bus addresses:
  3938. * - TX_COMP_RING_BASE_ADDR_LO
  3939. * Bits 31:0
  3940. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3941. * - TX_COMP_RING_BASE_ADDR_HI
  3942. * Bits 31:0
  3943. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3944. * - TX_COMP_RING_SIZE
  3945. * Bits 31:0
  3946. * Purpose: TX Completion Ring size (must be power of 2)
  3947. * - TX_COMP_WR_IDX_ADDR_LO
  3948. * Bits 31:0
  3949. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3950. * Lower 4 bytes of DDR address where WIFI FW
  3951. * updates the Write Index for WDI_IPA TX completion ring
  3952. * - TX_COMP_WR_IDX_ADDR_HI
  3953. * Bits 31:0
  3954. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3955. * Higher 4 bytes of DDR address where WIFI FW
  3956. * updates the Write Index for WDI_IPA TX completion ring
  3957. * - TX_CE_WR_IDX_ADDR_LO
  3958. * Bits 31:0
  3959. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3960. * updates the WR Index for TX CE ring
  3961. * (needed for fusion platforms)
  3962. * - TX_CE_WR_IDX_ADDR_HI
  3963. * Bits 31:0
  3964. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3965. * updates the WR Index for TX CE ring
  3966. * (needed for fusion platforms)
  3967. * - RX_IND_RING_BASE_ADDR_LO
  3968. * Bits 31:0
  3969. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3970. * - RX_IND_RING_BASE_ADDR_HI
  3971. * Bits 31:0
  3972. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3973. * - RX_IND_RING_SIZE
  3974. * Bits 31:0
  3975. * Purpose: RX Indication Ring size
  3976. * - RX_IND_RD_IDX_ADDR_LO
  3977. * Bits 31:0
  3978. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3979. * for WDI_IPA RX indication ring
  3980. * - RX_IND_RD_IDX_ADDR_HI
  3981. * Bits 31:0
  3982. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3983. * for WDI_IPA RX indication ring
  3984. * - RX_IND_WR_IDX_ADDR_LO
  3985. * Bits 31:0
  3986. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3987. * Lower 4 bytes of DDR address where WIFI FW
  3988. * updates the Write Index for WDI_IPA RX indication ring
  3989. * - RX_IND_WR_IDX_ADDR_HI
  3990. * Bits 31:0
  3991. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3992. * Higher 4 bytes of DDR address where WIFI FW
  3993. * updates the Write Index for WDI_IPA RX indication ring
  3994. * - RX_RING2_BASE_ADDR_LO
  3995. * Bits 31:0
  3996. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3997. * - RX_RING2_BASE_ADDR_HI
  3998. * Bits 31:0
  3999. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4000. * - RX_RING2_SIZE
  4001. * Bits 31:0
  4002. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4003. * - RX_RING2_RD_IDX_ADDR_LO
  4004. * Bits 31:0
  4005. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4006. * DDR address where IPA uC updates the Read Index for Ring2.
  4007. * If Second RX ring is completion ring, this is NOT used
  4008. * - RX_RING2_RD_IDX_ADDR_HI
  4009. * Bits 31:0
  4010. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4011. * DDR address where IPA uC updates the Read Index for Ring2.
  4012. * If Second RX ring is completion ring, this is NOT used
  4013. * - RX_RING2_WR_IDX_ADDR_LO
  4014. * Bits 31:0
  4015. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4016. * DDR address where WIFI FW updates the Write Index
  4017. * for WDI_IPA RX ring2
  4018. * If second RX ring is completion ring, lower 4 bytes of
  4019. * DDR address where IPA uC updates the Write Index for Ring 2.
  4020. * - RX_RING2_WR_IDX_ADDR_HI
  4021. * Bits 31:0
  4022. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4023. * DDR address where WIFI FW updates the Write Index
  4024. * for WDI_IPA RX ring2
  4025. * If second RX ring is completion ring, higher 4 bytes of
  4026. * DDR address where IPA uC updates the Write Index for Ring 2.
  4027. */
  4028. #if HTT_PADDR64
  4029. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4030. #else
  4031. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4032. #endif
  4033. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4034. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4035. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4037. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4049. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4051. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4095. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4096. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4097. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4100. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4101. } while (0)
  4102. /* for systems using 32-bit format for bus addr */
  4103. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4104. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4105. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4108. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4109. } while (0)
  4110. /* for systems using 64-bit format for bus addr */
  4111. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4112. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4113. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4114. do { \
  4115. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4116. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4117. } while (0)
  4118. /* for systems using 64-bit format for bus addr */
  4119. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4120. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4121. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4122. do { \
  4123. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4124. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4125. } while (0)
  4126. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4127. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4128. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4129. do { \
  4130. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4131. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4132. } while (0)
  4133. /* for systems using 32-bit format for bus addr */
  4134. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4135. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4136. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4139. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4140. } while (0)
  4141. /* for systems using 64-bit format for bus addr */
  4142. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4143. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4144. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4147. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4148. } while (0)
  4149. /* for systems using 64-bit format for bus addr */
  4150. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4151. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4152. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4153. do { \
  4154. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4155. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4156. } while (0)
  4157. /* for systems using 32-bit format for bus addr */
  4158. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4159. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4160. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4163. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4164. } while (0)
  4165. /* for systems using 64-bit format for bus addr */
  4166. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4167. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4168. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4169. do { \
  4170. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4171. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4172. } while (0)
  4173. /* for systems using 64-bit format for bus addr */
  4174. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4175. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4176. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4179. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4180. } while (0)
  4181. /* for systems using 32-bit format for bus addr */
  4182. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4183. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4184. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4187. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4188. } while (0)
  4189. /* for systems using 64-bit format for bus addr */
  4190. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4191. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4192. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4193. do { \
  4194. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4195. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4196. } while (0)
  4197. /* for systems using 64-bit format for bus addr */
  4198. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4199. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4200. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4203. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4204. } while (0)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4206. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4207. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4208. do { \
  4209. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4210. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4211. } while (0)
  4212. /* for systems using 32-bit format for bus addr */
  4213. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4214. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4219. } while (0)
  4220. /* for systems using 64-bit format for bus addr */
  4221. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4222. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4223. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4224. do { \
  4225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4226. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4227. } while (0)
  4228. /* for systems using 64-bit format for bus addr */
  4229. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4230. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4231. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4232. do { \
  4233. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4234. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4235. } while (0)
  4236. /* for systems using 32-bit format for bus addr */
  4237. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4238. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4239. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4242. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4243. } while (0)
  4244. /* for systems using 64-bit format for bus addr */
  4245. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4246. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4247. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4248. do { \
  4249. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4250. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4251. } while (0)
  4252. /* for systems using 64-bit format for bus addr */
  4253. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4254. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4255. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4258. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4259. } while (0)
  4260. /* for systems using 32-bit format for bus addr */
  4261. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4262. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4263. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4266. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4267. } while (0)
  4268. /* for systems using 64-bit format for bus addr */
  4269. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4270. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4271. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4272. do { \
  4273. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4274. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4275. } while (0)
  4276. /* for systems using 64-bit format for bus addr */
  4277. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4278. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4279. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4282. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4283. } while (0)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4285. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4286. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4289. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4290. } while (0)
  4291. /* for systems using 32-bit format for bus addr */
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4293. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4295. do { \
  4296. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4297. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4298. } while (0)
  4299. /* for systems using 64-bit format for bus addr */
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4301. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4302. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4303. do { \
  4304. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4305. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4306. } while (0)
  4307. /* for systems using 64-bit format for bus addr */
  4308. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4309. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4310. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4311. do { \
  4312. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4313. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4314. } while (0)
  4315. /* for systems using 32-bit format for bus addr */
  4316. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4317. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4318. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4321. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4322. } while (0)
  4323. /* for systems using 64-bit format for bus addr */
  4324. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4325. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4326. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4329. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4330. } while (0)
  4331. /* for systems using 64-bit format for bus addr */
  4332. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4333. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4334. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4335. do { \
  4336. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4337. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4338. } while (0)
  4339. /*
  4340. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4341. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4342. * addresses are stored in a XXX-bit field.
  4343. * This macro is used to define both htt_wdi_ipa_config32_t and
  4344. * htt_wdi_ipa_config64_t structs.
  4345. */
  4346. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4347. _paddr__tx_comp_ring_base_addr_, \
  4348. _paddr__tx_comp_wr_idx_addr_, \
  4349. _paddr__tx_ce_wr_idx_addr_, \
  4350. _paddr__rx_ind_ring_base_addr_, \
  4351. _paddr__rx_ind_rd_idx_addr_, \
  4352. _paddr__rx_ind_wr_idx_addr_, \
  4353. _paddr__rx_ring2_base_addr_,\
  4354. _paddr__rx_ring2_rd_idx_addr_,\
  4355. _paddr__rx_ring2_wr_idx_addr_) \
  4356. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4357. { \
  4358. /* DWORD 0: flags and meta-data */ \
  4359. A_UINT32 \
  4360. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4361. reserved: 8, \
  4362. tx_pkt_pool_size: 16;\
  4363. /* DWORD 1 */\
  4364. _paddr__tx_comp_ring_base_addr_;\
  4365. /* DWORD 2 (or 3)*/\
  4366. A_UINT32 tx_comp_ring_size;\
  4367. /* DWORD 3 (or 4)*/\
  4368. _paddr__tx_comp_wr_idx_addr_;\
  4369. /* DWORD 4 (or 6)*/\
  4370. _paddr__tx_ce_wr_idx_addr_;\
  4371. /* DWORD 5 (or 8)*/\
  4372. _paddr__rx_ind_ring_base_addr_;\
  4373. /* DWORD 6 (or 10)*/\
  4374. A_UINT32 rx_ind_ring_size;\
  4375. /* DWORD 7 (or 11)*/\
  4376. _paddr__rx_ind_rd_idx_addr_;\
  4377. /* DWORD 8 (or 13)*/\
  4378. _paddr__rx_ind_wr_idx_addr_;\
  4379. /* DWORD 9 (or 15)*/\
  4380. _paddr__rx_ring2_base_addr_;\
  4381. /* DWORD 10 (or 17) */\
  4382. A_UINT32 rx_ring2_size;\
  4383. /* DWORD 11 (or 18) */\
  4384. _paddr__rx_ring2_rd_idx_addr_;\
  4385. /* DWORD 12 (or 20) */\
  4386. _paddr__rx_ring2_wr_idx_addr_;\
  4387. } POSTPACK
  4388. /* define a htt_wdi_ipa_config32_t type */
  4389. 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));
  4390. /* define a htt_wdi_ipa_config64_t type */
  4391. 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));
  4392. #if HTT_PADDR64
  4393. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4394. #else
  4395. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4396. #endif
  4397. enum htt_wdi_ipa_op_code {
  4398. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4399. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4400. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4401. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4402. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4403. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4404. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4405. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4406. /* keep this last */
  4407. HTT_WDI_IPA_OPCODE_MAX
  4408. };
  4409. /**
  4410. * @brief HTT WDI_IPA Operation Request Message
  4411. *
  4412. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4413. *
  4414. * @details
  4415. * HTT WDI_IPA Operation Request message is sent by host
  4416. * to either suspend or resume WDI_IPA TX or RX path.
  4417. * |31 24|23 16|15 8|7 0|
  4418. * |----------------+----------------+----------------+----------------|
  4419. * | op_code | Rsvd | msg_type |
  4420. * |-------------------------------------------------------------------|
  4421. *
  4422. * Header fields:
  4423. * - MSG_TYPE
  4424. * Bits 7:0
  4425. * Purpose: Identifies this as WDI_IPA Operation Request message
  4426. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4427. * - OP_CODE
  4428. * Bits 31:16
  4429. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4430. * value: = enum htt_wdi_ipa_op_code
  4431. */
  4432. PREPACK struct htt_wdi_ipa_op_request_t
  4433. {
  4434. /* DWORD 0: flags and meta-data */
  4435. A_UINT32
  4436. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4437. reserved: 8,
  4438. op_code: 16;
  4439. } POSTPACK;
  4440. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4441. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4442. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4443. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4444. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4445. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4446. do { \
  4447. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4448. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4449. } while (0)
  4450. /*
  4451. * @brief host -> target HTT_MSI_SETUP message
  4452. *
  4453. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4454. *
  4455. * @details
  4456. * After target is booted up, host can send MSI setup message so that
  4457. * target sets up HW registers based on setup message.
  4458. *
  4459. * The message would appear as follows:
  4460. * |31 24|23 16|15|14 8|7 0|
  4461. * |---------------+-----------------+-----------------+-----------------|
  4462. * | reserved | msi_type | pdev_id | msg_type |
  4463. * |---------------------------------------------------------------------|
  4464. * | msi_addr_lo |
  4465. * |---------------------------------------------------------------------|
  4466. * | msi_addr_hi |
  4467. * |---------------------------------------------------------------------|
  4468. * | msi_data |
  4469. * |---------------------------------------------------------------------|
  4470. *
  4471. * The message is interpreted as follows:
  4472. * dword0 - b'0:7 - msg_type: This will be set to
  4473. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4474. * b'8:15 - pdev_id:
  4475. * 0 (for rings at SOC/UMAC level),
  4476. * 1/2/3 mac id (for rings at LMAC level)
  4477. * b'16:23 - msi_type: identify which msi registers need to be setup
  4478. * more details can be got from enum htt_msi_setup_type
  4479. * b'24:31 - reserved
  4480. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4481. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4482. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4483. */
  4484. PREPACK struct htt_msi_setup_t {
  4485. A_UINT32 msg_type: 8,
  4486. pdev_id: 8,
  4487. msi_type: 8,
  4488. reserved: 8;
  4489. A_UINT32 msi_addr_lo;
  4490. A_UINT32 msi_addr_hi;
  4491. A_UINT32 msi_data;
  4492. } POSTPACK;
  4493. enum htt_msi_setup_type {
  4494. HTT_PPDU_END_MSI_SETUP_TYPE,
  4495. /* Insert new types here*/
  4496. };
  4497. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4498. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4499. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4500. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4501. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4502. HTT_MSI_SETUP_PDEV_ID_S)
  4503. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4504. do { \
  4505. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4506. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4507. } while (0)
  4508. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4509. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4510. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4511. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4512. HTT_MSI_SETUP_MSI_TYPE_S)
  4513. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4514. do { \
  4515. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4516. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4517. } while (0)
  4518. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4519. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4520. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4521. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4522. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4523. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4524. do { \
  4525. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4526. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4527. } while (0)
  4528. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4529. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4530. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4531. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4532. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4533. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4534. do { \
  4535. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4536. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4537. } while (0)
  4538. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4539. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4540. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4541. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4542. HTT_MSI_SETUP_MSI_DATA_S)
  4543. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4544. do { \
  4545. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4546. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4547. } while (0)
  4548. /*
  4549. * @brief host -> target HTT_SRING_SETUP message
  4550. *
  4551. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4552. *
  4553. * @details
  4554. * After target is booted up, Host can send SRING setup message for
  4555. * each host facing LMAC SRING. Target setups up HW registers based
  4556. * on setup message and confirms back to Host if response_required is set.
  4557. * Host should wait for confirmation message before sending new SRING
  4558. * setup message
  4559. *
  4560. * The message would appear as follows:
  4561. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4562. * |--------------- +-----------------+-----------------+-----------------|
  4563. * | ring_type | ring_id | pdev_id | msg_type |
  4564. * |----------------------------------------------------------------------|
  4565. * | ring_base_addr_lo |
  4566. * |----------------------------------------------------------------------|
  4567. * | ring_base_addr_hi |
  4568. * |----------------------------------------------------------------------|
  4569. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4570. * |----------------------------------------------------------------------|
  4571. * | ring_head_offset32_remote_addr_lo |
  4572. * |----------------------------------------------------------------------|
  4573. * | ring_head_offset32_remote_addr_hi |
  4574. * |----------------------------------------------------------------------|
  4575. * | ring_tail_offset32_remote_addr_lo |
  4576. * |----------------------------------------------------------------------|
  4577. * | ring_tail_offset32_remote_addr_hi |
  4578. * |----------------------------------------------------------------------|
  4579. * | ring_msi_addr_lo |
  4580. * |----------------------------------------------------------------------|
  4581. * | ring_msi_addr_hi |
  4582. * |----------------------------------------------------------------------|
  4583. * | ring_msi_data |
  4584. * |----------------------------------------------------------------------|
  4585. * | intr_timer_th |IM| intr_batch_counter_th |
  4586. * |----------------------------------------------------------------------|
  4587. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4588. * |----------------------------------------------------------------------|
  4589. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4590. * |----------------------------------------------------------------------|
  4591. * Where
  4592. * IM = sw_intr_mode
  4593. * RR = response_required
  4594. * PTCF = prefetch_timer_cfg
  4595. * IP = IPA drop flag
  4596. *
  4597. * The message is interpreted as follows:
  4598. * dword0 - b'0:7 - msg_type: This will be set to
  4599. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4600. * b'8:15 - pdev_id:
  4601. * 0 (for rings at SOC/UMAC level),
  4602. * 1/2/3 mac id (for rings at LMAC level)
  4603. * b'16:23 - ring_id: identify which ring is to setup,
  4604. * more details can be got from enum htt_srng_ring_id
  4605. * b'24:31 - ring_type: identify type of host rings,
  4606. * more details can be got from enum htt_srng_ring_type
  4607. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4608. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4609. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4610. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4611. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4612. * SW_TO_HW_RING.
  4613. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4614. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4615. * Lower 32 bits of memory address of the remote variable
  4616. * storing the 4-byte word offset that identifies the head
  4617. * element within the ring.
  4618. * (The head offset variable has type A_UINT32.)
  4619. * Valid for HW_TO_SW and SW_TO_SW rings.
  4620. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4621. * Upper 32 bits of memory address of the remote variable
  4622. * storing the 4-byte word offset that identifies the head
  4623. * element within the ring.
  4624. * (The head offset variable has type A_UINT32.)
  4625. * Valid for HW_TO_SW and SW_TO_SW rings.
  4626. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4627. * Lower 32 bits of memory address of the remote variable
  4628. * storing the 4-byte word offset that identifies the tail
  4629. * element within the ring.
  4630. * (The tail offset variable has type A_UINT32.)
  4631. * Valid for HW_TO_SW and SW_TO_SW rings.
  4632. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4633. * Upper 32 bits of memory address of the remote variable
  4634. * storing the 4-byte word offset that identifies the tail
  4635. * element within the ring.
  4636. * (The tail offset variable has type A_UINT32.)
  4637. * Valid for HW_TO_SW and SW_TO_SW rings.
  4638. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4639. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4640. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4641. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4642. * dword10 - b'0:31 - ring_msi_data: MSI data
  4643. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4644. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4645. * dword11 - b'0:14 - intr_batch_counter_th:
  4646. * batch counter threshold is in units of 4-byte words.
  4647. * HW internally maintains and increments batch count.
  4648. * (see SRING spec for detail description).
  4649. * When batch count reaches threshold value, an interrupt
  4650. * is generated by HW.
  4651. * b'15 - sw_intr_mode:
  4652. * This configuration shall be static.
  4653. * Only programmed at power up.
  4654. * 0: generate pulse style sw interrupts
  4655. * 1: generate level style sw interrupts
  4656. * b'16:31 - intr_timer_th:
  4657. * The timer init value when timer is idle or is
  4658. * initialized to start downcounting.
  4659. * In 8us units (to cover a range of 0 to 524 ms)
  4660. * dword12 - b'0:15 - intr_low_threshold:
  4661. * Used only by Consumer ring to generate ring_sw_int_p.
  4662. * Ring entries low threshold water mark, that is used
  4663. * in combination with the interrupt timer as well as
  4664. * the the clearing of the level interrupt.
  4665. * b'16:18 - prefetch_timer_cfg:
  4666. * Used only by Consumer ring to set timer mode to
  4667. * support Application prefetch handling.
  4668. * The external tail offset/pointer will be updated
  4669. * at following intervals:
  4670. * 3'b000: (Prefetch feature disabled; used only for debug)
  4671. * 3'b001: 1 usec
  4672. * 3'b010: 4 usec
  4673. * 3'b011: 8 usec (default)
  4674. * 3'b100: 16 usec
  4675. * Others: Reserverd
  4676. * b'19 - response_required:
  4677. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4678. * b'20 - ipa_drop_flag:
  4679. Indicates that host will config ipa drop threshold percentage
  4680. * b'21:31 - reserved: reserved for future use
  4681. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4682. * b'8:15 - ipa drop high threshold percentage:
  4683. * b'16:31 - Reserved
  4684. */
  4685. PREPACK struct htt_sring_setup_t {
  4686. A_UINT32 msg_type: 8,
  4687. pdev_id: 8,
  4688. ring_id: 8,
  4689. ring_type: 8;
  4690. A_UINT32 ring_base_addr_lo;
  4691. A_UINT32 ring_base_addr_hi;
  4692. A_UINT32 ring_size: 16,
  4693. ring_entry_size: 8,
  4694. ring_misc_cfg_flag: 8;
  4695. A_UINT32 ring_head_offset32_remote_addr_lo;
  4696. A_UINT32 ring_head_offset32_remote_addr_hi;
  4697. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4698. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4699. A_UINT32 ring_msi_addr_lo;
  4700. A_UINT32 ring_msi_addr_hi;
  4701. A_UINT32 ring_msi_data;
  4702. A_UINT32 intr_batch_counter_th: 15,
  4703. sw_intr_mode: 1,
  4704. intr_timer_th: 16;
  4705. A_UINT32 intr_low_threshold: 16,
  4706. prefetch_timer_cfg: 3,
  4707. response_required: 1,
  4708. ipa_drop_flag: 1,
  4709. reserved1: 11;
  4710. A_UINT32 ipa_drop_low_threshold: 8,
  4711. ipa_drop_high_threshold: 8,
  4712. reserved: 16;
  4713. } POSTPACK;
  4714. enum htt_srng_ring_type {
  4715. HTT_HW_TO_SW_RING = 0,
  4716. HTT_SW_TO_HW_RING,
  4717. HTT_SW_TO_SW_RING,
  4718. /* Insert new ring types above this line */
  4719. };
  4720. enum htt_srng_ring_id {
  4721. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4722. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4723. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4724. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4725. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4726. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4727. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4728. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4729. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4730. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4731. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4732. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4733. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4734. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4735. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4736. /* Add Other SRING which can't be directly configured by host software above this line */
  4737. };
  4738. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4739. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4740. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4741. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4742. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4743. HTT_SRING_SETUP_PDEV_ID_S)
  4744. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4745. do { \
  4746. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4747. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4748. } while (0)
  4749. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4750. #define HTT_SRING_SETUP_RING_ID_S 16
  4751. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4752. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4753. HTT_SRING_SETUP_RING_ID_S)
  4754. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4755. do { \
  4756. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4757. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4758. } while (0)
  4759. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4760. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4761. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4762. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4763. HTT_SRING_SETUP_RING_TYPE_S)
  4764. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4765. do { \
  4766. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4767. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4768. } while (0)
  4769. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4770. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4771. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4772. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4773. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4774. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4775. do { \
  4776. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4777. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4778. } while (0)
  4779. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4780. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4781. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4782. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4783. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4784. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4787. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4788. } while (0)
  4789. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4790. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4791. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4792. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4793. HTT_SRING_SETUP_RING_SIZE_S)
  4794. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4795. do { \
  4796. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4797. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4798. } while (0)
  4799. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4800. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4801. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4802. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4803. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4804. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4805. do { \
  4806. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4807. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4808. } while (0)
  4809. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4810. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4811. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4812. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4813. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4814. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4815. do { \
  4816. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4817. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4818. } while (0)
  4819. /* This control bit is applicable to only Producer, which updates Ring ID field
  4820. * of each descriptor before pushing into the ring.
  4821. * 0: updates ring_id(default)
  4822. * 1: ring_id updating disabled */
  4823. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4826. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4827. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4828. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4829. do { \
  4830. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4831. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4832. } while (0)
  4833. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4834. * of each descriptor before pushing into the ring.
  4835. * 0: updates Loopcnt(default)
  4836. * 1: Loopcnt updating disabled */
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4840. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4841. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4843. do { \
  4844. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4845. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4846. } while (0)
  4847. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4848. * into security_id port of GXI/AXI. */
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4852. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4853. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4855. do { \
  4856. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4857. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4858. } while (0)
  4859. /* During MSI write operation, SRNG drives value of this register bit into
  4860. * swap bit of GXI/AXI. */
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4864. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4865. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4867. do { \
  4868. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4869. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4870. } while (0)
  4871. /* During Pointer write operation, SRNG drives value of this register bit into
  4872. * swap bit of GXI/AXI. */
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4876. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4877. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4879. do { \
  4880. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4881. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4882. } while (0)
  4883. /* During any data or TLV write operation, SRNG drives value of this register
  4884. * bit into swap bit of GXI/AXI. */
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4888. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4889. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4891. do { \
  4892. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4893. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4894. } while (0)
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4897. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4898. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4899. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4900. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4901. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4902. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4903. do { \
  4904. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4905. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4906. } while (0)
  4907. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4908. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4909. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4910. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4911. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4912. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4915. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4916. } while (0)
  4917. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4918. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4919. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4920. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4921. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4922. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4923. do { \
  4924. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4925. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4926. } while (0)
  4927. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4928. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4929. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4930. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4931. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4932. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4933. do { \
  4934. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4935. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4936. } while (0)
  4937. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4938. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4939. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4940. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4941. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4942. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4945. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4946. } while (0)
  4947. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4948. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4949. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4950. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4951. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4952. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4955. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4956. } while (0)
  4957. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4958. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4959. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4960. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4961. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4962. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4965. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4966. } while (0)
  4967. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4968. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4969. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4970. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4971. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4972. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4975. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4976. } while (0)
  4977. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4978. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4979. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4980. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4981. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4982. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4983. do { \
  4984. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4985. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4986. } while (0)
  4987. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4988. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4989. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4990. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4991. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4992. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4993. do { \
  4994. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4995. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4996. } while (0)
  4997. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4998. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4999. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5000. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5001. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5002. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5003. do { \
  5004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5005. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5006. } while (0)
  5007. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5008. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5009. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5010. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5011. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5012. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5013. do { \
  5014. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5015. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5016. } while (0)
  5017. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5018. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5019. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5020. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5021. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5022. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5023. do { \
  5024. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5025. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5026. } while (0)
  5027. /**
  5028. * @brief host -> target RX ring selection config message
  5029. *
  5030. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5031. *
  5032. * @details
  5033. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5034. * configure RXDMA rings.
  5035. * The configuration is per ring based and includes both packet subtypes
  5036. * and PPDU/MPDU TLVs.
  5037. *
  5038. * The message would appear as follows:
  5039. *
  5040. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5041. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5042. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5043. * |-------------------------------------------------------------------|
  5044. * | rsvd2 | ring_buffer_size |
  5045. * |-------------------------------------------------------------------|
  5046. * | packet_type_enable_flags_0 |
  5047. * |-------------------------------------------------------------------|
  5048. * | packet_type_enable_flags_1 |
  5049. * |-------------------------------------------------------------------|
  5050. * | packet_type_enable_flags_2 |
  5051. * |-------------------------------------------------------------------|
  5052. * | packet_type_enable_flags_3 |
  5053. * |-------------------------------------------------------------------|
  5054. * | tlv_filter_in_flags |
  5055. * |-------------------------------------------------------------------|
  5056. * | rx_header_offset | rx_packet_offset |
  5057. * |-------------------------------------------------------------------|
  5058. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5059. * |-------------------------------------------------------------------|
  5060. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5061. * |-------------------------------------------------------------------|
  5062. * | rsvd3 | rx_attention_offset |
  5063. * |-------------------------------------------------------------------|
  5064. * | rsvd4 | mo| fp| rx_drop_threshold |
  5065. * | |ndp|ndp| |
  5066. * |-------------------------------------------------------------------|
  5067. * Where:
  5068. * PS = pkt_swap
  5069. * SS = status_swap
  5070. * OV = rx_offsets_valid
  5071. * DT = drop_thresh_valid
  5072. * The message is interpreted as follows:
  5073. * dword0 - b'0:7 - msg_type: This will be set to
  5074. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5075. * b'8:15 - pdev_id:
  5076. * 0 (for rings at SOC/UMAC level),
  5077. * 1/2/3 mac id (for rings at LMAC level)
  5078. * b'16:23 - ring_id : Identify the ring to configure.
  5079. * More details can be got from enum htt_srng_ring_id
  5080. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5081. * BUF_RING_CFG_0 defs within HW .h files,
  5082. * e.g. wmac_top_reg_seq_hwioreg.h
  5083. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5084. * BUF_RING_CFG_0 defs within HW .h files,
  5085. * e.g. wmac_top_reg_seq_hwioreg.h
  5086. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5087. * configuration fields are valid
  5088. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5089. * rx_drop_threshold field is valid
  5090. * b'28 - rx_mon_global_en: Enable/Disable global register
  5091. 8 configuration in Rx monitor module.
  5092. * b'29:31 - rsvd1: reserved for future use
  5093. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5094. * in byte units.
  5095. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5096. * b'16:18 - config_length_mgmt (MGMT):
  5097. * Represents the length of mpdu bytes for mgmt pkt.
  5098. * valid values:
  5099. * 001 - 64bytes
  5100. * 010 - 128bytes
  5101. * 100 - 256bytes
  5102. * 111 - Full mpdu bytes
  5103. * b'19:21 - config_length_ctrl (CTRL):
  5104. * Represents the length of mpdu bytes for ctrl pkt.
  5105. * valid values:
  5106. * 001 - 64bytes
  5107. * 010 - 128bytes
  5108. * 100 - 256bytes
  5109. * 111 - Full mpdu bytes
  5110. * b'22:24 - config_length_data (DATA):
  5111. * Represents the length of mpdu bytes for data pkt.
  5112. * valid values:
  5113. * 001 - 64bytes
  5114. * 010 - 128bytes
  5115. * 100 - 256bytes
  5116. * 111 - Full mpdu bytes
  5117. * b'25:26 - rx_hdr_len:
  5118. * Specifies the number of bytes of recvd packet to copy
  5119. * into the rx_hdr tlv.
  5120. * supported values for now by host:
  5121. * 01 - 64bytes
  5122. * 10 - 128bytes
  5123. * 11 - 256bytes
  5124. * default - 128 bytes
  5125. * b'27:31 - rsvd2: Reserved for future use
  5126. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5127. * Enable MGMT packet from 0b0000 to 0b1001
  5128. * bits from low to high: FP, MD, MO - 3 bits
  5129. * FP: Filter_Pass
  5130. * MD: Monitor_Direct
  5131. * MO: Monitor_Other
  5132. * 10 mgmt subtypes * 3 bits -> 30 bits
  5133. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5134. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5135. * Enable MGMT packet from 0b1010 to 0b1111
  5136. * bits from low to high: FP, MD, MO - 3 bits
  5137. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5138. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5139. * Enable CTRL packet from 0b0000 to 0b1001
  5140. * bits from low to high: FP, MD, MO - 3 bits
  5141. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5142. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5143. * Enable CTRL packet from 0b1010 to 0b1111,
  5144. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5145. * bits from low to high: FP, MD, MO - 3 bits
  5146. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5147. * dword6 - b'0:31 - tlv_filter_in_flags:
  5148. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5149. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5150. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5151. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5152. * A value of 0 will be considered as ignore this config.
  5153. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5154. * e.g. wmac_top_reg_seq_hwioreg.h
  5155. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5156. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5157. * A value of 0 will be considered as ignore this config.
  5158. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5159. * e.g. wmac_top_reg_seq_hwioreg.h
  5160. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5161. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5162. * A value of 0 will be considered as ignore this config.
  5163. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5164. * e.g. wmac_top_reg_seq_hwioreg.h
  5165. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5166. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5167. * A value of 0 will be considered as ignore this config.
  5168. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5169. * e.g. wmac_top_reg_seq_hwioreg.h
  5170. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5171. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5172. * A value of 0 will be considered as ignore this config.
  5173. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5174. * e.g. wmac_top_reg_seq_hwioreg.h
  5175. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5176. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5177. * A value of 0 will be considered as ignore this config.
  5178. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5179. * e.g. wmac_top_reg_seq_hwioreg.h
  5180. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5181. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5182. * A value of 0 will be considered as ignore this config.
  5183. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5184. * e.g. wmac_top_reg_seq_hwioreg.h
  5185. * - b'16:31 - rsvd3 for future use
  5186. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5187. * to source rings. Consumer drops packets if the available
  5188. * words in the ring falls below the configured threshold
  5189. * value.
  5190. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5191. * by host. 1 -> subscribed
  5192. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5193. * by host. 1 -> subscribed
  5194. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5195. * subscribed by host. 1 -> subscribed
  5196. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5197. * selection for the FP PHY ERR status tlv.
  5198. * 0 - wbm2rxdma_buf_source_ring
  5199. * 1 - fw2rxdma_buf_source_ring
  5200. * 2 - sw2rxdma_buf_source_ring
  5201. * 3 - no_buffer_ring
  5202. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5203. * selection for the FP PHY ERR status tlv.
  5204. * 0 - rxdma_release_ring
  5205. * 1 - rxdma2fw_ring
  5206. * 2 - rxdma2sw_ring
  5207. * 3 - rxdma2reo_ring
  5208. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5209. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5210. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5211. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5212. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5213. * 0: MSDU level logging
  5214. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5215. * 0: MSDU level logging
  5216. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5217. * 0: MSDU level logging
  5218. * - b'23 - word_mask_compaction: enable/disable word mask for
  5219. * mpdu/msdu start/end tlvs
  5220. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5221. * manager override
  5222. * - b'25:28 - rbm_override_val: return buffer manager override value
  5223. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5224. * which have to be posted to host from phy.
  5225. * Corresponding to errors defined in
  5226. * phyrx_abort_request_reason enums 0 to 31.
  5227. * Refer to RXPCU register definition header files for the
  5228. * phyrx_abort_request_reason enum definition.
  5229. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5230. * errors which have to be posted to host from phy.
  5231. * Corresponding to errors defined in
  5232. * phyrx_abort_request_reason enums 32 to 63.
  5233. * Refer to RXPCU register definition header files for the
  5234. * phyrx_abort_request_reason enum definition.
  5235. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5236. * applicable if word mask enabled
  5237. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5238. * applicable if word mask enabled
  5239. * - b'19:31 - rsvd7
  5240. * dword15- b'0:16 - rx_msdu_end_word_mask
  5241. * - b'17:31 - rsvd5
  5242. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5243. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5244. * buffer
  5245. * 1: RX_PKT TLV logging at specified offset for the
  5246. * subsequent buffer
  5247. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5248. */
  5249. PREPACK struct htt_rx_ring_selection_cfg_t {
  5250. A_UINT32 msg_type: 8,
  5251. pdev_id: 8,
  5252. ring_id: 8,
  5253. status_swap: 1,
  5254. pkt_swap: 1,
  5255. rx_offsets_valid: 1,
  5256. drop_thresh_valid: 1,
  5257. rx_mon_global_en: 1,
  5258. rsvd1: 3;
  5259. A_UINT32 ring_buffer_size: 16,
  5260. config_length_mgmt:3,
  5261. config_length_ctrl:3,
  5262. config_length_data:3,
  5263. rx_hdr_len: 2,
  5264. rsvd2: 5;
  5265. A_UINT32 packet_type_enable_flags_0;
  5266. A_UINT32 packet_type_enable_flags_1;
  5267. A_UINT32 packet_type_enable_flags_2;
  5268. A_UINT32 packet_type_enable_flags_3;
  5269. A_UINT32 tlv_filter_in_flags;
  5270. A_UINT32 rx_packet_offset: 16,
  5271. rx_header_offset: 16;
  5272. A_UINT32 rx_mpdu_end_offset: 16,
  5273. rx_mpdu_start_offset: 16;
  5274. A_UINT32 rx_msdu_end_offset: 16,
  5275. rx_msdu_start_offset: 16;
  5276. A_UINT32 rx_attn_offset: 16,
  5277. rsvd3: 16;
  5278. A_UINT32 rx_drop_threshold: 10,
  5279. fp_ndp: 1,
  5280. mo_ndp: 1,
  5281. fp_phy_err: 1,
  5282. fp_phy_err_buf_src: 2,
  5283. fp_phy_err_buf_dest: 2,
  5284. pkt_type_enable_msdu_or_mpdu_logging:3,
  5285. dma_mpdu_mgmt: 1,
  5286. dma_mpdu_ctrl: 1,
  5287. dma_mpdu_data: 1,
  5288. word_mask_compaction_enable:1,
  5289. rbm_override_enable: 1,
  5290. rbm_override_val: 4,
  5291. rsvd4: 3;
  5292. A_UINT32 phy_err_mask;
  5293. A_UINT32 phy_err_mask_cont;
  5294. A_UINT32 rx_mpdu_start_word_mask:16,
  5295. rx_mpdu_end_word_mask: 3,
  5296. rsvd7: 13;
  5297. A_UINT32 rx_msdu_end_word_mask: 17,
  5298. rsvd5: 15;
  5299. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5300. rx_pkt_tlv_offset: 15,
  5301. rsvd6: 16;
  5302. } POSTPACK;
  5303. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5304. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5305. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5306. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5307. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5308. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5309. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5310. do { \
  5311. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5312. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5313. } while (0)
  5314. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5315. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5316. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5317. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5318. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5319. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5320. do { \
  5321. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5322. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5323. } while (0)
  5324. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5325. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5326. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5327. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5328. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5329. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5330. do { \
  5331. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5332. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5333. } while (0)
  5334. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5335. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5336. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5337. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5338. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5339. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5340. do { \
  5341. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5342. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5343. } while (0)
  5344. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5345. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5347. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5348. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5349. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5350. do { \
  5351. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5352. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5353. } while (0)
  5354. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5355. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5356. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5357. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5358. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5359. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5360. do { \
  5361. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5362. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5363. } while (0)
  5364. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5365. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5366. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5367. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5368. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5369. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5370. do { \
  5371. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5372. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5373. } while (0)
  5374. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5375. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5376. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5377. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5378. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5379. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5380. do { \
  5381. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5382. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5383. } while (0)
  5384. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5385. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5387. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5388. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5389. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5390. do { \
  5391. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5392. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5393. } while (0)
  5394. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5395. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5396. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5397. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5398. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5399. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5400. do { \
  5401. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5402. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5403. } while (0)
  5404. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5405. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5406. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5407. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5408. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5409. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5410. do { \
  5411. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5412. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5413. } while (0)
  5414. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5415. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5416. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5417. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5418. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5419. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5420. do { \
  5421. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5422. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5423. } while(0)
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5427. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5428. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5430. do { \
  5431. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5432. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5433. } while (0)
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5437. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5438. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5440. do { \
  5441. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5442. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5443. } while (0)
  5444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5447. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5448. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5450. do { \
  5451. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5452. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5453. } while (0)
  5454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5457. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5458. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5460. do { \
  5461. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5462. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5463. } while (0)
  5464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5467. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5468. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5469. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5470. do { \
  5471. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5472. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5473. } while (0)
  5474. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5475. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5477. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5478. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5482. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5483. } while (0)
  5484. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5485. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5487. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5488. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5489. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5492. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5493. } while (0)
  5494. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5495. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5497. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5498. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5499. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5500. do { \
  5501. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5502. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5503. } while (0)
  5504. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5505. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5507. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5508. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5509. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5512. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5513. } while (0)
  5514. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5515. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5517. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5518. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5522. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5523. } while (0)
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5527. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5528. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5532. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5533. } while (0)
  5534. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5535. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5537. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5538. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5542. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5543. } while (0)
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5547. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5548. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5550. do { \
  5551. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5552. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5553. } while (0)
  5554. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5555. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5556. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5557. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5558. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5559. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5560. do { \
  5561. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5562. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5563. } while (0)
  5564. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5565. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5566. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5567. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5568. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5569. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5572. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5573. } while (0)
  5574. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5575. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5577. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5578. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5579. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5583. } while (0)
  5584. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5585. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5586. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5587. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5588. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5589. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5590. do { \
  5591. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5592. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5593. } while (0)
  5594. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5595. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5596. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5597. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5598. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5599. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5602. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5603. } while (0)
  5604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5607. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5608. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5610. do { \
  5611. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5612. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5613. } while (0)
  5614. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5615. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5617. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5618. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5619. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5620. do { \
  5621. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5622. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5623. } while (0)
  5624. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5625. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5626. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5627. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5628. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5629. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5630. do { \
  5631. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5632. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5633. } while (0)
  5634. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5635. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5636. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5637. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5638. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5639. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5640. do { \
  5641. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5642. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5643. } while (0)
  5644. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5645. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5646. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5647. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5648. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5649. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5652. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5653. } while (0)
  5654. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5655. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5656. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5657. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5658. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5659. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5660. do { \
  5661. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5662. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5663. } while (0)
  5664. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5665. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5666. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5667. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5668. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5669. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5670. do { \
  5671. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5672. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5673. } while (0)
  5674. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5675. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5676. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5677. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5678. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5679. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5682. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5683. } while (0)
  5684. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5685. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5686. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5687. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5688. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5689. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5690. do { \
  5691. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5692. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5693. } while (0)
  5694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5695. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5697. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5698. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5699. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5700. do { \
  5701. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5702. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5703. } while (0)
  5704. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5705. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5707. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5708. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5709. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5710. do { \
  5711. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5712. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5713. } while (0)
  5714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5715. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5717. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5718. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5719. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5720. do { \
  5721. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5722. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5723. } while (0)
  5724. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5725. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5726. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5727. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5728. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5729. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5730. do { \
  5731. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5732. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5733. } while (0)
  5734. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5735. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5736. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5737. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5738. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5739. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5740. do { \
  5741. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5742. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5743. } while (0)
  5744. /*
  5745. * Subtype based MGMT frames enable bits.
  5746. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5747. */
  5748. /* association request */
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5755. /* association response */
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5762. /* Reassociation request */
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5769. /* Reassociation response */
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5776. /* Probe request */
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5783. /* Probe response */
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5790. /* Timing Advertisement */
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5797. /* Reserved */
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5804. /* Beacon */
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5811. /* ATIM */
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5818. /* Disassociation */
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5825. /* Authentication */
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5832. /* Deauthentication */
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5839. /* Action */
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5846. /* Action No Ack */
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5853. /* Reserved */
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5860. /*
  5861. * Subtype based CTRL frames enable bits.
  5862. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5863. */
  5864. /* Reserved */
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5871. /* Reserved */
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5878. /* Reserved */
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5885. /* Reserved */
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5892. /* Reserved */
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5899. /* Reserved */
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5906. /* Reserved */
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5913. /* Control Wrapper */
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5920. /* Block Ack Request */
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5927. /* Block Ack*/
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5934. /* PS-POLL */
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5941. /* RTS */
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5948. /* CTS */
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5955. /* ACK */
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5962. /* CF-END */
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5969. /* CF-END + CF-ACK */
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5976. /* Multicast data */
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5983. /* Unicast data */
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5990. /* NULL data */
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5998. do { \
  5999. HTT_CHECK_SET_VAL(httsym, value); \
  6000. (word) |= (value) << httsym##_S; \
  6001. } while (0)
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6003. (((word) & httsym##_M) >> httsym##_S)
  6004. #define htt_rx_ring_pkt_enable_subtype_set( \
  6005. word, flag, mode, type, subtype, val) \
  6006. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6007. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6008. #define htt_rx_ring_pkt_enable_subtype_get( \
  6009. word, flag, mode, type, subtype) \
  6010. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6011. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6012. /* Definition to filter in TLVs */
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6041. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6042. do { \
  6043. HTT_CHECK_SET_VAL(httsym, enable); \
  6044. (word) |= (enable) << httsym##_S; \
  6045. } while (0)
  6046. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6047. (((word) & httsym##_M) >> httsym##_S)
  6048. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6049. HTT_RX_RING_TLV_ENABLE_SET( \
  6050. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6051. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6052. HTT_RX_RING_TLV_ENABLE_GET( \
  6053. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6054. /**
  6055. * @brief host -> target TX monitor config message
  6056. *
  6057. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6058. *
  6059. * @details
  6060. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6061. * configure RXDMA rings.
  6062. * The configuration is per ring based and includes both packet types
  6063. * and PPDU/MPDU TLVs.
  6064. *
  6065. * The message would appear as follows:
  6066. *
  6067. * |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|
  6068. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6069. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6070. * |-----------+--------+--------+-----+------------------------------------|
  6071. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6072. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6073. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6074. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6075. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6076. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6077. * |------------------------------------------------------------------------|
  6078. * | tlv_filter_mask_in0 |
  6079. * |------------------------------------------------------------------------|
  6080. * | tlv_filter_mask_in1 |
  6081. * |------------------------------------------------------------------------|
  6082. * | tlv_filter_mask_in2 |
  6083. * |------------------------------------------------------------------------|
  6084. * | tlv_filter_mask_in3 |
  6085. * |-----------------+-----------------+---------------------+--------------|
  6086. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6087. * |------------------------------------------------------------------------|
  6088. * | pcu_ppdu_setup_word_mask |
  6089. * |--------------------+--+--+--+-----+---------------------+--------------|
  6090. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6091. * |------------------------------------------------------------------------|
  6092. *
  6093. * Where:
  6094. * PS = pkt_swap
  6095. * SS = status_swap
  6096. * The message is interpreted as follows:
  6097. * dword0 - b'0:7 - msg_type: This will be set to
  6098. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6099. * b'8:15 - pdev_id:
  6100. * 0 (for rings at SOC level),
  6101. * 1/2/3 mac id (for rings at LMAC level)
  6102. * b'16:23 - ring_id : Identify the ring to configure.
  6103. * More details can be got from enum htt_srng_ring_id
  6104. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6105. * BUF_RING_CFG_0 defs within HW .h files,
  6106. * e.g. wmac_top_reg_seq_hwioreg.h
  6107. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6108. * BUF_RING_CFG_0 defs within HW .h files,
  6109. * e.g. wmac_top_reg_seq_hwioreg.h
  6110. * b'26 - tx_mon_global_en: Enable/Disable global register
  6111. * configuration in Tx monitor module.
  6112. * b'27:31 - rsvd1: reserved for future use
  6113. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6114. * in byte units.
  6115. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6116. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6117. * 64, 128, 256.
  6118. * If all 3 bits are set config length is > 256.
  6119. * if val is '0', then ignore this field.
  6120. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6121. * 64, 128, 256.
  6122. * If all 3 bits are set config length is > 256.
  6123. * if val is '0', then ignore this field.
  6124. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6125. * 64, 128, 256.
  6126. * If all 3 bits are set config length is > 256.
  6127. * If val is '0', then ignore this field.
  6128. * - b'25:31 - rsvd2: Reserved for future use
  6129. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6130. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6131. * If packet_type_enable_flags is '1' for MGMT type,
  6132. * monitor will ignore this bit and allow this TLV.
  6133. * If packet_type_enable_flags is '0' for MGMT type,
  6134. * monitor will use this bit to enable/disable logging
  6135. * of this TLV.
  6136. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6137. * If packet_type_enable_flags is '1' for CTRL type,
  6138. * monitor will ignore this bit and allow this TLV.
  6139. * If packet_type_enable_flags is '0' for CTRL type,
  6140. * monitor will use this bit to enable/disable logging
  6141. * of this TLV.
  6142. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6143. * If packet_type_enable_flags is '1' for DATA type,
  6144. * monitor will ignore this bit and allow this TLV.
  6145. * If packet_type_enable_flags is '0' for DATA type,
  6146. * monitor will use this bit to enable/disable logging
  6147. * of this TLV.
  6148. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6149. * If packet_type_enable_flags is '1' for MGMT type,
  6150. * monitor will ignore this bit and allow this TLV.
  6151. * If packet_type_enable_flags is '0' for MGMT type,
  6152. * monitor will use this bit to enable/disable logging
  6153. * of this TLV.
  6154. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6155. * If packet_type_enable_flags is '1' for CTRL type,
  6156. * monitor will ignore this bit and allow this TLV.
  6157. * If packet_type_enable_flags is '0' for CTRL type,
  6158. * monitor will use this bit to enable/disable logging
  6159. * of this TLV.
  6160. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6161. * If packet_type_enable_flags is '1' for DATA type,
  6162. * monitor will ignore this bit and allow this TLV.
  6163. * If packet_type_enable_flags is '0' for DATA type,
  6164. * monitor will use this bit to enable/disable logging
  6165. * of this TLV.
  6166. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6167. * If packet_type_enable_flags is '1' for MGMT type,
  6168. * monitor will ignore this bit and allow this TLV.
  6169. * If packet_type_enable_flags is '0' for MGMT type,
  6170. * monitor will use this bit to enable/disable logging
  6171. * of this TLV.
  6172. * If filter_in_TX_MPDU_START = 1 it is recommended
  6173. * to set this bit.
  6174. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6175. * If packet_type_enable_flags is '1' for CTRL type,
  6176. * monitor will ignore this bit and allow this TLV.
  6177. * If packet_type_enable_flags is '0' for CTRL type,
  6178. * monitor will use this bit to enable/disable logging
  6179. * of this TLV.
  6180. * If filter_in_TX_MPDU_START = 1 it is recommended
  6181. * to set this bit.
  6182. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6183. * If packet_type_enable_flags is '1' for DATA type,
  6184. * monitor will ignore this bit and allow this TLV.
  6185. * If packet_type_enable_flags is '0' for DATA type,
  6186. * monitor will use this bit to enable/disable logging
  6187. * of this TLV.
  6188. * If filter_in_TX_MPDU_START = 1 it is recommended
  6189. * to set this bit.
  6190. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6191. * If packet_type_enable_flags is '1' for MGMT type,
  6192. * monitor will ignore this bit and allow this TLV.
  6193. * If packet_type_enable_flags is '0' for MGMT type,
  6194. * monitor will use this bit to enable/disable logging
  6195. * of this TLV.
  6196. * If filter_in_TX_MSDU_START = 1 it is recommended
  6197. * to set this bit.
  6198. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6199. * If packet_type_enable_flags is '1' for CTRL type,
  6200. * monitor will ignore this bit and allow this TLV.
  6201. * If packet_type_enable_flags is '0' for CTRL type,
  6202. * monitor will use this bit to enable/disable logging
  6203. * of this TLV.
  6204. * If filter_in_TX_MSDU_START = 1 it is recommended
  6205. * to set this bit.
  6206. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6207. * If packet_type_enable_flags is '1' for DATA type,
  6208. * monitor will ignore this bit and allow this TLV.
  6209. * If packet_type_enable_flags is '0' for DATA type,
  6210. * monitor will use this bit to enable/disable logging
  6211. * of this TLV.
  6212. * If filter_in_TX_MSDU_START = 1 it is recommended
  6213. * to set this bit.
  6214. * b'15:31 - rsvd3: Reserved for future use
  6215. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6216. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6217. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6218. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6219. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6220. * - b'8:15 - tx_peer_entry_word_mask:
  6221. * - b'16:23 - tx_queue_ext_word_mask:
  6222. * - b'24:31 - tx_msdu_start_word_mask:
  6223. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6224. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6225. * - b'8:15 - rxpcu_user_setup_word_mask:
  6226. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6227. * MGMT, CTRL, DATA
  6228. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6229. * 0 -> MSDU level logging is enabled
  6230. * (valid only if bit is set in
  6231. * pkt_type_enable_msdu_or_mpdu_logging)
  6232. * 1 -> MPDU level logging is enabled
  6233. * (valid only if bit is set in
  6234. * pkt_type_enable_msdu_or_mpdu_logging)
  6235. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6236. * 0 -> MSDU level logging is enabled
  6237. * (valid only if bit is set in
  6238. * pkt_type_enable_msdu_or_mpdu_logging)
  6239. * 1 -> MPDU level logging is enabled
  6240. * (valid only if bit is set in
  6241. * pkt_type_enable_msdu_or_mpdu_logging)
  6242. * - b'21 - dma_mpdu_data(D) : For DATA
  6243. * 0 -> MSDU level logging is enabled
  6244. * (valid only if bit is set in
  6245. * pkt_type_enable_msdu_or_mpdu_logging)
  6246. * 1 -> MPDU level logging is enabled
  6247. * (valid only if bit is set in
  6248. * pkt_type_enable_msdu_or_mpdu_logging)
  6249. * - b'22:31 - rsvd4 for future use
  6250. */
  6251. PREPACK struct htt_tx_monitor_cfg_t {
  6252. A_UINT32 msg_type: 8,
  6253. pdev_id: 8,
  6254. ring_id: 8,
  6255. status_swap: 1,
  6256. pkt_swap: 1,
  6257. tx_mon_global_en: 1,
  6258. rsvd1: 5;
  6259. A_UINT32 ring_buffer_size: 16,
  6260. config_length_mgmt: 3,
  6261. config_length_ctrl: 3,
  6262. config_length_data: 3,
  6263. rsvd2: 7;
  6264. A_UINT32 pkt_type_enable_flags: 3,
  6265. filter_in_tx_mpdu_start_mgmt: 1,
  6266. filter_in_tx_mpdu_start_ctrl: 1,
  6267. filter_in_tx_mpdu_start_data: 1,
  6268. filter_in_tx_msdu_start_mgmt: 1,
  6269. filter_in_tx_msdu_start_ctrl: 1,
  6270. filter_in_tx_msdu_start_data: 1,
  6271. filter_in_tx_mpdu_end_mgmt: 1,
  6272. filter_in_tx_mpdu_end_ctrl: 1,
  6273. filter_in_tx_mpdu_end_data: 1,
  6274. filter_in_tx_msdu_end_mgmt: 1,
  6275. filter_in_tx_msdu_end_ctrl: 1,
  6276. filter_in_tx_msdu_end_data: 1,
  6277. rsvd3: 17;
  6278. A_UINT32 tlv_filter_mask_in0;
  6279. A_UINT32 tlv_filter_mask_in1;
  6280. A_UINT32 tlv_filter_mask_in2;
  6281. A_UINT32 tlv_filter_mask_in3;
  6282. A_UINT32 tx_fes_setup_word_mask: 8,
  6283. tx_peer_entry_word_mask: 8,
  6284. tx_queue_ext_word_mask: 8,
  6285. tx_msdu_start_word_mask: 8;
  6286. A_UINT32 pcu_ppdu_setup_word_mask;
  6287. A_UINT32 tx_mpdu_start_word_mask: 8,
  6288. rxpcu_user_setup_word_mask: 8,
  6289. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6290. dma_mpdu_mgmt: 1,
  6291. dma_mpdu_ctrl: 1,
  6292. dma_mpdu_data: 1,
  6293. rsvd4: 10;
  6294. } POSTPACK;
  6295. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6296. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6297. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6298. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6299. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6300. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6301. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6302. do { \
  6303. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6304. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6305. } while (0)
  6306. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6307. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6308. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6309. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6310. HTT_TX_MONITOR_CFG_RING_ID_S)
  6311. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6314. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6315. } while (0)
  6316. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6317. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6318. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6319. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6320. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6321. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6324. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6325. } while (0)
  6326. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6327. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6328. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6329. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6330. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6331. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6334. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6335. } while (0)
  6336. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6337. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6338. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6339. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6340. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6341. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6344. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6345. } while (0)
  6346. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6347. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6348. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6349. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6350. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6351. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6352. do { \
  6353. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6354. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6355. } while (0)
  6356. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6357. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6358. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6359. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6360. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6361. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6364. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6365. } while (0)
  6366. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6367. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6368. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6369. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6370. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6371. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6372. do { \
  6373. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6374. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6375. } while (0)
  6376. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6377. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6378. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6379. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6380. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6381. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6382. do { \
  6383. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6384. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6385. } while (0)
  6386. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6387. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6388. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6389. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6390. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6391. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6394. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6395. } while (0)
  6396. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6397. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6399. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6400. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6402. do { \
  6403. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6404. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6405. } while (0)
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6409. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6410. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6412. do { \
  6413. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6414. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6415. } while (0)
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6419. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6420. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6422. do { \
  6423. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6424. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6425. } while (0)
  6426. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6429. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6430. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6431. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6434. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6435. } while (0)
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6439. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6440. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6441. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6444. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6445. } while (0)
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6449. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6450. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6451. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6452. do { \
  6453. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6454. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6455. } while (0)
  6456. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6459. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6460. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6461. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6462. do { \
  6463. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6464. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6465. } while (0)
  6466. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6469. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6470. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6471. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6472. do { \
  6473. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6474. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6475. } while (0)
  6476. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6479. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6480. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6481. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6484. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6485. } while (0)
  6486. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6489. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6490. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6491. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6492. do { \
  6493. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6494. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6495. } while (0)
  6496. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6498. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6499. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6500. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6501. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6504. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6505. } while (0)
  6506. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6508. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6509. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6510. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6511. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6512. do { \
  6513. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6514. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6515. } while (0)
  6516. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6517. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6519. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6520. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6521. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6524. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6525. } while (0)
  6526. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6527. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6528. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6529. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6530. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6531. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6534. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6535. } while (0)
  6536. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6537. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6538. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6539. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6540. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6541. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6544. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6545. } while (0)
  6546. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6547. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6548. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6549. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6550. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6551. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6554. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6555. } while (0)
  6556. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6557. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6558. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6559. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6560. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6561. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6564. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6565. } while (0)
  6566. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6567. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6568. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6569. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6570. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6571. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6572. do { \
  6573. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6574. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6575. } while (0)
  6576. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6577. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6578. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6579. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6580. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6581. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6582. do { \
  6583. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6584. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6585. } while (0)
  6586. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6587. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6588. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6589. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6590. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6591. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6594. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6595. } while (0)
  6596. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6597. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6598. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6599. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6600. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6601. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6602. do { \
  6603. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6604. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6605. } while (0)
  6606. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6607. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6608. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6609. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6610. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6611. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6614. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6615. } while (0)
  6616. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6617. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6618. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6619. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6620. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6621. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6622. do { \
  6623. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6624. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6625. } while (0)
  6626. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6627. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6628. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6629. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6630. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6631. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6632. do { \
  6633. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6634. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6635. } while (0)
  6636. /*
  6637. * pkt_type_enable_flags
  6638. */
  6639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6642. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6643. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6644. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6645. /*
  6646. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6647. */
  6648. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6649. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6650. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6651. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6652. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6653. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6654. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6655. do { \
  6656. HTT_CHECK_SET_VAL(httsym, value); \
  6657. (word) |= (value) << httsym##_S; \
  6658. } while (0)
  6659. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6660. (((word) & httsym##_M) >> httsym##_S)
  6661. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6662. * type -> MGMT, CTRL, DATA*/
  6663. #define htt_tx_ring_pkt_type_set( \
  6664. word, mode, type, val) \
  6665. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6666. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6667. #define htt_tx_ring_pkt_type_get( \
  6668. word, mode, type) \
  6669. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6670. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6671. /* Definition to filter in TLVs */
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6736. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6737. do { \
  6738. HTT_CHECK_SET_VAL(httsym, enable); \
  6739. (word) |= (enable) << httsym##_S; \
  6740. } while (0)
  6741. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6742. (((word) & httsym##_M) >> httsym##_S)
  6743. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6744. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6745. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6746. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6747. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6748. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6813. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6814. do { \
  6815. HTT_CHECK_SET_VAL(httsym, enable); \
  6816. (word) |= (enable) << httsym##_S; \
  6817. } while (0)
  6818. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6819. (((word) & httsym##_M) >> httsym##_S)
  6820. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6821. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6822. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6823. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6824. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6825. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6890. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6891. do { \
  6892. HTT_CHECK_SET_VAL(httsym, enable); \
  6893. (word) |= (enable) << httsym##_S; \
  6894. } while (0)
  6895. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6896. (((word) & httsym##_M) >> httsym##_S)
  6897. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6898. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6899. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6900. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6901. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6902. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6947. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6948. do { \
  6949. HTT_CHECK_SET_VAL(httsym, enable); \
  6950. (word) |= (enable) << httsym##_S; \
  6951. } while (0)
  6952. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6953. (((word) & httsym##_M) >> httsym##_S)
  6954. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6955. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6956. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6957. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6958. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6959. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6960. /**
  6961. * @brief host --> target Receive Flow Steering configuration message definition
  6962. *
  6963. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6964. *
  6965. * host --> target Receive Flow Steering configuration message definition.
  6966. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6967. * The reason for this is we want RFS to be configured and ready before MAC
  6968. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6969. *
  6970. * |31 24|23 16|15 9|8|7 0|
  6971. * |----------------+----------------+----------------+----------------|
  6972. * | reserved |E| msg type |
  6973. * |-------------------------------------------------------------------|
  6974. * Where E = RFS enable flag
  6975. *
  6976. * The RFS_CONFIG message consists of a single 4-byte word.
  6977. *
  6978. * Header fields:
  6979. * - MSG_TYPE
  6980. * Bits 7:0
  6981. * Purpose: identifies this as a RFS config msg
  6982. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6983. * - RFS_CONFIG
  6984. * Bit 8
  6985. * Purpose: Tells target whether to enable (1) or disable (0)
  6986. * flow steering feature when sending rx indication messages to host
  6987. */
  6988. #define HTT_H2T_RFS_CONFIG_M 0x100
  6989. #define HTT_H2T_RFS_CONFIG_S 8
  6990. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6991. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6992. HTT_H2T_RFS_CONFIG_S)
  6993. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6994. do { \
  6995. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6996. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6997. } while (0)
  6998. #define HTT_RFS_CFG_REQ_BYTES 4
  6999. /**
  7000. * @brief host -> target FW extended statistics request
  7001. *
  7002. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7003. *
  7004. * @details
  7005. * The following field definitions describe the format of the HTT host
  7006. * to target FW extended stats retrieve message.
  7007. * The message specifies the type of stats the host wants to retrieve.
  7008. *
  7009. * |31 24|23 16|15 8|7 0|
  7010. * |-----------------------------------------------------------|
  7011. * | reserved | stats type | pdev_mask | msg type |
  7012. * |-----------------------------------------------------------|
  7013. * | config param [0] |
  7014. * |-----------------------------------------------------------|
  7015. * | config param [1] |
  7016. * |-----------------------------------------------------------|
  7017. * | config param [2] |
  7018. * |-----------------------------------------------------------|
  7019. * | config param [3] |
  7020. * |-----------------------------------------------------------|
  7021. * | reserved |
  7022. * |-----------------------------------------------------------|
  7023. * | cookie LSBs |
  7024. * |-----------------------------------------------------------|
  7025. * | cookie MSBs |
  7026. * |-----------------------------------------------------------|
  7027. * Header fields:
  7028. * - MSG_TYPE
  7029. * Bits 7:0
  7030. * Purpose: identifies this is a extended stats upload request message
  7031. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7032. * - PDEV_MASK
  7033. * Bits 8:15
  7034. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7035. * Value: This is a overloaded field, refer to usage and interpretation of
  7036. * PDEV in interface document.
  7037. * Bit 8 : Reserved for SOC stats
  7038. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7039. * Indicates MACID_MASK in DBS
  7040. * - STATS_TYPE
  7041. * Bits 23:16
  7042. * Purpose: identifies which FW statistics to upload
  7043. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7044. * - Reserved
  7045. * Bits 31:24
  7046. * - CONFIG_PARAM [0]
  7047. * Bits 31:0
  7048. * Purpose: give an opaque configuration value to the specified stats type
  7049. * Value: stats-type specific configuration value
  7050. * Refer to htt_stats.h for interpretation for each stats sub_type
  7051. * - CONFIG_PARAM [1]
  7052. * Bits 31:0
  7053. * Purpose: give an opaque configuration value to the specified stats type
  7054. * Value: stats-type specific configuration value
  7055. * Refer to htt_stats.h for interpretation for each stats sub_type
  7056. * - CONFIG_PARAM [2]
  7057. * Bits 31:0
  7058. * Purpose: give an opaque configuration value to the specified stats type
  7059. * Value: stats-type specific configuration value
  7060. * Refer to htt_stats.h for interpretation for each stats sub_type
  7061. * - CONFIG_PARAM [3]
  7062. * Bits 31:0
  7063. * Purpose: give an opaque configuration value to the specified stats type
  7064. * Value: stats-type specific configuration value
  7065. * Refer to htt_stats.h for interpretation for each stats sub_type
  7066. * - Reserved [31:0] for future use.
  7067. * - COOKIE_LSBS
  7068. * Bits 31:0
  7069. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7070. * message with its preceding host->target stats request message.
  7071. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7072. * - COOKIE_MSBS
  7073. * Bits 31:0
  7074. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7075. * message with its preceding host->target stats request message.
  7076. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7077. */
  7078. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7079. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7080. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7081. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7082. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7083. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7084. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7085. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7086. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7087. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7088. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7091. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7092. } while (0)
  7093. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7094. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7095. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7096. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7097. do { \
  7098. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7099. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7100. } while (0)
  7101. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7102. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7103. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7104. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7105. do { \
  7106. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7107. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7108. } while (0)
  7109. /**
  7110. * @brief host -> target FW streaming statistics request
  7111. *
  7112. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7113. *
  7114. * @details
  7115. * The following field definitions describe the format of the HTT host
  7116. * to target message that requests the target to start or stop producing
  7117. * ongoing stats of the specified type.
  7118. *
  7119. * |31|30 |23 16|15 8|7 0|
  7120. * |-----------------------------------------------------------|
  7121. * |EN| reserved | stats type | reserved | msg type |
  7122. * |-----------------------------------------------------------|
  7123. * | config param [0] |
  7124. * |-----------------------------------------------------------|
  7125. * | config param [1] |
  7126. * |-----------------------------------------------------------|
  7127. * | config param [2] |
  7128. * |-----------------------------------------------------------|
  7129. * | config param [3] |
  7130. * |-----------------------------------------------------------|
  7131. * Where:
  7132. * - EN is an enable/disable flag
  7133. * Header fields:
  7134. * - MSG_TYPE
  7135. * Bits 7:0
  7136. * Purpose: identifies this is a streaming stats upload request message
  7137. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7138. * - STATS_TYPE
  7139. * Bits 23:16
  7140. * Purpose: identifies which FW statistics to upload
  7141. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7142. * Only the htt_dbg_ext_stats_type values identified as streaming
  7143. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7144. * - ENABLE
  7145. * Bit 31
  7146. * Purpose: enable/disable the target's ongoing stats of the specified type
  7147. * Value:
  7148. * 0 - disable ongoing production of the specified stats type
  7149. * 1 - enable ongoing production of the specified stats type
  7150. * - CONFIG_PARAM [0]
  7151. * Bits 31:0
  7152. * Purpose: give an opaque configuration value to the specified stats type
  7153. * Value: stats-type specific configuration value
  7154. * Refer to htt_stats.h for interpretation for each stats sub_type
  7155. * - CONFIG_PARAM [1]
  7156. * Bits 31:0
  7157. * Purpose: give an opaque configuration value to the specified stats type
  7158. * Value: stats-type specific configuration value
  7159. * Refer to htt_stats.h for interpretation for each stats sub_type
  7160. * - CONFIG_PARAM [2]
  7161. * Bits 31:0
  7162. * Purpose: give an opaque configuration value to the specified stats type
  7163. * Value: stats-type specific configuration value
  7164. * Refer to htt_stats.h for interpretation for each stats sub_type
  7165. * - CONFIG_PARAM [3]
  7166. * Bits 31:0
  7167. * Purpose: give an opaque configuration value to the specified stats type
  7168. * Value: stats-type specific configuration value
  7169. * Refer to htt_stats.h for interpretation for each stats sub_type
  7170. */
  7171. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7172. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7173. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7174. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7175. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7176. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7177. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7178. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7179. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7180. do { \
  7181. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7182. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7183. } while (0)
  7184. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7185. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7186. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7187. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7188. do { \
  7189. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7190. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7191. } while (0)
  7192. /**
  7193. * @brief host -> target FW PPDU_STATS request message
  7194. *
  7195. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7196. *
  7197. * @details
  7198. * The following field definitions describe the format of the HTT host
  7199. * to target FW for PPDU_STATS_CFG msg.
  7200. * The message allows the host to configure the PPDU_STATS_IND messages
  7201. * produced by the target.
  7202. *
  7203. * |31 24|23 16|15 8|7 0|
  7204. * |-----------------------------------------------------------|
  7205. * | REQ bit mask | pdev_mask | msg type |
  7206. * |-----------------------------------------------------------|
  7207. * Header fields:
  7208. * - MSG_TYPE
  7209. * Bits 7:0
  7210. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7211. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7212. * - PDEV_MASK
  7213. * Bits 8:15
  7214. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7215. * Value: This is a overloaded field, refer to usage and interpretation of
  7216. * PDEV in interface document.
  7217. * Bit 8 : Reserved for SOC stats
  7218. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7219. * Indicates MACID_MASK in DBS
  7220. * - REQ_TLV_BIT_MASK
  7221. * Bits 16:31
  7222. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7223. * needs to be included in the target's PPDU_STATS_IND messages.
  7224. * Value: refer htt_ppdu_stats_tlv_tag_t
  7225. *
  7226. */
  7227. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7228. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7229. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7230. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7231. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7232. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7233. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7234. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7235. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7238. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7239. } while (0)
  7240. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7241. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7242. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7243. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7244. do { \
  7245. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7246. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7247. } while (0)
  7248. /**
  7249. * @brief Host-->target HTT RX FSE setup message
  7250. *
  7251. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7252. *
  7253. * @details
  7254. * Through this message, the host will provide details of the flow tables
  7255. * in host DDR along with hash keys.
  7256. * This message can be sent per SOC or per PDEV, which is differentiated
  7257. * by pdev id values.
  7258. * The host will allocate flow search table and sends table size,
  7259. * physical DMA address of flow table, and hash keys to firmware to
  7260. * program into the RXOLE FSE HW block.
  7261. *
  7262. * The following field definitions describe the format of the RX FSE setup
  7263. * message sent from the host to target
  7264. *
  7265. * Header fields:
  7266. * dword0 - b'7:0 - msg_type: This will be set to
  7267. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7268. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7269. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7270. * pdev's LMAC ring.
  7271. * b'31:16 - reserved : Reserved for future use
  7272. * dword1 - b'19:0 - number of records: This field indicates the number of
  7273. * entries in the flow table. For example: 8k number of
  7274. * records is equivalent to
  7275. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7276. * b'27:20 - max search: This field specifies the skid length to FSE
  7277. * parser HW module whenever match is not found at the
  7278. * exact index pointed by hash.
  7279. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7280. * Refer htt_ip_da_sa_prefix below for more details.
  7281. * b'31:30 - reserved: Reserved for future use
  7282. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7283. * table allocated by host in DDR
  7284. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7285. * table allocated by host in DDR
  7286. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7287. * entry hashing
  7288. *
  7289. *
  7290. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7291. * |---------------------------------------------------------------|
  7292. * | reserved | pdev_id | MSG_TYPE |
  7293. * |---------------------------------------------------------------|
  7294. * |resvd|IPDSA| max_search | Number of records |
  7295. * |---------------------------------------------------------------|
  7296. * | base address lo |
  7297. * |---------------------------------------------------------------|
  7298. * | base address high |
  7299. * |---------------------------------------------------------------|
  7300. * | toeplitz key 31_0 |
  7301. * |---------------------------------------------------------------|
  7302. * | toeplitz key 63_32 |
  7303. * |---------------------------------------------------------------|
  7304. * | toeplitz key 95_64 |
  7305. * |---------------------------------------------------------------|
  7306. * | toeplitz key 127_96 |
  7307. * |---------------------------------------------------------------|
  7308. * | toeplitz key 159_128 |
  7309. * |---------------------------------------------------------------|
  7310. * | toeplitz key 191_160 |
  7311. * |---------------------------------------------------------------|
  7312. * | toeplitz key 223_192 |
  7313. * |---------------------------------------------------------------|
  7314. * | toeplitz key 255_224 |
  7315. * |---------------------------------------------------------------|
  7316. * | toeplitz key 287_256 |
  7317. * |---------------------------------------------------------------|
  7318. * | reserved | toeplitz key 314_288(26:0 bits) |
  7319. * |---------------------------------------------------------------|
  7320. * where:
  7321. * IPDSA = ip_da_sa
  7322. */
  7323. /**
  7324. * @brief: htt_ip_da_sa_prefix
  7325. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7326. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7327. * documentation per RFC3849
  7328. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7329. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7330. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7331. */
  7332. enum htt_ip_da_sa_prefix {
  7333. HTT_RX_IPV6_20010db8,
  7334. HTT_RX_IPV4_MAPPED_IPV6,
  7335. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7336. HTT_RX_IPV6_64FF9B,
  7337. };
  7338. /**
  7339. * @brief Host-->target HTT RX FISA configure and enable
  7340. *
  7341. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7342. *
  7343. * @details
  7344. * The host will send this command down to configure and enable the FISA
  7345. * operational params.
  7346. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7347. * register.
  7348. * Should configure both the MACs.
  7349. *
  7350. * dword0 - b'7:0 - msg_type:
  7351. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7352. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7353. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7354. * pdev's LMAC ring.
  7355. * b'31:16 - reserved : Reserved for future use
  7356. *
  7357. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7358. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7359. * packets. 1 flow search will be skipped
  7360. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7361. * tcp,udp packets
  7362. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7363. * calculation
  7364. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7365. * calculation
  7366. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7367. * calculation
  7368. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7369. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7370. * length
  7371. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7372. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7373. * length
  7374. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7375. * num jump
  7376. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7377. * num jump
  7378. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7379. * data type switch has happend for MPDU Sequence num jump
  7380. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7381. * for MPDU Sequence num jump
  7382. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7383. * for decrypt errors
  7384. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7385. * while aggregating a msdu
  7386. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7387. * The aggregation is done until (number of MSDUs aggregated
  7388. * < LIMIT + 1)
  7389. * b'31:18 - Reserved
  7390. *
  7391. * fisa_control_value - 32bit value FW can write to register
  7392. *
  7393. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7394. * Threshold value for FISA timeout (units are microseconds).
  7395. * When the global timestamp exceeds this threshold, FISA
  7396. * aggregation will be restarted.
  7397. * A value of 0 means timeout is disabled.
  7398. * Compare the threshold register with timestamp field in
  7399. * flow entry to generate timeout for the flow.
  7400. *
  7401. * |31 18 |17 16|15 8|7 0|
  7402. * |-------------------------------------------------------------|
  7403. * | reserved | pdev_mask | msg type |
  7404. * |-------------------------------------------------------------|
  7405. * | reserved | FISA_CTRL |
  7406. * |-------------------------------------------------------------|
  7407. * | FISA_TIMEOUT_THRESH |
  7408. * |-------------------------------------------------------------|
  7409. */
  7410. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7411. A_UINT32 msg_type:8,
  7412. pdev_id:8,
  7413. reserved0:16;
  7414. /**
  7415. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7416. * [17:0]
  7417. */
  7418. union {
  7419. /*
  7420. * fisa_control_bits structure is deprecated.
  7421. * Please use fisa_control_bits_v2 going forward.
  7422. */
  7423. struct {
  7424. A_UINT32 fisa_enable: 1,
  7425. ipsec_skip_search: 1,
  7426. nontcp_skip_search: 1,
  7427. add_ipv4_fixed_hdr_len: 1,
  7428. add_ipv6_fixed_hdr_len: 1,
  7429. add_tcp_fixed_hdr_len: 1,
  7430. add_udp_hdr_len: 1,
  7431. chksum_cum_ip_len_en: 1,
  7432. disable_tid_check: 1,
  7433. disable_ta_check: 1,
  7434. disable_qos_check: 1,
  7435. disable_raw_check: 1,
  7436. disable_decrypt_err_check: 1,
  7437. disable_msdu_drop_check: 1,
  7438. fisa_aggr_limit: 4,
  7439. reserved: 14;
  7440. } fisa_control_bits;
  7441. struct {
  7442. A_UINT32 fisa_enable: 1,
  7443. fisa_aggr_limit: 4,
  7444. reserved: 27;
  7445. } fisa_control_bits_v2;
  7446. A_UINT32 fisa_control_value;
  7447. } u_fisa_control;
  7448. /**
  7449. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7450. * timeout threshold for aggregation. Unit in usec.
  7451. * [31:0]
  7452. */
  7453. A_UINT32 fisa_timeout_threshold;
  7454. } POSTPACK;
  7455. /* DWord 0: pdev-ID */
  7456. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7457. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7458. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7459. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7460. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7461. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7462. do { \
  7463. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7464. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7465. } while (0)
  7466. /* Dword 1: fisa_control_value fisa config */
  7467. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7468. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7469. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7470. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7471. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7472. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7473. do { \
  7474. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7475. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7476. } while (0)
  7477. /* Dword 1: fisa_control_value ipsec_skip_search */
  7478. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7479. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7480. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7481. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7482. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7483. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7484. do { \
  7485. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7486. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7487. } while (0)
  7488. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7489. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7490. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7491. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7492. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7493. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7494. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7497. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7498. } while (0)
  7499. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7500. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7501. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7502. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7503. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7504. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7505. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7508. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7509. } while (0)
  7510. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7511. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7512. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7513. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7514. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7515. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7516. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7517. do { \
  7518. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7519. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7520. } while (0)
  7521. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7522. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7523. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7524. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7525. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7526. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7527. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7528. do { \
  7529. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7530. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7531. } while (0)
  7532. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7533. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7534. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7535. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7536. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7537. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7538. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7539. do { \
  7540. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7541. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7542. } while (0)
  7543. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7544. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7545. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7546. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7547. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7548. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7549. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7550. do { \
  7551. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7552. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7553. } while (0)
  7554. /* Dword 1: fisa_control_value disable_tid_check */
  7555. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7556. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7557. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7558. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7559. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7560. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7561. do { \
  7562. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7563. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7564. } while (0)
  7565. /* Dword 1: fisa_control_value disable_ta_check */
  7566. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7567. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7568. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7569. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7570. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7571. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7572. do { \
  7573. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7574. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7575. } while (0)
  7576. /* Dword 1: fisa_control_value disable_qos_check */
  7577. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7578. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7579. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7580. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7581. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7582. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7583. do { \
  7584. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7585. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7586. } while (0)
  7587. /* Dword 1: fisa_control_value disable_raw_check */
  7588. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7589. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7590. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7591. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7592. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7593. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7594. do { \
  7595. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7596. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7597. } while (0)
  7598. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7599. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7600. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7601. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7602. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7603. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7604. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7605. do { \
  7606. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7607. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7608. } while (0)
  7609. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7610. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7611. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7612. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7613. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7614. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7615. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7616. do { \
  7617. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7618. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7619. } while (0)
  7620. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7621. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7622. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7623. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7624. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7625. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7626. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7627. do { \
  7628. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7629. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7630. } while (0)
  7631. /* Dword 1: fisa_control_value fisa config */
  7632. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7633. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7634. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7635. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7636. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7637. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7638. do { \
  7639. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7640. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7641. } while (0)
  7642. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7643. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7644. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7645. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7646. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7647. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7648. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7649. do { \
  7650. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7651. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7652. } while (0)
  7653. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7654. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7655. pdev_id:8,
  7656. reserved0:16;
  7657. A_UINT32 num_records:20,
  7658. max_search:8,
  7659. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7660. reserved1:2;
  7661. A_UINT32 base_addr_lo;
  7662. A_UINT32 base_addr_hi;
  7663. A_UINT32 toeplitz31_0;
  7664. A_UINT32 toeplitz63_32;
  7665. A_UINT32 toeplitz95_64;
  7666. A_UINT32 toeplitz127_96;
  7667. A_UINT32 toeplitz159_128;
  7668. A_UINT32 toeplitz191_160;
  7669. A_UINT32 toeplitz223_192;
  7670. A_UINT32 toeplitz255_224;
  7671. A_UINT32 toeplitz287_256;
  7672. A_UINT32 toeplitz314_288:27,
  7673. reserved2:5;
  7674. } POSTPACK;
  7675. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7676. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7677. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7678. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7679. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7680. /* DWORD 0: Pdev ID */
  7681. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7682. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7683. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7684. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7685. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7686. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7687. do { \
  7688. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7689. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7690. } while (0)
  7691. /* DWORD 1:num of records */
  7692. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7693. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7694. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7695. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7696. HTT_RX_FSE_SETUP_NUM_REC_S)
  7697. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7698. do { \
  7699. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7700. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7701. } while (0)
  7702. /* DWORD 1:max_search */
  7703. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7704. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7705. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7706. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7707. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7708. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7709. do { \
  7710. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7711. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7712. } while (0)
  7713. /* DWORD 1:ip_da_sa prefix */
  7714. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7715. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7716. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7717. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7718. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7719. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7722. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7723. } while (0)
  7724. /* DWORD 2: Base Address LO */
  7725. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7726. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7727. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7728. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7729. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7730. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7731. do { \
  7732. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7733. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7734. } while (0)
  7735. /* DWORD 3: Base Address High */
  7736. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7737. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7738. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7739. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7740. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7741. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7742. do { \
  7743. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7744. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7745. } while (0)
  7746. /* DWORD 4-12: Hash Value */
  7747. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7748. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7749. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7750. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7751. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7752. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7753. do { \
  7754. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7755. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7756. } while (0)
  7757. /* DWORD 13: Hash Value 314:288 bits */
  7758. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7759. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7760. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7761. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7762. do { \
  7763. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7764. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7765. } while (0)
  7766. /**
  7767. * @brief Host-->target HTT RX FSE operation message
  7768. *
  7769. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7770. *
  7771. * @details
  7772. * The host will send this Flow Search Engine (FSE) operation message for
  7773. * every flow add/delete operation.
  7774. * The FSE operation includes FSE full cache invalidation or individual entry
  7775. * invalidation.
  7776. * This message can be sent per SOC or per PDEV which is differentiated
  7777. * by pdev id values.
  7778. *
  7779. * |31 16|15 8|7 1|0|
  7780. * |-------------------------------------------------------------|
  7781. * | reserved | pdev_id | MSG_TYPE |
  7782. * |-------------------------------------------------------------|
  7783. * | reserved | operation |I|
  7784. * |-------------------------------------------------------------|
  7785. * | ip_src_addr_31_0 |
  7786. * |-------------------------------------------------------------|
  7787. * | ip_src_addr_63_32 |
  7788. * |-------------------------------------------------------------|
  7789. * | ip_src_addr_95_64 |
  7790. * |-------------------------------------------------------------|
  7791. * | ip_src_addr_127_96 |
  7792. * |-------------------------------------------------------------|
  7793. * | ip_dst_addr_31_0 |
  7794. * |-------------------------------------------------------------|
  7795. * | ip_dst_addr_63_32 |
  7796. * |-------------------------------------------------------------|
  7797. * | ip_dst_addr_95_64 |
  7798. * |-------------------------------------------------------------|
  7799. * | ip_dst_addr_127_96 |
  7800. * |-------------------------------------------------------------|
  7801. * | l4_dst_port | l4_src_port |
  7802. * | (32-bit SPI incase of IPsec) |
  7803. * |-------------------------------------------------------------|
  7804. * | reserved | l4_proto |
  7805. * |-------------------------------------------------------------|
  7806. *
  7807. * where I is 1-bit ipsec_valid.
  7808. *
  7809. * The following field definitions describe the format of the RX FSE operation
  7810. * message sent from the host to target for every add/delete flow entry to flow
  7811. * table.
  7812. *
  7813. * Header fields:
  7814. * dword0 - b'7:0 - msg_type: This will be set to
  7815. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7816. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7817. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7818. * specified pdev's LMAC ring.
  7819. * b'31:16 - reserved : Reserved for future use
  7820. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7821. * (Internet Protocol Security).
  7822. * IPsec describes the framework for providing security at
  7823. * IP layer. IPsec is defined for both versions of IP:
  7824. * IPV4 and IPV6.
  7825. * Please refer to htt_rx_flow_proto enumeration below for
  7826. * more info.
  7827. * ipsec_valid = 1 for IPSEC packets
  7828. * ipsec_valid = 0 for IP Packets
  7829. * b'7:1 - operation: This indicates types of FSE operation.
  7830. * Refer to htt_rx_fse_operation enumeration:
  7831. * 0 - No Cache Invalidation required
  7832. * 1 - Cache invalidate only one entry given by IP
  7833. * src/dest address at DWORD[2:9]
  7834. * 2 - Complete FSE Cache Invalidation
  7835. * 3 - FSE Disable
  7836. * 4 - FSE Enable
  7837. * b'31:8 - reserved: Reserved for future use
  7838. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7839. * for per flow addition/deletion
  7840. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7841. * and the subsequent 3 A_UINT32 will be padding bytes.
  7842. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7843. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7844. * from 0 to 65535 but only 0 to 1023 are designated as
  7845. * well-known ports. Refer to [RFC1700] for more details.
  7846. * This field is valid only if
  7847. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7848. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7849. * range from 0 to 65535 but only 0 to 1023 are designated
  7850. * as well-known ports. Refer to [RFC1700] for more details.
  7851. * This field is valid only if
  7852. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7853. * - SPI (31:0): Security Parameters Index is an
  7854. * identification tag added to the header while using IPsec
  7855. * for tunneling the IP traffici.
  7856. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7857. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7858. * Assigned Internet Protocol Numbers.
  7859. * l4_proto numbers for standard protocol like UDP/TCP
  7860. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7861. * l4_proto = 17 for UDP etc.
  7862. * b'31:8 - reserved: Reserved for future use.
  7863. *
  7864. */
  7865. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7866. A_UINT32 msg_type:8,
  7867. pdev_id:8,
  7868. reserved0:16;
  7869. A_UINT32 ipsec_valid:1,
  7870. operation:7,
  7871. reserved1:24;
  7872. A_UINT32 ip_src_addr_31_0;
  7873. A_UINT32 ip_src_addr_63_32;
  7874. A_UINT32 ip_src_addr_95_64;
  7875. A_UINT32 ip_src_addr_127_96;
  7876. A_UINT32 ip_dest_addr_31_0;
  7877. A_UINT32 ip_dest_addr_63_32;
  7878. A_UINT32 ip_dest_addr_95_64;
  7879. A_UINT32 ip_dest_addr_127_96;
  7880. union {
  7881. A_UINT32 spi;
  7882. struct {
  7883. A_UINT32 l4_src_port:16,
  7884. l4_dest_port:16;
  7885. } ip;
  7886. } u;
  7887. A_UINT32 l4_proto:8,
  7888. reserved:24;
  7889. } POSTPACK;
  7890. /**
  7891. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7892. *
  7893. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7894. *
  7895. * @details
  7896. * The host will send this Full monitor mode register configuration message.
  7897. * This message can be sent per SOC or per PDEV which is differentiated
  7898. * by pdev id values.
  7899. *
  7900. * |31 16|15 11|10 8|7 3|2|1|0|
  7901. * |-------------------------------------------------------------|
  7902. * | reserved | pdev_id | MSG_TYPE |
  7903. * |-------------------------------------------------------------|
  7904. * | reserved |Release Ring |N|Z|E|
  7905. * |-------------------------------------------------------------|
  7906. *
  7907. * where E is 1-bit full monitor mode enable/disable.
  7908. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7909. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7910. *
  7911. * The following field definitions describe the format of the full monitor
  7912. * mode configuration message sent from the host to target for each pdev.
  7913. *
  7914. * Header fields:
  7915. * dword0 - b'7:0 - msg_type: This will be set to
  7916. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7917. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7918. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7919. * specified pdev's LMAC ring.
  7920. * b'31:16 - reserved : Reserved for future use.
  7921. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7922. * monitor mode rxdma register is to be enabled or disabled.
  7923. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7924. * additional descriptors at ppdu end for zero mpdus
  7925. * enabled or disabled.
  7926. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7927. * additional descriptors at ppdu end for non zero mpdus
  7928. * enabled or disabled.
  7929. * b'10:3 - release_ring: This indicates the destination ring
  7930. * selection for the descriptor at the end of PPDU
  7931. * 0 - REO ring select
  7932. * 1 - FW ring select
  7933. * 2 - SW ring select
  7934. * 3 - Release ring select
  7935. * Refer to htt_rx_full_mon_release_ring.
  7936. * b'31:11 - reserved for future use
  7937. */
  7938. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7939. A_UINT32 msg_type:8,
  7940. pdev_id:8,
  7941. reserved0:16;
  7942. A_UINT32 full_monitor_mode_enable:1,
  7943. addnl_descs_zero_mpdus_end:1,
  7944. addnl_descs_non_zero_mpdus_end:1,
  7945. release_ring:8,
  7946. reserved1:21;
  7947. } POSTPACK;
  7948. /**
  7949. * Enumeration for full monitor mode destination ring select
  7950. * 0 - REO destination ring select
  7951. * 1 - FW destination ring select
  7952. * 2 - SW destination ring select
  7953. * 3 - Release destination ring select
  7954. */
  7955. enum htt_rx_full_mon_release_ring {
  7956. HTT_RX_MON_RING_REO,
  7957. HTT_RX_MON_RING_FW,
  7958. HTT_RX_MON_RING_SW,
  7959. HTT_RX_MON_RING_RELEASE,
  7960. };
  7961. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7962. /* DWORD 0: Pdev ID */
  7963. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7964. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7965. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7966. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7967. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7968. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7969. do { \
  7970. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7971. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7972. } while (0)
  7973. /* DWORD 1:ENABLE */
  7974. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7975. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7976. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7977. do { \
  7978. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7979. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7980. } while (0)
  7981. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7982. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7983. /* DWORD 1:ZERO_MPDU */
  7984. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7985. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7986. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7987. do { \
  7988. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7989. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7990. } while (0)
  7991. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7992. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7993. /* DWORD 1:NON_ZERO_MPDU */
  7994. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7995. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7996. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7997. do { \
  7998. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7999. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8000. } while (0)
  8001. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8002. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8003. /* DWORD 1:RELEASE_RINGS */
  8004. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8005. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8006. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8007. do { \
  8008. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8009. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8010. } while (0)
  8011. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8012. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8013. /**
  8014. * Enumeration for IP Protocol or IPSEC Protocol
  8015. * IPsec describes the framework for providing security at IP layer.
  8016. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8017. */
  8018. enum htt_rx_flow_proto {
  8019. HTT_RX_FLOW_IP_PROTO,
  8020. HTT_RX_FLOW_IPSEC_PROTO,
  8021. };
  8022. /**
  8023. * Enumeration for FSE Cache Invalidation
  8024. * 0 - No Cache Invalidation required
  8025. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8026. * 2 - Complete FSE Cache Invalidation
  8027. * 3 - FSE Disable
  8028. * 4 - FSE Enable
  8029. */
  8030. enum htt_rx_fse_operation {
  8031. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8032. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8033. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8034. HTT_RX_FSE_DISABLE,
  8035. HTT_RX_FSE_ENABLE,
  8036. };
  8037. /* DWORD 0: Pdev ID */
  8038. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8039. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8040. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8041. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8042. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8043. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8044. do { \
  8045. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8046. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8047. } while (0)
  8048. /* DWORD 1:IP PROTO or IPSEC */
  8049. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8050. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8051. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8052. do { \
  8053. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8054. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8055. } while (0)
  8056. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8057. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8058. /* DWORD 1:FSE Operation */
  8059. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8060. #define HTT_RX_FSE_OPERATION_S 1
  8061. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8062. do { \
  8063. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8064. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8065. } while (0)
  8066. #define HTT_RX_FSE_OPERATION_GET(word) \
  8067. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8068. /* DWORD 2-9:IP Address */
  8069. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8070. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8071. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8072. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8073. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8074. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8075. do { \
  8076. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8077. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8078. } while (0)
  8079. /* DWORD 10:Source Port Number */
  8080. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8081. #define HTT_RX_FSE_SOURCEPORT_S 0
  8082. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8085. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8086. } while (0)
  8087. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8088. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8089. /* DWORD 11:Destination Port Number */
  8090. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8091. #define HTT_RX_FSE_DESTPORT_S 16
  8092. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8093. do { \
  8094. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8095. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8096. } while (0)
  8097. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8098. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8099. /* DWORD 10-11:SPI (In case of IPSEC) */
  8100. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8101. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8102. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8103. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8104. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8105. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8106. do { \
  8107. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8108. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8109. } while (0)
  8110. /* DWORD 12:L4 PROTO */
  8111. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8112. #define HTT_RX_FSE_L4_PROTO_S 0
  8113. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8114. do { \
  8115. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8116. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8117. } while (0)
  8118. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8119. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8120. /**
  8121. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8122. *
  8123. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8124. *
  8125. * |31 24|23 |15 8|7 2|1|0|
  8126. * |----------------+----------------+----------------+----------------|
  8127. * | reserved | pdev_id | msg_type |
  8128. * |---------------------------------+----------------+----------------|
  8129. * | reserved |E|F|
  8130. * |---------------------------------+----------------+----------------|
  8131. * Where E = Configure the target to provide the 3-tuple hash value in
  8132. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8133. * F = Configure the target to provide the 3-tuple hash value in
  8134. * flow_id_toeplitz field of rx_msdu_start tlv
  8135. *
  8136. * The following field definitions describe the format of the 3 tuple hash value
  8137. * message sent from the host to target as part of initialization sequence.
  8138. *
  8139. * Header fields:
  8140. * dword0 - b'7:0 - msg_type: This will be set to
  8141. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8142. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8143. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8144. * specified pdev's LMAC ring.
  8145. * b'31:16 - reserved : Reserved for future use
  8146. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8147. * b'1 - toeplitz_hash_2_or_4_field_enable
  8148. * b'31:2 - reserved : Reserved for future use
  8149. * ---------+------+----------------------------------------------------------
  8150. * bit1 | bit0 | Functionality
  8151. * ---------+------+----------------------------------------------------------
  8152. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8153. * | | in flow_id_toeplitz field
  8154. * ---------+------+----------------------------------------------------------
  8155. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8156. * | | in toeplitz_hash_2_or_4 field
  8157. * ---------+------+----------------------------------------------------------
  8158. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8159. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8160. * ---------+------+----------------------------------------------------------
  8161. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8162. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8163. * | | toeplitz_hash_2_or_4 field
  8164. *----------------------------------------------------------------------------
  8165. */
  8166. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8167. A_UINT32 msg_type :8,
  8168. pdev_id :8,
  8169. reserved0 :16;
  8170. A_UINT32 flow_id_toeplitz_field_enable :1,
  8171. toeplitz_hash_2_or_4_field_enable :1,
  8172. reserved1 :30;
  8173. } POSTPACK;
  8174. /* DWORD0 : pdev_id configuration Macros */
  8175. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8176. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8177. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8178. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8179. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8180. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8181. do { \
  8182. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8183. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8184. } while (0)
  8185. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8186. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8187. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8188. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8189. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8190. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8191. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8192. do { \
  8193. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8194. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8195. } while (0)
  8196. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8197. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8198. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8199. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8200. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8201. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8202. do { \
  8203. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8204. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8205. } while (0)
  8206. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8207. /**
  8208. * @brief host --> target Host PA Address Size
  8209. *
  8210. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8211. *
  8212. * @details
  8213. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8214. * provide the physical start address and size of each of the memory
  8215. * areas within host DDR that the target FW may need to access.
  8216. *
  8217. * For example, the host can use this message to allow the target FW
  8218. * to set up access to the host's pools of TQM link descriptors.
  8219. * The message would appear as follows:
  8220. *
  8221. * |31 24|23 16|15 8|7 0|
  8222. * |----------------+----------------+----------------+----------------|
  8223. * | reserved | num_entries | msg_type |
  8224. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8225. * | mem area 0 size |
  8226. * |----------------+----------------+----------------+----------------|
  8227. * | mem area 0 physical_address_lo |
  8228. * |----------------+----------------+----------------+----------------|
  8229. * | mem area 0 physical_address_hi |
  8230. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8231. * | mem area 1 size |
  8232. * |----------------+----------------+----------------+----------------|
  8233. * | mem area 1 physical_address_lo |
  8234. * |----------------+----------------+----------------+----------------|
  8235. * | mem area 1 physical_address_hi |
  8236. * |----------------+----------------+----------------+----------------|
  8237. * ...
  8238. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8239. * | mem area N size |
  8240. * |----------------+----------------+----------------+----------------|
  8241. * | mem area N physical_address_lo |
  8242. * |----------------+----------------+----------------+----------------|
  8243. * | mem area N physical_address_hi |
  8244. * |----------------+----------------+----------------+----------------|
  8245. *
  8246. * The message is interpreted as follows:
  8247. * dword0 - b'0:7 - msg_type: This will be set to
  8248. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8249. * b'8:15 - number_entries: Indicated the number of host memory
  8250. * areas specified within the remainder of the message
  8251. * b'16:31 - reserved.
  8252. * dword1 - b'0:31 - memory area 0 size in bytes
  8253. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8254. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8255. * and similar for memory area 1 through memory area N.
  8256. */
  8257. PREPACK struct htt_h2t_host_paddr_size {
  8258. A_UINT32 msg_type: 8,
  8259. num_entries: 8,
  8260. reserved: 16;
  8261. } POSTPACK;
  8262. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8263. A_UINT32 size;
  8264. A_UINT32 physical_address_lo;
  8265. A_UINT32 physical_address_hi;
  8266. } POSTPACK;
  8267. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8268. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8269. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8270. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8271. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8272. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8273. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8274. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8275. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8276. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8277. do { \
  8278. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8279. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8280. } while (0)
  8281. /**
  8282. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8283. *
  8284. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8285. *
  8286. * @details
  8287. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8288. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8289. *
  8290. * The message would appear as follows:
  8291. *
  8292. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8293. * |---------------------------------+---+---+----------+-+-----------|
  8294. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8295. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8296. *
  8297. *
  8298. * The message is interpreted as follows:
  8299. * dword0 - b'0:7 - msg_type: This will be set to
  8300. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8301. * b'8 - override bit to drive MSDUs to PPE ring
  8302. * b'9:13 - REO destination ring indication
  8303. * b'14 - Multi buffer msdu override enable bit
  8304. * b'15 - Intra BSS override
  8305. * b'16 - Decap raw override
  8306. * b'17 - Decap Native wifi override
  8307. * b'18 - IP frag override
  8308. * b'19:31 - reserved
  8309. */
  8310. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8311. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8312. override: 1,
  8313. reo_destination_indication: 5,
  8314. multi_buffer_msdu_override_en: 1,
  8315. intra_bss_override: 1,
  8316. decap_raw_override: 1,
  8317. decap_nwifi_override: 1,
  8318. ip_frag_override: 1,
  8319. reserved: 13;
  8320. } POSTPACK;
  8321. /* DWORD 0: Override */
  8322. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8323. #define HTT_PPE_CFG_OVERRIDE_S 8
  8324. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8325. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8326. HTT_PPE_CFG_OVERRIDE_S)
  8327. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8328. do { \
  8329. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8330. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8331. } while (0)
  8332. /* DWORD 0: REO Destination Indication*/
  8333. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8334. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8335. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8336. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8337. HTT_PPE_CFG_REO_DEST_IND_S)
  8338. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8339. do { \
  8340. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8341. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8342. } while (0)
  8343. /* DWORD 0: Multi buffer MSDU override */
  8344. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8345. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8346. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8347. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8348. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8349. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8352. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8353. } while (0)
  8354. /* DWORD 0: Intra BSS override */
  8355. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8356. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8357. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8358. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8359. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8360. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8361. do { \
  8362. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8363. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8364. } while (0)
  8365. /* DWORD 0: Decap RAW override */
  8366. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8367. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8368. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8369. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8370. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8371. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8372. do { \
  8373. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8374. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8375. } while (0)
  8376. /* DWORD 0: Decap NWIFI override */
  8377. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8378. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8379. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8380. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8381. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8382. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8383. do { \
  8384. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8385. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8386. } while (0)
  8387. /* DWORD 0: IP frag override */
  8388. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8389. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8390. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8391. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8392. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8393. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8394. do { \
  8395. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8396. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8397. } while (0)
  8398. /*
  8399. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8400. *
  8401. * @details
  8402. * The following field definitions describe the format of the HTT host
  8403. * to target FW VDEV TX RX stats retrieve message.
  8404. * The message specifies the type of stats the host wants to retrieve.
  8405. *
  8406. * |31 27|26 25|24 17|16|15 8|7 0|
  8407. * |-----------------------------------------------------------|
  8408. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8409. * |-----------------------------------------------------------|
  8410. * | vdev_id lower bitmask |
  8411. * |-----------------------------------------------------------|
  8412. * | vdev_id upper bitmask |
  8413. * |-----------------------------------------------------------|
  8414. * Header fields:
  8415. * Where:
  8416. * dword0 - b'7:0 - msg_type: This will be set to
  8417. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8418. * b'15:8 - pdev id
  8419. * b'16(E) - Enable/Disable the vdev HW stats
  8420. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8421. * b'25:26(R) - Reset stats bits
  8422. * 0: don't reset stats
  8423. * 1: reset stats once
  8424. * 2: reset stats at the start of each periodic interval
  8425. * b'27:31 - reserved for future use
  8426. * dword1 - b'0:31 - vdev_id lower bitmask
  8427. * dword2 - b'0:31 - vdev_id upper bitmask
  8428. */
  8429. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8430. A_UINT32 msg_type :8,
  8431. pdev_id :8,
  8432. enable :1,
  8433. periodic_interval :8,
  8434. reset_stats_bits :2,
  8435. reserved0 :5;
  8436. A_UINT32 vdev_id_lower_bitmask;
  8437. A_UINT32 vdev_id_upper_bitmask;
  8438. } POSTPACK;
  8439. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8440. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8441. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8442. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8443. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8444. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8445. do { \
  8446. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8447. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8448. } while (0)
  8449. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8450. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8451. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8452. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8453. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8454. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8455. do { \
  8456. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8457. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8458. } while (0)
  8459. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8460. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8461. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8462. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8463. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8464. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8465. do { \
  8466. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8467. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8468. } while (0)
  8469. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8470. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8471. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8472. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8473. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8474. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8475. do { \
  8476. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8477. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8478. } while (0)
  8479. /*
  8480. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8481. *
  8482. * @details
  8483. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8484. * the default MSDU queues for one of the TIDs within the specified peer
  8485. * to the specified service class.
  8486. * The TID is indirectly specified - each service class is associated
  8487. * with a TID. All default MSDU queues for this peer-TID will be
  8488. * linked to the service class in question.
  8489. *
  8490. * |31 16|15 8|7 0|
  8491. * |------------------------------+--------------+--------------|
  8492. * | peer ID | svc class ID | msg type |
  8493. * |------------------------------------------------------------|
  8494. * Header fields:
  8495. * dword0 - b'7:0 - msg_type: This will be set to
  8496. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8497. * b'15:8 - service class ID
  8498. * b'31:16 - peer ID
  8499. */
  8500. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8501. A_UINT32 msg_type :8,
  8502. svc_class_id :8,
  8503. peer_id :16;
  8504. } POSTPACK;
  8505. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8506. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8507. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8508. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8509. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8510. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8511. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8512. do { \
  8513. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8514. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8515. } while (0)
  8516. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8517. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8518. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8519. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8520. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8521. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8524. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8525. } while (0)
  8526. /*
  8527. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8528. *
  8529. * @details
  8530. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8531. * remove the linkage of the specified peer-TID's MSDU queues to
  8532. * service classes.
  8533. *
  8534. * |31 16|15 8|7 0|
  8535. * |------------------------------+--------------+--------------|
  8536. * | peer ID | svc class ID | msg type |
  8537. * |------------------------------------------------------------|
  8538. * Header fields:
  8539. * dword0 - b'7:0 - msg_type: This will be set to
  8540. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8541. * b'15:8 - service class ID
  8542. * b'31:16 - peer ID
  8543. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8544. * value for peer ID indicates that the target should
  8545. * apply the UNMAP_REQ to all peers.
  8546. */
  8547. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8548. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8549. A_UINT32 msg_type :8,
  8550. svc_class_id :8,
  8551. peer_id :16;
  8552. } POSTPACK;
  8553. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8554. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8555. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8556. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8557. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8558. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8559. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8560. do { \
  8561. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8562. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8563. } while (0)
  8564. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8565. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8566. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8567. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8568. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8569. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8570. do { \
  8571. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8572. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8573. } while (0)
  8574. /*
  8575. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8576. *
  8577. * @details
  8578. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8579. * request the target to report what service class the default MSDU queues
  8580. * of the specified TIDs within the peer are linked to.
  8581. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8582. * to report what service class (if any) the default MSDU queues for
  8583. * each of the specified TIDs are linked to.
  8584. *
  8585. * |31 16|15 8|7 1| 0|
  8586. * |------------------------------+--------------+--------------|
  8587. * | peer ID | TID mask | msg type |
  8588. * |------------------------------------------------------------|
  8589. * | reserved |ETO|
  8590. * |------------------------------------------------------------|
  8591. * Header fields:
  8592. * dword0 - b'7:0 - msg_type: This will be set to
  8593. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8594. * b'15:8 - TID mask
  8595. * b'31:16 - peer ID
  8596. * dword1 - b'0 - "Existing Tids Only" flag
  8597. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8598. * message generated by this REQ will only show the
  8599. * mapping for TIDs that actually exist in the target's
  8600. * peer object.
  8601. * Any TIDs that are covered by a MAP_REQ but which
  8602. * do not actually exist will be shown as being
  8603. * unmapped (i.e. svc class ID 0xff).
  8604. * If this flag is cleared, the MAP_REPORT_CONF message
  8605. * will consider not only the mapping of TIDs currently
  8606. * existing in the peer, but also the mapping that will
  8607. * be applied for any TID objects created within this
  8608. * peer in the future.
  8609. * b'31:1 - reserved for future use
  8610. */
  8611. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8612. A_UINT32 msg_type :8,
  8613. tid_mask :8,
  8614. peer_id :16;
  8615. A_UINT32 existing_tids_only:1,
  8616. reserved :31;
  8617. } POSTPACK;
  8618. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8619. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8620. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8621. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8622. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8623. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8624. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8625. do { \
  8626. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8627. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8628. } while (0)
  8629. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8630. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8631. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8632. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8633. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8634. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8635. do { \
  8636. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8637. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8638. } while (0)
  8639. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8640. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8641. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8642. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8643. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8644. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8645. do { \
  8646. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8647. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8648. } while (0)
  8649. /**
  8650. * @brief Format of shared memory between Host and Target
  8651. * for UMAC hang recovery feature messaging.
  8652. * @details
  8653. * This is shared memory between Host and Target allocated
  8654. * and used in chips where UMAC hang recovery feature is supported.
  8655. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8656. * then host interprets it as a new message from target.
  8657. * Host clears that particular read bit in t2h_msg after each read
  8658. * operation. It is vice versa for h2t_msg. At any given point
  8659. * of time there is expected to be only one bit set
  8660. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8661. *
  8662. * The message is interpreted as follows:
  8663. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8664. * added for debuggability purpose.
  8665. * dword1 - b'0 - do_pre_reset
  8666. * b'1 - do_post_reset_start
  8667. * b'2 - do_post_reset_complete
  8668. * b'3:31 - rsvd_t2h
  8669. * dword2 - b'0 - pre_reset_done
  8670. * b'1 - post_reset_start_done
  8671. * b'2 - post_reset_complete_done
  8672. * b'3:31 - rsvd_h2t
  8673. */
  8674. PREPACK typedef struct {
  8675. /** Magic number added for debuggability. */
  8676. A_UINT32 magic_num;
  8677. union {
  8678. /*
  8679. * BIT [0] :- T2H msg to do pre-reset
  8680. * BIT [1] :- T2H msg to do post-reset start
  8681. * BIT [2] :- T2H msg to do post-reset complete
  8682. * BIT [31 : 3] :- reserved
  8683. */
  8684. A_UINT32 t2h_msg;
  8685. struct {
  8686. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8687. do_post_reset_start : 1, /* BIT [1] */
  8688. do_post_reset_complete : 1, /* BIT [2] */
  8689. rsvd_t2h : 29; /* BIT [31 : 3] */
  8690. };
  8691. };
  8692. union {
  8693. /*
  8694. * BIT [0] :- H2T msg to send pre-reset done
  8695. * BIT [1] :- H2T msg to send post-reset start done
  8696. * BIT [2] :- H2T msg to send post-reset complete done
  8697. * BIT [31 : 3] :- reserved
  8698. */
  8699. A_UINT32 h2t_msg;
  8700. struct {
  8701. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8702. post_reset_start_done : 1, /* BIT [1] */
  8703. post_reset_complete_done : 1, /* BIT [2] */
  8704. rsvd_h2t : 29; /* BIT [31 : 3] */
  8705. };
  8706. };
  8707. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8708. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8709. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8710. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8711. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8712. /* dword1 - b'0 - do_pre_reset */
  8713. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8714. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8715. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8716. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8717. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8718. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8719. do { \
  8720. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8721. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8722. } while (0)
  8723. /* dword1 - b'1 - do_post_reset_start */
  8724. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8725. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8726. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8727. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8728. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8729. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8730. do { \
  8731. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8732. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8733. } while (0)
  8734. /* dword1 - b'2 - do_post_reset_complete */
  8735. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8736. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8737. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8738. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8739. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8740. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8741. do { \
  8742. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8743. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8744. } while (0)
  8745. /* dword2 - b'0 - pre_reset_done */
  8746. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8747. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8748. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8749. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8750. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8751. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8752. do { \
  8753. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8754. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8755. } while (0)
  8756. /* dword2 - b'1 - post_reset_start_done */
  8757. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8758. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8759. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8760. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8761. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8762. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8763. do { \
  8764. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8765. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8766. } while (0)
  8767. /* dword2 - b'2 - post_reset_complete_done */
  8768. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8769. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8770. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8771. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8772. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8773. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8774. do { \
  8775. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8776. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8777. } while (0)
  8778. /**
  8779. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8780. *
  8781. * @details
  8782. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8783. * by the host to provide prerequisite info to target for the UMAC hang
  8784. * recovery feature.
  8785. * The info sent in this H2T message are T2H message method, H2T message
  8786. * method, T2H MSI interrupt number and physical start address, size of
  8787. * the shared memory (refers to the shared memory dedicated for messaging
  8788. * between host and target when the DUT is in UMAC hang recovery mode).
  8789. * This H2T message is expected to be only sent if the WMI service bit
  8790. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8791. *
  8792. * |31 16|15 12|11 8|7 0|
  8793. * |-------------------------------+--------------+--------------+------------|
  8794. * | reserved |h2t msg method|t2h msg method| msg_type |
  8795. * |--------------------------------------------------------------------------|
  8796. * | t2h msi interrupt number |
  8797. * |--------------------------------------------------------------------------|
  8798. * | shared memory area size |
  8799. * |--------------------------------------------------------------------------|
  8800. * | shared memory area physical address low |
  8801. * |--------------------------------------------------------------------------|
  8802. * | shared memory area physical address high |
  8803. * |--------------------------------------------------------------------------|
  8804. *
  8805. * The message is interpreted as follows:
  8806. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8807. * b'8:11 - t2h_msg_method: indicates method to be used for
  8808. * T2H communication in UMAC hang recovery mode.
  8809. * Value zero indicates MSI interrupt (default method).
  8810. * Refer to htt_umac_hang_recovery_msg_method enum.
  8811. * b'12:15 - h2t_msg_method: indicates method to be used for
  8812. * H2T communication in UMAC hang recovery mode.
  8813. * Value zero indicates polling by target for this h2t msg
  8814. * during UMAC hang recovery mode.
  8815. * Refer to htt_umac_hang_recovery_msg_method enum.
  8816. * b'16:31 - reserved.
  8817. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8818. * T2H communication in UMAC hang recovery mode.
  8819. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8820. * only when in UMAC hang recovery mode.
  8821. * This refers to size in bytes.
  8822. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8823. * of the shared memory dedicated for messaging only when
  8824. * in UMAC hang recovery mode.
  8825. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8826. * of the shared memory dedicated for messaging only when
  8827. * in UMAC hang recovery mode.
  8828. */
  8829. /* t2h_msg_method and h2t_msg_method */
  8830. enum htt_umac_hang_recovery_msg_method {
  8831. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8832. };
  8833. PREPACK typedef struct {
  8834. A_UINT32 msg_type : 8,
  8835. t2h_msg_method : 4,
  8836. h2t_msg_method : 4,
  8837. reserved : 16;
  8838. A_UINT32 t2h_msi_data;
  8839. /* size bytes and physical address of shared memory. */
  8840. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8841. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8842. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8843. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8844. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8845. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8846. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8847. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8848. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8849. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8850. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8851. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8852. do { \
  8853. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8854. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8855. } while (0)
  8856. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8857. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8858. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8859. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8860. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8861. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8862. do { \
  8863. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8864. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8865. } while (0)
  8866. /*=== target -> host messages ===============================================*/
  8867. enum htt_t2h_msg_type {
  8868. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8869. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8870. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8871. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8872. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8873. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8874. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8875. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8876. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8877. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8878. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8879. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8880. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8881. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8882. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8883. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8884. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8885. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8886. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8887. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8888. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8889. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8890. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8891. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8892. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8893. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8894. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8895. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8896. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8897. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8898. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8899. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8900. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8901. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8902. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8903. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8904. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8905. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8906. /* TX_OFFLOAD_DELIVER_IND:
  8907. * Forward the target's locally-generated packets to the host,
  8908. * to provide to the monitor mode interface.
  8909. */
  8910. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8911. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8912. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8913. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8914. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8915. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8916. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8917. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8918. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8919. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8920. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8921. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8922. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8923. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8924. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8925. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8926. HTT_T2H_MSG_TYPE_TEST,
  8927. /* keep this last */
  8928. HTT_T2H_NUM_MSGS
  8929. };
  8930. /*
  8931. * HTT target to host message type -
  8932. * stored in bits 7:0 of the first word of the message
  8933. */
  8934. #define HTT_T2H_MSG_TYPE_M 0xff
  8935. #define HTT_T2H_MSG_TYPE_S 0
  8936. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8937. do { \
  8938. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8939. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8940. } while (0)
  8941. #define HTT_T2H_MSG_TYPE_GET(word) \
  8942. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8943. /**
  8944. * @brief target -> host version number confirmation message definition
  8945. *
  8946. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8947. *
  8948. * |31 24|23 16|15 8|7 0|
  8949. * |----------------+----------------+----------------+----------------|
  8950. * | reserved | major number | minor number | msg type |
  8951. * |-------------------------------------------------------------------|
  8952. * : option request TLV (optional) |
  8953. * :...................................................................:
  8954. *
  8955. * The VER_CONF message may consist of a single 4-byte word, or may be
  8956. * extended with TLVs that specify HTT options selected by the target.
  8957. * The following option TLVs may be appended to the VER_CONF message:
  8958. * - LL_BUS_ADDR_SIZE
  8959. * - HL_SUPPRESS_TX_COMPL_IND
  8960. * - MAX_TX_QUEUE_GROUPS
  8961. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8962. * may be appended to the VER_CONF message (but only one TLV of each type).
  8963. *
  8964. * Header fields:
  8965. * - MSG_TYPE
  8966. * Bits 7:0
  8967. * Purpose: identifies this as a version number confirmation message
  8968. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8969. * - VER_MINOR
  8970. * Bits 15:8
  8971. * Purpose: Specify the minor number of the HTT message library version
  8972. * in use by the target firmware.
  8973. * The minor number specifies the specific revision within a range
  8974. * of fundamentally compatible HTT message definition revisions.
  8975. * Compatible revisions involve adding new messages or perhaps
  8976. * adding new fields to existing messages, in a backwards-compatible
  8977. * manner.
  8978. * Incompatible revisions involve changing the message type values,
  8979. * or redefining existing messages.
  8980. * Value: minor number
  8981. * - VER_MAJOR
  8982. * Bits 15:8
  8983. * Purpose: Specify the major number of the HTT message library version
  8984. * in use by the target firmware.
  8985. * The major number specifies the family of minor revisions that are
  8986. * fundamentally compatible with each other, but not with prior or
  8987. * later families.
  8988. * Value: major number
  8989. */
  8990. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8991. #define HTT_VER_CONF_MINOR_S 8
  8992. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8993. #define HTT_VER_CONF_MAJOR_S 16
  8994. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8997. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8998. } while (0)
  8999. #define HTT_VER_CONF_MINOR_GET(word) \
  9000. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9001. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9002. do { \
  9003. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9004. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9005. } while (0)
  9006. #define HTT_VER_CONF_MAJOR_GET(word) \
  9007. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9008. #define HTT_VER_CONF_BYTES 4
  9009. /**
  9010. * @brief - target -> host HTT Rx In order indication message
  9011. *
  9012. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9013. *
  9014. * @details
  9015. *
  9016. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9017. * |----------------+-------------------+---------------------+---------------|
  9018. * | peer ID | P| F| O| ext TID | msg type |
  9019. * |--------------------------------------------------------------------------|
  9020. * | MSDU count | Reserved | vdev id |
  9021. * |--------------------------------------------------------------------------|
  9022. * | MSDU 0 bus address (bits 31:0) |
  9023. #if HTT_PADDR64
  9024. * | MSDU 0 bus address (bits 63:32) |
  9025. #endif
  9026. * |--------------------------------------------------------------------------|
  9027. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9028. * |--------------------------------------------------------------------------|
  9029. * | MSDU 1 bus address (bits 31:0) |
  9030. #if HTT_PADDR64
  9031. * | MSDU 1 bus address (bits 63:32) |
  9032. #endif
  9033. * |--------------------------------------------------------------------------|
  9034. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9035. * |--------------------------------------------------------------------------|
  9036. */
  9037. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9038. *
  9039. * @details
  9040. * bits
  9041. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9042. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9043. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9044. * | | frag | | | | fail |chksum fail|
  9045. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9046. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9047. */
  9048. struct htt_rx_in_ord_paddr_ind_hdr_t
  9049. {
  9050. A_UINT32 /* word 0 */
  9051. msg_type: 8,
  9052. ext_tid: 5,
  9053. offload: 1,
  9054. frag: 1,
  9055. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9056. peer_id: 16;
  9057. A_UINT32 /* word 1 */
  9058. vap_id: 8,
  9059. /* NOTE:
  9060. * This reserved_1 field is not truly reserved - certain targets use
  9061. * this field internally to store debug information, and do not zero
  9062. * out the contents of the field before uploading the message to the
  9063. * host. Thus, any host-target communication supported by this field
  9064. * is limited to using values that are never used by the debug
  9065. * information stored by certain targets in the reserved_1 field.
  9066. * In particular, the targets in question don't use the value 0x3
  9067. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9068. * so this previously-unused value within these bits is available to
  9069. * use as the host / target PKT_CAPTURE_MODE flag.
  9070. */
  9071. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9072. /* if pkt_capture_mode == 0x3, host should
  9073. * send rx frames to monitor mode interface
  9074. */
  9075. msdu_cnt: 16;
  9076. };
  9077. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9078. {
  9079. A_UINT32 dma_addr;
  9080. A_UINT32
  9081. length: 16,
  9082. fw_desc: 8,
  9083. msdu_info:8;
  9084. };
  9085. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9086. {
  9087. A_UINT32 dma_addr_lo;
  9088. A_UINT32 dma_addr_hi;
  9089. A_UINT32
  9090. length: 16,
  9091. fw_desc: 8,
  9092. msdu_info:8;
  9093. };
  9094. #if HTT_PADDR64
  9095. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9096. #else
  9097. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9098. #endif
  9099. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9100. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9101. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9102. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9103. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9104. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9106. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9107. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9108. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9109. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9110. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9111. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9112. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9113. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9114. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9115. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9116. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9117. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9118. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9119. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9120. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9121. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9122. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9123. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9124. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9125. /* for systems using 64-bit format for bus addresses */
  9126. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9127. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9128. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9129. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9130. /* for systems using 32-bit format for bus addresses */
  9131. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9132. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9133. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9134. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9135. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9136. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9137. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9138. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9139. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9140. do { \
  9141. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9142. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9143. } while (0)
  9144. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9145. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9146. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9149. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9150. } while (0)
  9151. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9152. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9153. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9154. do { \
  9155. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9156. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9157. } while (0)
  9158. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9159. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9160. /*
  9161. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9162. * deliver the rx frames to the monitor mode interface.
  9163. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9164. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9165. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9166. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9167. */
  9168. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9169. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9170. do { \
  9171. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9172. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9173. } while (0)
  9174. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9175. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9176. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9177. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9178. do { \
  9179. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9180. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9181. } while (0)
  9182. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9183. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9184. /* for systems using 64-bit format for bus addresses */
  9185. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9186. do { \
  9187. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9188. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9189. } while (0)
  9190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9191. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9192. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9193. do { \
  9194. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9195. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9196. } while (0)
  9197. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9198. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9199. /* for systems using 32-bit format for bus addresses */
  9200. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9201. do { \
  9202. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9203. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9204. } while (0)
  9205. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9206. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9207. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9208. do { \
  9209. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9210. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9211. } while (0)
  9212. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9213. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9214. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9217. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9218. } while (0)
  9219. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9220. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9221. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9222. do { \
  9223. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9224. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9225. } while (0)
  9226. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9227. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9228. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9231. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9232. } while (0)
  9233. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9234. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9235. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9236. do { \
  9237. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9238. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9239. } while (0)
  9240. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9241. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9242. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9243. do { \
  9244. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9245. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9246. } while (0)
  9247. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9248. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9249. /* definitions used within target -> host rx indication message */
  9250. PREPACK struct htt_rx_ind_hdr_prefix_t
  9251. {
  9252. A_UINT32 /* word 0 */
  9253. msg_type: 8,
  9254. ext_tid: 5,
  9255. release_valid: 1,
  9256. flush_valid: 1,
  9257. reserved0: 1,
  9258. peer_id: 16;
  9259. A_UINT32 /* word 1 */
  9260. flush_start_seq_num: 6,
  9261. flush_end_seq_num: 6,
  9262. release_start_seq_num: 6,
  9263. release_end_seq_num: 6,
  9264. num_mpdu_ranges: 8;
  9265. } POSTPACK;
  9266. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9267. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9268. #define HTT_TGT_RSSI_INVALID 0x80
  9269. PREPACK struct htt_rx_ppdu_desc_t
  9270. {
  9271. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9272. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9273. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9274. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9275. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9276. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9277. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9278. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9279. A_UINT32 /* word 0 */
  9280. rssi_cmb: 8,
  9281. timestamp_submicrosec: 8,
  9282. phy_err_code: 8,
  9283. phy_err: 1,
  9284. legacy_rate: 4,
  9285. legacy_rate_sel: 1,
  9286. end_valid: 1,
  9287. start_valid: 1;
  9288. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9289. union {
  9290. A_UINT32 /* word 1 */
  9291. rssi0_pri20: 8,
  9292. rssi0_ext20: 8,
  9293. rssi0_ext40: 8,
  9294. rssi0_ext80: 8;
  9295. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9296. } u0;
  9297. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9298. union {
  9299. A_UINT32 /* word 2 */
  9300. rssi1_pri20: 8,
  9301. rssi1_ext20: 8,
  9302. rssi1_ext40: 8,
  9303. rssi1_ext80: 8;
  9304. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9305. } u1;
  9306. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9307. union {
  9308. A_UINT32 /* word 3 */
  9309. rssi2_pri20: 8,
  9310. rssi2_ext20: 8,
  9311. rssi2_ext40: 8,
  9312. rssi2_ext80: 8;
  9313. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9314. } u2;
  9315. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9316. union {
  9317. A_UINT32 /* word 4 */
  9318. rssi3_pri20: 8,
  9319. rssi3_ext20: 8,
  9320. rssi3_ext40: 8,
  9321. rssi3_ext80: 8;
  9322. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9323. } u3;
  9324. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9325. A_UINT32 tsf32; /* word 5 */
  9326. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9327. A_UINT32 timestamp_microsec; /* word 6 */
  9328. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9329. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9330. A_UINT32 /* word 7 */
  9331. vht_sig_a1: 24,
  9332. preamble_type: 8;
  9333. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9334. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9335. A_UINT32 /* word 8 */
  9336. vht_sig_a2: 24,
  9337. /* sa_ant_matrix
  9338. * For cases where a single rx chain has options to be connected to
  9339. * different rx antennas, show which rx antennas were in use during
  9340. * receipt of a given PPDU.
  9341. * This sa_ant_matrix provides a bitmask of the antennas used while
  9342. * receiving this frame.
  9343. */
  9344. sa_ant_matrix: 8;
  9345. } POSTPACK;
  9346. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9347. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9348. PREPACK struct htt_rx_ind_hdr_suffix_t
  9349. {
  9350. A_UINT32 /* word 0 */
  9351. fw_rx_desc_bytes: 16,
  9352. reserved0: 16;
  9353. } POSTPACK;
  9354. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9355. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9356. PREPACK struct htt_rx_ind_hdr_t
  9357. {
  9358. struct htt_rx_ind_hdr_prefix_t prefix;
  9359. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9360. struct htt_rx_ind_hdr_suffix_t suffix;
  9361. } POSTPACK;
  9362. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9363. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9364. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9365. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9366. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9367. /*
  9368. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9369. * the offset into the HTT rx indication message at which the
  9370. * FW rx PPDU descriptor resides
  9371. */
  9372. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9373. /*
  9374. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9375. * the offset into the HTT rx indication message at which the
  9376. * header suffix (FW rx MSDU byte count) resides
  9377. */
  9378. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9379. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9380. /*
  9381. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9382. * the offset into the HTT rx indication message at which the per-MSDU
  9383. * information starts
  9384. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9385. * per-MSDU information portion of the message. The per-MSDU info itself
  9386. * starts at byte 12.
  9387. */
  9388. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9389. /**
  9390. * @brief target -> host rx indication message definition
  9391. *
  9392. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9393. *
  9394. * @details
  9395. * The following field definitions describe the format of the rx indication
  9396. * message sent from the target to the host.
  9397. * The message consists of three major sections:
  9398. * 1. a fixed-length header
  9399. * 2. a variable-length list of firmware rx MSDU descriptors
  9400. * 3. one or more 4-octet MPDU range information elements
  9401. * The fixed length header itself has two sub-sections
  9402. * 1. the message meta-information, including identification of the
  9403. * sender and type of the received data, and a 4-octet flush/release IE
  9404. * 2. the firmware rx PPDU descriptor
  9405. *
  9406. * The format of the message is depicted below.
  9407. * in this depiction, the following abbreviations are used for information
  9408. * elements within the message:
  9409. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9410. * elements associated with the PPDU start are valid.
  9411. * Specifically, the following fields are valid only if SV is set:
  9412. * RSSI (all variants), L, legacy rate, preamble type, service,
  9413. * VHT-SIG-A
  9414. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9415. * elements associated with the PPDU end are valid.
  9416. * Specifically, the following fields are valid only if EV is set:
  9417. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9418. * - L - Legacy rate selector - if legacy rates are used, this flag
  9419. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9420. * (L == 0) PHY.
  9421. * - P - PHY error flag - boolean indication of whether the rx frame had
  9422. * a PHY error
  9423. *
  9424. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9425. * |----------------+-------------------+---------------------+---------------|
  9426. * | peer ID | |RV|FV| ext TID | msg type |
  9427. * |--------------------------------------------------------------------------|
  9428. * | num | release | release | flush | flush |
  9429. * | MPDU | end | start | end | start |
  9430. * | ranges | seq num | seq num | seq num | seq num |
  9431. * |==========================================================================|
  9432. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9433. * |V|V| | rate | | | timestamp | RSSI |
  9434. * |--------------------------------------------------------------------------|
  9435. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9436. * |--------------------------------------------------------------------------|
  9437. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9438. * |--------------------------------------------------------------------------|
  9439. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9440. * |--------------------------------------------------------------------------|
  9441. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9442. * |--------------------------------------------------------------------------|
  9443. * | TSF LSBs |
  9444. * |--------------------------------------------------------------------------|
  9445. * | microsec timestamp |
  9446. * |--------------------------------------------------------------------------|
  9447. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9448. * |--------------------------------------------------------------------------|
  9449. * | service | HT-SIG / VHT-SIG-A2 |
  9450. * |==========================================================================|
  9451. * | reserved | FW rx desc bytes |
  9452. * |--------------------------------------------------------------------------|
  9453. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9454. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9455. * |--------------------------------------------------------------------------|
  9456. * : : :
  9457. * |--------------------------------------------------------------------------|
  9458. * | alignment | MSDU Rx |
  9459. * | padding | desc Bn |
  9460. * |--------------------------------------------------------------------------|
  9461. * | reserved | MPDU range status | MPDU count |
  9462. * |--------------------------------------------------------------------------|
  9463. * : reserved : MPDU range status : MPDU count :
  9464. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9465. *
  9466. * Header fields:
  9467. * - MSG_TYPE
  9468. * Bits 7:0
  9469. * Purpose: identifies this as an rx indication message
  9470. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9471. * - EXT_TID
  9472. * Bits 12:8
  9473. * Purpose: identify the traffic ID of the rx data, including
  9474. * special "extended" TID values for multicast, broadcast, and
  9475. * non-QoS data frames
  9476. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9477. * - FLUSH_VALID (FV)
  9478. * Bit 13
  9479. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9480. * is valid
  9481. * Value:
  9482. * 1 -> flush IE is valid and needs to be processed
  9483. * 0 -> flush IE is not valid and should be ignored
  9484. * - REL_VALID (RV)
  9485. * Bit 13
  9486. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9487. * is valid
  9488. * Value:
  9489. * 1 -> release IE is valid and needs to be processed
  9490. * 0 -> release IE is not valid and should be ignored
  9491. * - PEER_ID
  9492. * Bits 31:16
  9493. * Purpose: Identify, by ID, which peer sent the rx data
  9494. * Value: ID of the peer who sent the rx data
  9495. * - FLUSH_SEQ_NUM_START
  9496. * Bits 5:0
  9497. * Purpose: Indicate the start of a series of MPDUs to flush
  9498. * Not all MPDUs within this series are necessarily valid - the host
  9499. * must check each sequence number within this range to see if the
  9500. * corresponding MPDU is actually present.
  9501. * This field is only valid if the FV bit is set.
  9502. * Value:
  9503. * The sequence number for the first MPDUs to check to flush.
  9504. * The sequence number is masked by 0x3f.
  9505. * - FLUSH_SEQ_NUM_END
  9506. * Bits 11:6
  9507. * Purpose: Indicate the end of a series of MPDUs to flush
  9508. * Value:
  9509. * The sequence number one larger than the sequence number of the
  9510. * last MPDU to check to flush.
  9511. * The sequence number is masked by 0x3f.
  9512. * Not all MPDUs within this series are necessarily valid - the host
  9513. * must check each sequence number within this range to see if the
  9514. * corresponding MPDU is actually present.
  9515. * This field is only valid if the FV bit is set.
  9516. * - REL_SEQ_NUM_START
  9517. * Bits 17:12
  9518. * Purpose: Indicate the start of a series of MPDUs to release.
  9519. * All MPDUs within this series are present and valid - the host
  9520. * need not check each sequence number within this range to see if
  9521. * the corresponding MPDU is actually present.
  9522. * This field is only valid if the RV bit is set.
  9523. * Value:
  9524. * The sequence number for the first MPDUs to check to release.
  9525. * The sequence number is masked by 0x3f.
  9526. * - REL_SEQ_NUM_END
  9527. * Bits 23:18
  9528. * Purpose: Indicate the end of a series of MPDUs to release.
  9529. * Value:
  9530. * The sequence number one larger than the sequence number of the
  9531. * last MPDU to check to release.
  9532. * The sequence number is masked by 0x3f.
  9533. * All MPDUs within this series are present and valid - the host
  9534. * need not check each sequence number within this range to see if
  9535. * the corresponding MPDU is actually present.
  9536. * This field is only valid if the RV bit is set.
  9537. * - NUM_MPDU_RANGES
  9538. * Bits 31:24
  9539. * Purpose: Indicate how many ranges of MPDUs are present.
  9540. * Each MPDU range consists of a series of contiguous MPDUs within the
  9541. * rx frame sequence which all have the same MPDU status.
  9542. * Value: 1-63 (typically a small number, like 1-3)
  9543. *
  9544. * Rx PPDU descriptor fields:
  9545. * - RSSI_CMB
  9546. * Bits 7:0
  9547. * Purpose: Combined RSSI from all active rx chains, across the active
  9548. * bandwidth.
  9549. * Value: RSSI dB units w.r.t. noise floor
  9550. * - TIMESTAMP_SUBMICROSEC
  9551. * Bits 15:8
  9552. * Purpose: high-resolution timestamp
  9553. * Value:
  9554. * Sub-microsecond time of PPDU reception.
  9555. * This timestamp ranges from [0,MAC clock MHz).
  9556. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9557. * to form a high-resolution, large range rx timestamp.
  9558. * - PHY_ERR_CODE
  9559. * Bits 23:16
  9560. * Purpose:
  9561. * If the rx frame processing resulted in a PHY error, indicate what
  9562. * type of rx PHY error occurred.
  9563. * Value:
  9564. * This field is valid if the "P" (PHY_ERR) flag is set.
  9565. * TBD: document/specify the values for this field
  9566. * - PHY_ERR
  9567. * Bit 24
  9568. * Purpose: indicate whether the rx PPDU had a PHY error
  9569. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9570. * - LEGACY_RATE
  9571. * Bits 28:25
  9572. * Purpose:
  9573. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9574. * specify which rate was used.
  9575. * Value:
  9576. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9577. * flag.
  9578. * If LEGACY_RATE_SEL is 0:
  9579. * 0x8: OFDM 48 Mbps
  9580. * 0x9: OFDM 24 Mbps
  9581. * 0xA: OFDM 12 Mbps
  9582. * 0xB: OFDM 6 Mbps
  9583. * 0xC: OFDM 54 Mbps
  9584. * 0xD: OFDM 36 Mbps
  9585. * 0xE: OFDM 18 Mbps
  9586. * 0xF: OFDM 9 Mbps
  9587. * If LEGACY_RATE_SEL is 1:
  9588. * 0x8: CCK 11 Mbps long preamble
  9589. * 0x9: CCK 5.5 Mbps long preamble
  9590. * 0xA: CCK 2 Mbps long preamble
  9591. * 0xB: CCK 1 Mbps long preamble
  9592. * 0xC: CCK 11 Mbps short preamble
  9593. * 0xD: CCK 5.5 Mbps short preamble
  9594. * 0xE: CCK 2 Mbps short preamble
  9595. * - LEGACY_RATE_SEL
  9596. * Bit 29
  9597. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9598. * Value:
  9599. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9600. * used a legacy rate.
  9601. * 0 -> OFDM, 1 -> CCK
  9602. * - END_VALID
  9603. * Bit 30
  9604. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9605. * the start of the PPDU are valid. Specifically, the following
  9606. * fields are only valid if END_VALID is set:
  9607. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9608. * TIMESTAMP_SUBMICROSEC
  9609. * Value:
  9610. * 0 -> rx PPDU desc end fields are not valid
  9611. * 1 -> rx PPDU desc end fields are valid
  9612. * - START_VALID
  9613. * Bit 31
  9614. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9615. * the end of the PPDU are valid. Specifically, the following
  9616. * fields are only valid if START_VALID is set:
  9617. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9618. * VHT-SIG-A
  9619. * Value:
  9620. * 0 -> rx PPDU desc start fields are not valid
  9621. * 1 -> rx PPDU desc start fields are valid
  9622. * - RSSI0_PRI20
  9623. * Bits 7:0
  9624. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9625. * Value: RSSI dB units w.r.t. noise floor
  9626. *
  9627. * - RSSI0_EXT20
  9628. * Bits 7:0
  9629. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9630. * (if the rx bandwidth was >= 40 MHz)
  9631. * Value: RSSI dB units w.r.t. noise floor
  9632. * - RSSI0_EXT40
  9633. * Bits 7:0
  9634. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9635. * (if the rx bandwidth was >= 80 MHz)
  9636. * Value: RSSI dB units w.r.t. noise floor
  9637. * - RSSI0_EXT80
  9638. * Bits 7:0
  9639. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9640. * (if the rx bandwidth was >= 160 MHz)
  9641. * Value: RSSI dB units w.r.t. noise floor
  9642. *
  9643. * - RSSI1_PRI20
  9644. * Bits 7:0
  9645. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9646. * Value: RSSI dB units w.r.t. noise floor
  9647. * - RSSI1_EXT20
  9648. * Bits 7:0
  9649. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9650. * (if the rx bandwidth was >= 40 MHz)
  9651. * Value: RSSI dB units w.r.t. noise floor
  9652. * - RSSI1_EXT40
  9653. * Bits 7:0
  9654. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9655. * (if the rx bandwidth was >= 80 MHz)
  9656. * Value: RSSI dB units w.r.t. noise floor
  9657. * - RSSI1_EXT80
  9658. * Bits 7:0
  9659. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9660. * (if the rx bandwidth was >= 160 MHz)
  9661. * Value: RSSI dB units w.r.t. noise floor
  9662. *
  9663. * - RSSI2_PRI20
  9664. * Bits 7:0
  9665. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9666. * Value: RSSI dB units w.r.t. noise floor
  9667. * - RSSI2_EXT20
  9668. * Bits 7:0
  9669. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9670. * (if the rx bandwidth was >= 40 MHz)
  9671. * Value: RSSI dB units w.r.t. noise floor
  9672. * - RSSI2_EXT40
  9673. * Bits 7:0
  9674. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9675. * (if the rx bandwidth was >= 80 MHz)
  9676. * Value: RSSI dB units w.r.t. noise floor
  9677. * - RSSI2_EXT80
  9678. * Bits 7:0
  9679. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9680. * (if the rx bandwidth was >= 160 MHz)
  9681. * Value: RSSI dB units w.r.t. noise floor
  9682. *
  9683. * - RSSI3_PRI20
  9684. * Bits 7:0
  9685. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9686. * Value: RSSI dB units w.r.t. noise floor
  9687. * - RSSI3_EXT20
  9688. * Bits 7:0
  9689. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9690. * (if the rx bandwidth was >= 40 MHz)
  9691. * Value: RSSI dB units w.r.t. noise floor
  9692. * - RSSI3_EXT40
  9693. * Bits 7:0
  9694. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9695. * (if the rx bandwidth was >= 80 MHz)
  9696. * Value: RSSI dB units w.r.t. noise floor
  9697. * - RSSI3_EXT80
  9698. * Bits 7:0
  9699. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9700. * (if the rx bandwidth was >= 160 MHz)
  9701. * Value: RSSI dB units w.r.t. noise floor
  9702. *
  9703. * - TSF32
  9704. * Bits 31:0
  9705. * Purpose: specify the time the rx PPDU was received, in TSF units
  9706. * Value: 32 LSBs of the TSF
  9707. * - TIMESTAMP_MICROSEC
  9708. * Bits 31:0
  9709. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9710. * Value: PPDU rx time, in microseconds
  9711. * - VHT_SIG_A1
  9712. * Bits 23:0
  9713. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9714. * from the rx PPDU
  9715. * Value:
  9716. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9717. * VHT-SIG-A1 data.
  9718. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9719. * first 24 bits of the HT-SIG data.
  9720. * Otherwise, this field is invalid.
  9721. * Refer to the the 802.11 protocol for the definition of the
  9722. * HT-SIG and VHT-SIG-A1 fields
  9723. * - VHT_SIG_A2
  9724. * Bits 23:0
  9725. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9726. * from the rx PPDU
  9727. * Value:
  9728. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9729. * VHT-SIG-A2 data.
  9730. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9731. * last 24 bits of the HT-SIG data.
  9732. * Otherwise, this field is invalid.
  9733. * Refer to the the 802.11 protocol for the definition of the
  9734. * HT-SIG and VHT-SIG-A2 fields
  9735. * - PREAMBLE_TYPE
  9736. * Bits 31:24
  9737. * Purpose: indicate the PHY format of the received burst
  9738. * Value:
  9739. * 0x4: Legacy (OFDM/CCK)
  9740. * 0x8: HT
  9741. * 0x9: HT with TxBF
  9742. * 0xC: VHT
  9743. * 0xD: VHT with TxBF
  9744. * - SERVICE
  9745. * Bits 31:24
  9746. * Purpose: TBD
  9747. * Value: TBD
  9748. *
  9749. * Rx MSDU descriptor fields:
  9750. * - FW_RX_DESC_BYTES
  9751. * Bits 15:0
  9752. * Purpose: Indicate how many bytes in the Rx indication are used for
  9753. * FW Rx descriptors
  9754. *
  9755. * Payload fields:
  9756. * - MPDU_COUNT
  9757. * Bits 7:0
  9758. * Purpose: Indicate how many sequential MPDUs share the same status.
  9759. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9760. * - MPDU_STATUS
  9761. * Bits 15:8
  9762. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9763. * received successfully.
  9764. * Value:
  9765. * 0x1: success
  9766. * 0x2: FCS error
  9767. * 0x3: duplicate error
  9768. * 0x4: replay error
  9769. * 0x5: invalid peer
  9770. */
  9771. /* header fields */
  9772. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9773. #define HTT_RX_IND_EXT_TID_S 8
  9774. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9775. #define HTT_RX_IND_FLUSH_VALID_S 13
  9776. #define HTT_RX_IND_REL_VALID_M 0x4000
  9777. #define HTT_RX_IND_REL_VALID_S 14
  9778. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9779. #define HTT_RX_IND_PEER_ID_S 16
  9780. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9781. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9782. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9783. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9784. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9785. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9786. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9787. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9788. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9789. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9790. /* rx PPDU descriptor fields */
  9791. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9792. #define HTT_RX_IND_RSSI_CMB_S 0
  9793. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9794. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9795. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9796. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9797. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9798. #define HTT_RX_IND_PHY_ERR_S 24
  9799. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9800. #define HTT_RX_IND_LEGACY_RATE_S 25
  9801. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9802. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9803. #define HTT_RX_IND_END_VALID_M 0x40000000
  9804. #define HTT_RX_IND_END_VALID_S 30
  9805. #define HTT_RX_IND_START_VALID_M 0x80000000
  9806. #define HTT_RX_IND_START_VALID_S 31
  9807. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9808. #define HTT_RX_IND_RSSI_PRI20_S 0
  9809. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9810. #define HTT_RX_IND_RSSI_EXT20_S 8
  9811. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9812. #define HTT_RX_IND_RSSI_EXT40_S 16
  9813. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9814. #define HTT_RX_IND_RSSI_EXT80_S 24
  9815. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9816. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9817. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9818. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9819. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9820. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9821. #define HTT_RX_IND_SERVICE_M 0xff000000
  9822. #define HTT_RX_IND_SERVICE_S 24
  9823. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9824. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9825. /* rx MSDU descriptor fields */
  9826. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9827. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9828. /* payload fields */
  9829. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9830. #define HTT_RX_IND_MPDU_COUNT_S 0
  9831. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9832. #define HTT_RX_IND_MPDU_STATUS_S 8
  9833. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9834. do { \
  9835. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9836. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9837. } while (0)
  9838. #define HTT_RX_IND_EXT_TID_GET(word) \
  9839. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9840. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9841. do { \
  9842. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9843. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9844. } while (0)
  9845. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9846. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9847. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9848. do { \
  9849. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9850. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9851. } while (0)
  9852. #define HTT_RX_IND_REL_VALID_GET(word) \
  9853. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9854. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9855. do { \
  9856. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9857. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9858. } while (0)
  9859. #define HTT_RX_IND_PEER_ID_GET(word) \
  9860. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9861. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9862. do { \
  9863. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9864. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9865. } while (0)
  9866. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9867. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9868. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9869. do { \
  9870. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9871. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9872. } while (0)
  9873. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9874. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9875. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9876. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9877. do { \
  9878. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9879. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9880. } while (0)
  9881. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9882. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9883. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9884. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9885. do { \
  9886. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9887. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9888. } while (0)
  9889. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9890. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9891. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9892. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9893. do { \
  9894. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9895. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9896. } while (0)
  9897. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9898. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9899. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9900. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9901. do { \
  9902. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9903. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9904. } while (0)
  9905. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9906. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9907. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9908. /* FW rx PPDU descriptor fields */
  9909. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9910. do { \
  9911. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9912. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9913. } while (0)
  9914. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9915. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9916. HTT_RX_IND_RSSI_CMB_S)
  9917. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9918. do { \
  9919. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9920. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9921. } while (0)
  9922. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9923. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9924. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9925. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9926. do { \
  9927. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9928. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9929. } while (0)
  9930. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9931. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9932. HTT_RX_IND_PHY_ERR_CODE_S)
  9933. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9934. do { \
  9935. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9936. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9937. } while (0)
  9938. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9939. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9940. HTT_RX_IND_PHY_ERR_S)
  9941. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9942. do { \
  9943. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9944. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9945. } while (0)
  9946. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9947. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9948. HTT_RX_IND_LEGACY_RATE_S)
  9949. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9950. do { \
  9951. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9952. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9953. } while (0)
  9954. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9955. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9956. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9957. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9958. do { \
  9959. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9960. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9961. } while (0)
  9962. #define HTT_RX_IND_END_VALID_GET(word) \
  9963. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9964. HTT_RX_IND_END_VALID_S)
  9965. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9966. do { \
  9967. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9968. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9969. } while (0)
  9970. #define HTT_RX_IND_START_VALID_GET(word) \
  9971. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9972. HTT_RX_IND_START_VALID_S)
  9973. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9974. do { \
  9975. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9976. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9977. } while (0)
  9978. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9979. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9980. HTT_RX_IND_RSSI_PRI20_S)
  9981. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9982. do { \
  9983. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9984. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9985. } while (0)
  9986. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9987. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9988. HTT_RX_IND_RSSI_EXT20_S)
  9989. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9990. do { \
  9991. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9992. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9993. } while (0)
  9994. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9995. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9996. HTT_RX_IND_RSSI_EXT40_S)
  9997. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9998. do { \
  9999. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10000. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10001. } while (0)
  10002. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10003. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10004. HTT_RX_IND_RSSI_EXT80_S)
  10005. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10006. do { \
  10007. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10008. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10009. } while (0)
  10010. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10011. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10012. HTT_RX_IND_VHT_SIG_A1_S)
  10013. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10014. do { \
  10015. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10016. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10017. } while (0)
  10018. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10019. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10020. HTT_RX_IND_VHT_SIG_A2_S)
  10021. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10022. do { \
  10023. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10024. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10025. } while (0)
  10026. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10027. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10028. HTT_RX_IND_PREAMBLE_TYPE_S)
  10029. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10030. do { \
  10031. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10032. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10033. } while (0)
  10034. #define HTT_RX_IND_SERVICE_GET(word) \
  10035. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10036. HTT_RX_IND_SERVICE_S)
  10037. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10038. do { \
  10039. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10040. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10041. } while (0)
  10042. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10043. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10044. HTT_RX_IND_SA_ANT_MATRIX_S)
  10045. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10046. do { \
  10047. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10048. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10049. } while (0)
  10050. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10051. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10052. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10053. do { \
  10054. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10055. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10056. } while (0)
  10057. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10058. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10059. #define HTT_RX_IND_HL_BYTES \
  10060. (HTT_RX_IND_HDR_BYTES + \
  10061. 4 /* single FW rx MSDU descriptor */ + \
  10062. 4 /* single MPDU range information element */)
  10063. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10064. /* Could we use one macro entry? */
  10065. #define HTT_WORD_SET(word, field, value) \
  10066. do { \
  10067. HTT_CHECK_SET_VAL(field, value); \
  10068. (word) |= ((value) << field ## _S); \
  10069. } while (0)
  10070. #define HTT_WORD_GET(word, field) \
  10071. (((word) & field ## _M) >> field ## _S)
  10072. PREPACK struct hl_htt_rx_ind_base {
  10073. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10074. } POSTPACK;
  10075. /*
  10076. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10077. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10078. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10079. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10080. * htt_rx_ind_hl_rx_desc_t.
  10081. */
  10082. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10083. struct htt_rx_ind_hl_rx_desc_t {
  10084. A_UINT8 ver;
  10085. A_UINT8 len;
  10086. struct {
  10087. A_UINT8
  10088. first_msdu: 1,
  10089. last_msdu: 1,
  10090. c3_failed: 1,
  10091. c4_failed: 1,
  10092. ipv6: 1,
  10093. tcp: 1,
  10094. udp: 1,
  10095. reserved: 1;
  10096. } flags;
  10097. /* NOTE: no reserved space - don't append any new fields here */
  10098. };
  10099. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10100. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10101. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10102. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10103. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10104. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10105. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10106. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10107. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10108. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10109. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10110. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10111. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10112. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10113. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10114. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10115. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10116. /* This structure is used in HL, the basic descriptor information
  10117. * used by host. the structure is translated by FW from HW desc
  10118. * or generated by FW. But in HL monitor mode, the host would use
  10119. * the same structure with LL.
  10120. */
  10121. PREPACK struct hl_htt_rx_desc_base {
  10122. A_UINT32
  10123. seq_num:12,
  10124. encrypted:1,
  10125. chan_info_present:1,
  10126. resv0:2,
  10127. mcast_bcast:1,
  10128. fragment:1,
  10129. key_id_oct:8,
  10130. resv1:6;
  10131. A_UINT32
  10132. pn_31_0;
  10133. union {
  10134. struct {
  10135. A_UINT16 pn_47_32;
  10136. A_UINT16 pn_63_48;
  10137. } pn16;
  10138. A_UINT32 pn_63_32;
  10139. } u0;
  10140. A_UINT32
  10141. pn_95_64;
  10142. A_UINT32
  10143. pn_127_96;
  10144. } POSTPACK;
  10145. /*
  10146. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10147. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10148. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10149. * Please see htt_chan_change_t for description of the fields.
  10150. */
  10151. PREPACK struct htt_chan_info_t
  10152. {
  10153. A_UINT32 primary_chan_center_freq_mhz: 16,
  10154. contig_chan1_center_freq_mhz: 16;
  10155. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10156. phy_mode: 8,
  10157. reserved: 8;
  10158. } POSTPACK;
  10159. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10160. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10161. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10162. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10163. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10164. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10165. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10166. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10167. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10168. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10169. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10170. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10171. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10172. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10173. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10174. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10175. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10176. /* Channel information */
  10177. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10178. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10179. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10180. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10181. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10182. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10183. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10184. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10185. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10186. do { \
  10187. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10188. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10189. } while (0)
  10190. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10191. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10192. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10193. do { \
  10194. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10195. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10196. } while (0)
  10197. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10198. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10199. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10200. do { \
  10201. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10202. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10203. } while (0)
  10204. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10205. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10206. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10207. do { \
  10208. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10209. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10210. } while (0)
  10211. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10212. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10213. /*
  10214. * @brief target -> host message definition for FW offloaded pkts
  10215. *
  10216. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10217. *
  10218. * @details
  10219. * The following field definitions describe the format of the firmware
  10220. * offload deliver message sent from the target to the host.
  10221. *
  10222. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10223. *
  10224. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10225. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10226. * | reserved_1 | msg type |
  10227. * |--------------------------------------------------------------------------|
  10228. * | phy_timestamp_l32 |
  10229. * |--------------------------------------------------------------------------|
  10230. * | WORD2 (see below) |
  10231. * |--------------------------------------------------------------------------|
  10232. * | seqno | framectrl |
  10233. * |--------------------------------------------------------------------------|
  10234. * | reserved_3 | vdev_id | tid_num|
  10235. * |--------------------------------------------------------------------------|
  10236. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10237. * |--------------------------------------------------------------------------|
  10238. *
  10239. * where:
  10240. * STAT = status
  10241. * F = format (802.3 vs. 802.11)
  10242. *
  10243. * definition for word 2
  10244. *
  10245. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10246. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10247. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10248. * |--------------------------------------------------------------------------|
  10249. *
  10250. * where:
  10251. * PR = preamble
  10252. * BF = beamformed
  10253. */
  10254. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10255. {
  10256. A_UINT32 /* word 0 */
  10257. msg_type:8, /* [ 7: 0] */
  10258. reserved_1:24; /* [31: 8] */
  10259. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10260. A_UINT32 /* word 2 */
  10261. /* preamble:
  10262. * 0-OFDM,
  10263. * 1-CCk,
  10264. * 2-HT,
  10265. * 3-VHT
  10266. */
  10267. preamble: 2, /* [1:0] */
  10268. /* mcs:
  10269. * In case of HT preamble interpret
  10270. * MCS along with NSS.
  10271. * Valid values for HT are 0 to 7.
  10272. * HT mcs 0 with NSS 2 is mcs 8.
  10273. * Valid values for VHT are 0 to 9.
  10274. */
  10275. mcs: 4, /* [5:2] */
  10276. /* rate:
  10277. * This is applicable only for
  10278. * CCK and OFDM preamble type
  10279. * rate 0: OFDM 48 Mbps,
  10280. * 1: OFDM 24 Mbps,
  10281. * 2: OFDM 12 Mbps
  10282. * 3: OFDM 6 Mbps
  10283. * 4: OFDM 54 Mbps
  10284. * 5: OFDM 36 Mbps
  10285. * 6: OFDM 18 Mbps
  10286. * 7: OFDM 9 Mbps
  10287. * rate 0: CCK 11 Mbps Long
  10288. * 1: CCK 5.5 Mbps Long
  10289. * 2: CCK 2 Mbps Long
  10290. * 3: CCK 1 Mbps Long
  10291. * 4: CCK 11 Mbps Short
  10292. * 5: CCK 5.5 Mbps Short
  10293. * 6: CCK 2 Mbps Short
  10294. */
  10295. rate : 3, /* [ 8: 6] */
  10296. rssi : 8, /* [16: 9] units=dBm */
  10297. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10298. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10299. stbc : 1, /* [22] */
  10300. sgi : 1, /* [23] */
  10301. ldpc : 1, /* [24] */
  10302. beamformed: 1, /* [25] */
  10303. reserved_2: 6; /* [31:26] */
  10304. A_UINT32 /* word 3 */
  10305. framectrl:16, /* [15: 0] */
  10306. seqno:16; /* [31:16] */
  10307. A_UINT32 /* word 4 */
  10308. tid_num:5, /* [ 4: 0] actual TID number */
  10309. vdev_id:8, /* [12: 5] */
  10310. reserved_3:19; /* [31:13] */
  10311. A_UINT32 /* word 5 */
  10312. /* status:
  10313. * 0: tx_ok
  10314. * 1: retry
  10315. * 2: drop
  10316. * 3: filtered
  10317. * 4: abort
  10318. * 5: tid delete
  10319. * 6: sw abort
  10320. * 7: dropped by peer migration
  10321. */
  10322. status:3, /* [2:0] */
  10323. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10324. tx_mpdu_bytes:16, /* [19:4] */
  10325. /* Indicates retry count of offloaded/local generated Data tx frames */
  10326. tx_retry_cnt:6, /* [25:20] */
  10327. reserved_4:6; /* [31:26] */
  10328. } POSTPACK;
  10329. /* FW offload deliver ind message header fields */
  10330. /* DWORD one */
  10331. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10332. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10333. /* DWORD two */
  10334. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10335. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10336. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10337. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10338. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10339. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10340. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10341. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10342. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10343. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10344. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10345. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10346. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10347. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10348. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10349. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10350. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10351. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10352. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10353. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10354. /* DWORD three*/
  10355. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10356. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10357. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10358. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10359. /* DWORD four */
  10360. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10361. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10362. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10363. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10364. /* DWORD five */
  10365. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10366. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10367. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10368. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10369. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10370. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10371. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10372. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10373. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10374. do { \
  10375. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10376. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10377. } while (0)
  10378. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10379. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10380. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10381. do { \
  10382. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10383. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10384. } while (0)
  10385. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10386. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10387. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10388. do { \
  10389. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10390. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10391. } while (0)
  10392. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10393. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10394. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10395. do { \
  10396. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10397. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10398. } while (0)
  10399. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10400. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10401. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10402. do { \
  10403. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10404. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10405. } while (0)
  10406. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10407. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10408. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10409. do { \
  10410. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10411. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10412. } while (0)
  10413. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10414. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10415. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10416. do { \
  10417. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10418. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10419. } while (0)
  10420. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10421. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10422. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10423. do { \
  10424. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10425. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10426. } while (0)
  10427. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10428. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10429. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10430. do { \
  10431. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10432. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10433. } while (0)
  10434. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10435. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10436. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10437. do { \
  10438. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10439. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10440. } while (0)
  10441. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10442. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10443. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10444. do { \
  10445. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10446. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10447. } while (0)
  10448. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10449. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10450. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10451. do { \
  10452. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10453. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10454. } while (0)
  10455. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10456. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10457. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10458. do { \
  10459. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10460. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10461. } while (0)
  10462. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10463. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10464. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10465. do { \
  10466. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10467. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10468. } while (0)
  10469. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10470. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10471. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10472. do { \
  10473. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10474. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10475. } while (0)
  10476. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10477. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10478. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10479. do { \
  10480. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10481. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10482. } while (0)
  10483. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10484. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10485. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10486. do { \
  10487. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10488. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10489. } while (0)
  10490. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10491. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10492. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10493. do { \
  10494. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10495. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10496. } while (0)
  10497. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10498. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10499. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10500. do { \
  10501. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10502. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10503. } while (0)
  10504. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10505. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10506. /*
  10507. * @brief target -> host rx reorder flush message definition
  10508. *
  10509. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10510. *
  10511. * @details
  10512. * The following field definitions describe the format of the rx flush
  10513. * message sent from the target to the host.
  10514. * The message consists of a 4-octet header, followed by one or more
  10515. * 4-octet payload information elements.
  10516. *
  10517. * |31 24|23 8|7 0|
  10518. * |--------------------------------------------------------------|
  10519. * | TID | peer ID | msg type |
  10520. * |--------------------------------------------------------------|
  10521. * | seq num end | seq num start | MPDU status | reserved |
  10522. * |--------------------------------------------------------------|
  10523. * First DWORD:
  10524. * - MSG_TYPE
  10525. * Bits 7:0
  10526. * Purpose: identifies this as an rx flush message
  10527. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10528. * - PEER_ID
  10529. * Bits 23:8 (only bits 18:8 actually used)
  10530. * Purpose: identify which peer's rx data is being flushed
  10531. * Value: (rx) peer ID
  10532. * - TID
  10533. * Bits 31:24 (only bits 27:24 actually used)
  10534. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10535. * Value: traffic identifier
  10536. * Second DWORD:
  10537. * - MPDU_STATUS
  10538. * Bits 15:8
  10539. * Purpose:
  10540. * Indicate whether the flushed MPDUs should be discarded or processed.
  10541. * Value:
  10542. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10543. * stages of rx processing
  10544. * other: discard the MPDUs
  10545. * It is anticipated that flush messages will always have
  10546. * MPDU status == 1, but the status flag is included for
  10547. * flexibility.
  10548. * - SEQ_NUM_START
  10549. * Bits 23:16
  10550. * Purpose:
  10551. * Indicate the start of a series of consecutive MPDUs being flushed.
  10552. * Not all MPDUs within this range are necessarily valid - the host
  10553. * must check each sequence number within this range to see if the
  10554. * corresponding MPDU is actually present.
  10555. * Value:
  10556. * The sequence number for the first MPDU in the sequence.
  10557. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10558. * - SEQ_NUM_END
  10559. * Bits 30:24
  10560. * Purpose:
  10561. * Indicate the end of a series of consecutive MPDUs being flushed.
  10562. * Value:
  10563. * The sequence number one larger than the sequence number of the
  10564. * last MPDU being flushed.
  10565. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10566. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10567. * are to be released for further rx processing.
  10568. * Not all MPDUs within this range are necessarily valid - the host
  10569. * must check each sequence number within this range to see if the
  10570. * corresponding MPDU is actually present.
  10571. */
  10572. /* first DWORD */
  10573. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10574. #define HTT_RX_FLUSH_PEER_ID_S 8
  10575. #define HTT_RX_FLUSH_TID_M 0xff000000
  10576. #define HTT_RX_FLUSH_TID_S 24
  10577. /* second DWORD */
  10578. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10579. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10580. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10581. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10582. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10583. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10584. #define HTT_RX_FLUSH_BYTES 8
  10585. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10588. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10589. } while (0)
  10590. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10591. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10592. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10595. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10596. } while (0)
  10597. #define HTT_RX_FLUSH_TID_GET(word) \
  10598. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10599. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10600. do { \
  10601. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10602. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10603. } while (0)
  10604. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10605. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10606. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10607. do { \
  10608. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10609. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10610. } while (0)
  10611. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10612. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10613. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10614. do { \
  10615. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10616. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10617. } while (0)
  10618. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10619. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10620. /*
  10621. * @brief target -> host rx pn check indication message
  10622. *
  10623. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10624. *
  10625. * @details
  10626. * The following field definitions describe the format of the Rx PN check
  10627. * indication message sent from the target to the host.
  10628. * The message consists of a 4-octet header, followed by the start and
  10629. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10630. * IE is one octet containing the sequence number that failed the PN
  10631. * check.
  10632. *
  10633. * |31 24|23 8|7 0|
  10634. * |--------------------------------------------------------------|
  10635. * | TID | peer ID | msg type |
  10636. * |--------------------------------------------------------------|
  10637. * | Reserved | PN IE count | seq num end | seq num start|
  10638. * |--------------------------------------------------------------|
  10639. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10640. * |--------------------------------------------------------------|
  10641. * First DWORD:
  10642. * - MSG_TYPE
  10643. * Bits 7:0
  10644. * Purpose: Identifies this as an rx pn check indication message
  10645. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10646. * - PEER_ID
  10647. * Bits 23:8 (only bits 18:8 actually used)
  10648. * Purpose: identify which peer
  10649. * Value: (rx) peer ID
  10650. * - TID
  10651. * Bits 31:24 (only bits 27:24 actually used)
  10652. * Purpose: identify traffic identifier
  10653. * Value: traffic identifier
  10654. * Second DWORD:
  10655. * - SEQ_NUM_START
  10656. * Bits 7:0
  10657. * Purpose:
  10658. * Indicates the starting sequence number of the MPDU in this
  10659. * series of MPDUs that went though PN check.
  10660. * Value:
  10661. * The sequence number for the first MPDU in the sequence.
  10662. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10663. * - SEQ_NUM_END
  10664. * Bits 15:8
  10665. * Purpose:
  10666. * Indicates the ending sequence number of the MPDU in this
  10667. * series of MPDUs that went though PN check.
  10668. * Value:
  10669. * The sequence number one larger then the sequence number of the last
  10670. * MPDU being flushed.
  10671. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10672. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10673. * for invalid PN numbers and are ready to be released for further processing.
  10674. * Not all MPDUs within this range are necessarily valid - the host
  10675. * must check each sequence number within this range to see if the
  10676. * corresponding MPDU is actually present.
  10677. * - PN_IE_COUNT
  10678. * Bits 23:16
  10679. * Purpose:
  10680. * Used to determine the variable number of PN information elements in this
  10681. * message
  10682. *
  10683. * PN information elements:
  10684. * - PN_IE_x-
  10685. * Purpose:
  10686. * Each PN information element contains the sequence number of the MPDU that
  10687. * has failed the target PN check.
  10688. * Value:
  10689. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10690. * that failed the PN check.
  10691. */
  10692. /* first DWORD */
  10693. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10694. #define HTT_RX_PN_IND_PEER_ID_S 8
  10695. #define HTT_RX_PN_IND_TID_M 0xff000000
  10696. #define HTT_RX_PN_IND_TID_S 24
  10697. /* second DWORD */
  10698. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10699. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10700. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10701. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10702. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10703. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10704. #define HTT_RX_PN_IND_BYTES 8
  10705. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10708. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10709. } while (0)
  10710. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10711. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10712. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10713. do { \
  10714. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10715. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10716. } while (0)
  10717. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10718. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10719. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10720. do { \
  10721. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10722. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10723. } while (0)
  10724. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10725. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10726. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10727. do { \
  10728. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10729. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10730. } while (0)
  10731. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10732. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10733. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10734. do { \
  10735. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10736. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10737. } while (0)
  10738. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10739. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10740. /*
  10741. * @brief target -> host rx offload deliver message for LL system
  10742. *
  10743. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10744. *
  10745. * @details
  10746. * In a low latency system this message is sent whenever the offload
  10747. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10748. * The DMA of the actual packets into host memory is done before sending out
  10749. * this message. This message indicates only how many MSDUs to reap. The
  10750. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10751. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10752. * DMA'd by the MAC directly into host memory these packets do not contain
  10753. * the MAC descriptors in the header portion of the packet. Instead they contain
  10754. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10755. * message, the packets are delivered directly to the NW stack without going
  10756. * through the regular reorder buffering and PN checking path since it has
  10757. * already been done in target.
  10758. *
  10759. * |31 24|23 16|15 8|7 0|
  10760. * |-----------------------------------------------------------------------|
  10761. * | Total MSDU count | reserved | msg type |
  10762. * |-----------------------------------------------------------------------|
  10763. *
  10764. * @brief target -> host rx offload deliver message for HL system
  10765. *
  10766. * @details
  10767. * In a high latency system this message is sent whenever the offload manager
  10768. * flushes out the packets it has coalesced in its coalescing buffer. The
  10769. * actual packets are also carried along with this message. When the host
  10770. * receives this message, it is expected to deliver these packets to the NW
  10771. * stack directly instead of routing them through the reorder buffering and
  10772. * PN checking path since it has already been done in target.
  10773. *
  10774. * |31 24|23 16|15 8|7 0|
  10775. * |-----------------------------------------------------------------------|
  10776. * | Total MSDU count | reserved | msg type |
  10777. * |-----------------------------------------------------------------------|
  10778. * | peer ID | MSDU length |
  10779. * |-----------------------------------------------------------------------|
  10780. * | MSDU payload | FW Desc | tid | vdev ID |
  10781. * |-----------------------------------------------------------------------|
  10782. * | MSDU payload contd. |
  10783. * |-----------------------------------------------------------------------|
  10784. * | peer ID | MSDU length |
  10785. * |-----------------------------------------------------------------------|
  10786. * | MSDU payload | FW Desc | tid | vdev ID |
  10787. * |-----------------------------------------------------------------------|
  10788. * | MSDU payload contd. |
  10789. * |-----------------------------------------------------------------------|
  10790. *
  10791. */
  10792. /* first DWORD */
  10793. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10795. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10797. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10799. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10800. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10801. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10802. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10804. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10805. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10806. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10807. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10808. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10809. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10810. do { \
  10811. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10812. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10813. } while (0)
  10814. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10815. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10816. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10819. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10820. } while (0)
  10821. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10822. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10823. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10826. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10827. } while (0)
  10828. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10829. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10830. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10833. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10834. } while (0)
  10835. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10836. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10837. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10838. do { \
  10839. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10840. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10841. } while (0)
  10842. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10843. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10844. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10845. do { \
  10846. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10847. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10848. } while (0)
  10849. /**
  10850. * @brief target -> host rx peer map/unmap message definition
  10851. *
  10852. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10853. *
  10854. * @details
  10855. * The following diagram shows the format of the rx peer map message sent
  10856. * from the target to the host. This layout assumes the target operates
  10857. * as little-endian.
  10858. *
  10859. * This message always contains a SW peer ID. The main purpose of the
  10860. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10861. * with, so that the host can use that peer ID to determine which peer
  10862. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10863. * other purposes, such as identifying during tx completions which peer
  10864. * the tx frames in question were transmitted to.
  10865. *
  10866. * In certain generations of chips, the peer map message also contains
  10867. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10868. * to identify which peer the frame needs to be forwarded to (i.e. the
  10869. * peer assocated with the Destination MAC Address within the packet),
  10870. * and particularly which vdev needs to transmit the frame (for cases
  10871. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10872. * meaning as AST_INDEX_0.
  10873. * This DA-based peer ID that is provided for certain rx frames
  10874. * (the rx frames that need to be re-transmitted as tx frames)
  10875. * is the ID that the HW uses for referring to the peer in question,
  10876. * rather than the peer ID that the SW+FW use to refer to the peer.
  10877. *
  10878. *
  10879. * |31 24|23 16|15 8|7 0|
  10880. * |-----------------------------------------------------------------------|
  10881. * | SW peer ID | VDEV ID | msg type |
  10882. * |-----------------------------------------------------------------------|
  10883. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10884. * |-----------------------------------------------------------------------|
  10885. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10886. * |-----------------------------------------------------------------------|
  10887. *
  10888. *
  10889. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10890. *
  10891. * The following diagram shows the format of the rx peer unmap message sent
  10892. * from the target to the host.
  10893. *
  10894. * |31 24|23 16|15 8|7 0|
  10895. * |-----------------------------------------------------------------------|
  10896. * | SW peer ID | VDEV ID | msg type |
  10897. * |-----------------------------------------------------------------------|
  10898. *
  10899. * The following field definitions describe the format of the rx peer map
  10900. * and peer unmap messages sent from the target to the host.
  10901. * - MSG_TYPE
  10902. * Bits 7:0
  10903. * Purpose: identifies this as an rx peer map or peer unmap message
  10904. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10905. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10906. * - VDEV_ID
  10907. * Bits 15:8
  10908. * Purpose: Indicates which virtual device the peer is associated
  10909. * with.
  10910. * Value: vdev ID (used in the host to look up the vdev object)
  10911. * - PEER_ID (a.k.a. SW_PEER_ID)
  10912. * Bits 31:16
  10913. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10914. * freeing (unmap)
  10915. * Value: (rx) peer ID
  10916. * - MAC_ADDR_L32 (peer map only)
  10917. * Bits 31:0
  10918. * Purpose: Identifies which peer node the peer ID is for.
  10919. * Value: lower 4 bytes of peer node's MAC address
  10920. * - MAC_ADDR_U16 (peer map only)
  10921. * Bits 15:0
  10922. * Purpose: Identifies which peer node the peer ID is for.
  10923. * Value: upper 2 bytes of peer node's MAC address
  10924. * - HW_PEER_ID
  10925. * Bits 31:16
  10926. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10927. * address, so for rx frames marked for rx --> tx forwarding, the
  10928. * host can determine from the HW peer ID provided as meta-data with
  10929. * the rx frame which peer the frame is supposed to be forwarded to.
  10930. * Value: ID used by the MAC HW to identify the peer
  10931. */
  10932. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10933. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10934. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10935. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10936. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10937. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10938. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10939. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10940. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10941. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10942. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10943. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10944. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10945. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10946. do { \
  10947. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10948. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10949. } while (0)
  10950. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10951. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10952. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10953. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10954. do { \
  10955. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10956. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10957. } while (0)
  10958. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10959. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10960. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10961. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10962. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10963. do { \
  10964. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10965. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10966. } while (0)
  10967. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10968. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10969. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10970. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10971. #define HTT_RX_PEER_MAP_BYTES 12
  10972. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10973. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10974. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10975. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10976. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10977. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10978. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10979. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10980. #define HTT_RX_PEER_UNMAP_BYTES 4
  10981. /**
  10982. * @brief target -> host rx peer map V2 message definition
  10983. *
  10984. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10985. *
  10986. * @details
  10987. * The following diagram shows the format of the rx peer map v2 message sent
  10988. * from the target to the host. This layout assumes the target operates
  10989. * as little-endian.
  10990. *
  10991. * This message always contains a SW peer ID. The main purpose of the
  10992. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10993. * with, so that the host can use that peer ID to determine which peer
  10994. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10995. * other purposes, such as identifying during tx completions which peer
  10996. * the tx frames in question were transmitted to.
  10997. *
  10998. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10999. * is used during rx --> tx frame forwarding to identify which peer the
  11000. * frame needs to be forwarded to (i.e. the peer assocated with the
  11001. * Destination MAC Address within the packet), and particularly which vdev
  11002. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11003. * This DA-based peer ID that is provided for certain rx frames
  11004. * (the rx frames that need to be re-transmitted as tx frames)
  11005. * is the ID that the HW uses for referring to the peer in question,
  11006. * rather than the peer ID that the SW+FW use to refer to the peer.
  11007. *
  11008. * The HW peer id here is the same meaning as AST_INDEX_0.
  11009. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11010. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11011. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11012. * AST is valid.
  11013. *
  11014. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11015. * |-------------------------------------------------------------------------|
  11016. * | SW peer ID | VDEV ID | msg type |
  11017. * |-------------------------------------------------------------------------|
  11018. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11019. * |-------------------------------------------------------------------------|
  11020. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11021. * |-------------------------------------------------------------------------|
  11022. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11023. * |-------------------------------------------------------------------------|
  11024. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11025. * |-------------------------------------------------------------------------|
  11026. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11027. * |-------------------------------------------------------------------------|
  11028. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11029. * |-------------------------------------------------------------------------|
  11030. * | Reserved_2 |
  11031. * |-------------------------------------------------------------------------|
  11032. * Where:
  11033. * NH = Next Hop
  11034. * ASTVM = AST valid mask
  11035. * OA = on-chip AST valid bit
  11036. * ASTFM = AST flow mask
  11037. *
  11038. * The following field definitions describe the format of the rx peer map v2
  11039. * messages sent from the target to the host.
  11040. * - MSG_TYPE
  11041. * Bits 7:0
  11042. * Purpose: identifies this as an rx peer map v2 message
  11043. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11044. * - VDEV_ID
  11045. * Bits 15:8
  11046. * Purpose: Indicates which virtual device the peer is associated with.
  11047. * Value: vdev ID (used in the host to look up the vdev object)
  11048. * - SW_PEER_ID
  11049. * Bits 31:16
  11050. * Purpose: The peer ID (index) that WAL is allocating
  11051. * Value: (rx) peer ID
  11052. * - MAC_ADDR_L32
  11053. * Bits 31:0
  11054. * Purpose: Identifies which peer node the peer ID is for.
  11055. * Value: lower 4 bytes of peer node's MAC address
  11056. * - MAC_ADDR_U16
  11057. * Bits 15:0
  11058. * Purpose: Identifies which peer node the peer ID is for.
  11059. * Value: upper 2 bytes of peer node's MAC address
  11060. * - HW_PEER_ID / AST_INDEX_0
  11061. * Bits 31:16
  11062. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11063. * address, so for rx frames marked for rx --> tx forwarding, the
  11064. * host can determine from the HW peer ID provided as meta-data with
  11065. * the rx frame which peer the frame is supposed to be forwarded to.
  11066. * Value: ID used by the MAC HW to identify the peer
  11067. * - AST_HASH_VALUE
  11068. * Bits 15:0
  11069. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11070. * override feature.
  11071. * - NEXT_HOP
  11072. * Bit 16
  11073. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11074. * (Wireless Distribution System).
  11075. * - AST_VALID_MASK
  11076. * Bits 19:17
  11077. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11078. * - ONCHIP_AST_VALID_FLAG
  11079. * Bit 20
  11080. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11081. * is valid.
  11082. * - AST_INDEX_1
  11083. * Bits 15:0
  11084. * Purpose: indicate the second AST index for this peer
  11085. * - AST_0_FLOW_MASK
  11086. * Bits 19:16
  11087. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11088. * - AST_1_FLOW_MASK
  11089. * Bits 23:20
  11090. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11091. * - AST_2_FLOW_MASK
  11092. * Bits 27:24
  11093. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11094. * - AST_3_FLOW_MASK
  11095. * Bits 31:28
  11096. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11097. * - AST_INDEX_2
  11098. * Bits 15:0
  11099. * Purpose: indicate the third AST index for this peer
  11100. * - TID_VALID_HI_PRI
  11101. * Bits 23:16
  11102. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11103. * - TID_VALID_LOW_PRI
  11104. * Bits 31:24
  11105. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11106. * - AST_INDEX_3
  11107. * Bits 15:0
  11108. * Purpose: indicate the fourth AST index for this peer
  11109. * - ONCHIP_AST_IDX / RESERVED
  11110. * Bits 31:16
  11111. * Purpose: This field is valid only when split AST feature is enabled.
  11112. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11113. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11114. * address, this ast_idx is used for LMAC modules for RXPCU.
  11115. * Value: ID used by the LMAC HW to identify the peer
  11116. */
  11117. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11118. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11119. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11120. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11121. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11122. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11123. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11124. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11125. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11126. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11127. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11128. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11129. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11130. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11131. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11132. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11133. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11134. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11135. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11136. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11137. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11138. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11139. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11140. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11141. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11142. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11143. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11144. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11145. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11146. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11147. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11148. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11149. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11150. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11151. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11152. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11153. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11154. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11155. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11156. do { \
  11157. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11158. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11159. } while (0)
  11160. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11161. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11162. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11163. do { \
  11164. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11165. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11166. } while (0)
  11167. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11168. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11169. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11172. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11173. } while (0)
  11174. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11175. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11176. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11179. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11180. } while (0)
  11181. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11182. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11183. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11184. do { \
  11185. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11186. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11187. } while (0)
  11188. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11189. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11190. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11191. do { \
  11192. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11193. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11194. } while (0)
  11195. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11196. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11197. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11198. do { \
  11199. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11200. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11201. } while (0)
  11202. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11203. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11204. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11205. do { \
  11206. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11207. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11208. } while (0)
  11209. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11210. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11211. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11212. do { \
  11213. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11214. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11215. } while (0)
  11216. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11217. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11218. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11219. do { \
  11220. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11221. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11222. } while (0)
  11223. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11224. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11225. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11226. do { \
  11227. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11228. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11229. } while (0)
  11230. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11231. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11232. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11233. do { \
  11234. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11235. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11236. } while (0)
  11237. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11238. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11239. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11240. do { \
  11241. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11242. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11243. } while (0)
  11244. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11245. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11246. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11247. do { \
  11248. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11249. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11250. } while (0)
  11251. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11252. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11253. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11254. do { \
  11255. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11256. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11257. } while (0)
  11258. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11259. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11260. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11261. do { \
  11262. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11263. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11264. } while (0)
  11265. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11266. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11267. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11268. do { \
  11269. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11270. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11271. } while (0)
  11272. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11273. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11274. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11279. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11280. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11281. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11282. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11283. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11284. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11285. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11286. /**
  11287. * @brief target -> host rx peer map V3 message definition
  11288. *
  11289. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11290. *
  11291. * @details
  11292. * The following diagram shows the format of the rx peer map v3 message sent
  11293. * from the target to the host.
  11294. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11295. * This layout assumes the target operates as little-endian.
  11296. *
  11297. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11298. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11299. * | SW peer ID | VDEV ID | msg type |
  11300. * |-----------------+--------------------+-----------------+-----------------|
  11301. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11302. * |-----------------+--------------------+-----------------+-----------------|
  11303. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11304. * |-----------------+--------+-----------+-----------------+-----------------|
  11305. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11306. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11307. * | (8bits) | | (4bits) | |
  11308. * |-----------------+--------+--+--+--+--------------------------------------|
  11309. * | RESERVED |E |O | | |
  11310. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11311. * | |V |V | | |
  11312. * |-----------------+--------------------+-----------------------------------|
  11313. * | HTT_MSDU_IDX_ | RESERVED | |
  11314. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11315. * | (8bits) | | |
  11316. * |-----------------+--------------------+-----------------------------------|
  11317. * | Reserved_2 |
  11318. * |--------------------------------------------------------------------------|
  11319. * | Reserved_3 |
  11320. * |--------------------------------------------------------------------------|
  11321. *
  11322. * Where:
  11323. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11324. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11325. * NH = Next Hop
  11326. * The following field definitions describe the format of the rx peer map v3
  11327. * messages sent from the target to the host.
  11328. * - MSG_TYPE
  11329. * Bits 7:0
  11330. * Purpose: identifies this as a peer map v3 message
  11331. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11332. * - VDEV_ID
  11333. * Bits 15:8
  11334. * Purpose: Indicates which virtual device the peer is associated with.
  11335. * - SW_PEER_ID
  11336. * Bits 31:16
  11337. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11338. * - MAC_ADDR_L32
  11339. * Bits 31:0
  11340. * Purpose: Identifies which peer node the peer ID is for.
  11341. * Value: lower 4 bytes of peer node's MAC address
  11342. * - MAC_ADDR_U16
  11343. * Bits 15:0
  11344. * Purpose: Identifies which peer node the peer ID is for.
  11345. * Value: upper 2 bytes of peer node's MAC address
  11346. * - MULTICAST_SW_PEER_ID
  11347. * Bits 31:16
  11348. * Purpose: The multicast peer ID (index)
  11349. * Value: set to HTT_INVALID_PEER if not valid
  11350. * - HW_PEER_ID / AST_INDEX
  11351. * Bits 15:0
  11352. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11353. * address, so for rx frames marked for rx --> tx forwarding, the
  11354. * host can determine from the HW peer ID provided as meta-data with
  11355. * the rx frame which peer the frame is supposed to be forwarded to.
  11356. * - CACHE_SET_NUM
  11357. * Bits 19:16
  11358. * Purpose: Cache Set Number for AST_INDEX
  11359. * Cache set number that should be used to cache the index based
  11360. * search results, for address and flow search.
  11361. * This value should be equal to LSB 4 bits of the hash value
  11362. * of match data, in case of search index points to an entry which
  11363. * may be used in content based search also. The value can be
  11364. * anything when the entry pointed by search index will not be
  11365. * used for content based search.
  11366. * - HTT_MSDU_IDX_VALID_MASK
  11367. * Bits 31:24
  11368. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11369. * - ONCHIP_AST_IDX / RESERVED
  11370. * Bits 15:0
  11371. * Purpose: This field is valid only when split AST feature is enabled.
  11372. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11373. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11374. * address, this ast_idx is used for LMAC modules for RXPCU.
  11375. * - NEXT_HOP
  11376. * Bits 16
  11377. * Purpose: Flag indicates next_hop AST entry used for WDS
  11378. * (Wireless Distribution System).
  11379. * - ONCHIP_AST_VALID
  11380. * Bits 17
  11381. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11382. * - EXT_AST_VALID
  11383. * Bits 18
  11384. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11385. * - EXT_AST_INDEX
  11386. * Bits 15:0
  11387. * Purpose: This field describes Extended AST index
  11388. * Valid if EXT_AST_VALID flag set
  11389. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11390. * Bits 31:24
  11391. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11392. */
  11393. /* dword 0 */
  11394. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11395. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11396. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11397. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11398. /* dword 1 */
  11399. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11400. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11401. /* dword 2 */
  11402. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11403. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11404. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11405. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11406. /* dword 3 */
  11407. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11408. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11409. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11410. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11411. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11412. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11413. /* dword 4 */
  11414. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11415. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11416. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11417. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11418. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11419. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11420. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11421. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11422. /* dword 5 */
  11423. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11424. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11425. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11426. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11427. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11428. do { \
  11429. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11430. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11431. } while (0)
  11432. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11433. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11434. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11435. do { \
  11436. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11437. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11438. } while (0)
  11439. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11440. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11441. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11442. do { \
  11443. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11444. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11445. } while (0)
  11446. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11447. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11448. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11449. do { \
  11450. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11451. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11452. } while (0)
  11453. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11454. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11455. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11456. do { \
  11457. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11458. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11459. } while (0)
  11460. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11461. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11462. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11463. do { \
  11464. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11465. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11466. } while (0)
  11467. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11468. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11469. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11470. do { \
  11471. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11472. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11473. } while (0)
  11474. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11475. (((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)
  11476. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11477. do { \
  11478. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11479. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11480. } while (0)
  11481. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11482. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11483. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11484. do { \
  11485. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11486. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11487. } while (0)
  11488. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11489. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11490. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11491. do { \
  11492. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11493. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11494. } while (0)
  11495. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11496. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11497. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11498. do { \
  11499. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11500. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11501. } while (0)
  11502. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11503. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11504. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11505. do { \
  11506. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11507. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11508. } while (0)
  11509. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11510. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11511. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11512. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11513. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11514. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11515. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11516. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11517. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11518. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11519. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11520. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11521. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11522. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11523. /**
  11524. * @brief target -> host rx peer unmap V2 message definition
  11525. *
  11526. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11527. *
  11528. * The following diagram shows the format of the rx peer unmap message sent
  11529. * from the target to the host.
  11530. *
  11531. * |31 24|23 16|15 8|7 0|
  11532. * |-----------------------------------------------------------------------|
  11533. * | SW peer ID | VDEV ID | msg type |
  11534. * |-----------------------------------------------------------------------|
  11535. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11536. * |-----------------------------------------------------------------------|
  11537. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11538. * |-----------------------------------------------------------------------|
  11539. * | Peer Delete Duration |
  11540. * |-----------------------------------------------------------------------|
  11541. * | Reserved_0 | WDS Free Count |
  11542. * |-----------------------------------------------------------------------|
  11543. * | Reserved_1 |
  11544. * |-----------------------------------------------------------------------|
  11545. * | Reserved_2 |
  11546. * |-----------------------------------------------------------------------|
  11547. *
  11548. *
  11549. * The following field definitions describe the format of the rx peer unmap
  11550. * messages sent from the target to the host.
  11551. * - MSG_TYPE
  11552. * Bits 7:0
  11553. * Purpose: identifies this as an rx peer unmap v2 message
  11554. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11555. * - VDEV_ID
  11556. * Bits 15:8
  11557. * Purpose: Indicates which virtual device the peer is associated
  11558. * with.
  11559. * Value: vdev ID (used in the host to look up the vdev object)
  11560. * - SW_PEER_ID
  11561. * Bits 31:16
  11562. * Purpose: The peer ID (index) that WAL is freeing
  11563. * Value: (rx) peer ID
  11564. * - MAC_ADDR_L32
  11565. * Bits 31:0
  11566. * Purpose: Identifies which peer node the peer ID is for.
  11567. * Value: lower 4 bytes of peer node's MAC address
  11568. * - MAC_ADDR_U16
  11569. * Bits 15:0
  11570. * Purpose: Identifies which peer node the peer ID is for.
  11571. * Value: upper 2 bytes of peer node's MAC address
  11572. * - NEXT_HOP
  11573. * Bits 16
  11574. * Purpose: Bit indicates next_hop AST entry used for WDS
  11575. * (Wireless Distribution System).
  11576. * - PEER_DELETE_DURATION
  11577. * Bits 31:0
  11578. * Purpose: Time taken to delete peer, in msec,
  11579. * Used for monitoring / debugging PEER delete response delay
  11580. * - PEER_WDS_FREE_COUNT
  11581. * Bits 15:0
  11582. * Purpose: Count of WDS entries deleted associated to peer deleted
  11583. */
  11584. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11585. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11586. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11587. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11588. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11589. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11590. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11591. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11592. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11593. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11594. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11595. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11596. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11597. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11598. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11599. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11600. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11601. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11602. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11603. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11604. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11605. do { \
  11606. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11607. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11608. } while (0)
  11609. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11610. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11611. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11612. do { \
  11613. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11614. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11615. } while (0)
  11616. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11617. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11618. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11619. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11620. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11621. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11622. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11623. /**
  11624. * @brief target -> host rx peer mlo map message definition
  11625. *
  11626. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11627. *
  11628. * @details
  11629. * The following diagram shows the format of the rx mlo peer map message sent
  11630. * from the target to the host. This layout assumes the target operates
  11631. * as little-endian.
  11632. *
  11633. * MCC:
  11634. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11635. *
  11636. * WIN:
  11637. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11638. * It will be sent on the Assoc Link.
  11639. *
  11640. * This message always contains a MLO peer ID. The main purpose of the
  11641. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11642. * with, so that the host can use that MLO peer ID to determine which peer
  11643. * transmitted the rx frame.
  11644. *
  11645. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11646. * |-------------------------------------------------------------------------|
  11647. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11648. * |-------------------------------------------------------------------------|
  11649. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11650. * |-------------------------------------------------------------------------|
  11651. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11652. * |-------------------------------------------------------------------------|
  11653. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11654. * |-------------------------------------------------------------------------|
  11655. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11656. * |-------------------------------------------------------------------------|
  11657. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11658. * |-------------------------------------------------------------------------|
  11659. * |RSVD |
  11660. * |-------------------------------------------------------------------------|
  11661. * |RSVD |
  11662. * |-------------------------------------------------------------------------|
  11663. * | htt_tlv_hdr_t |
  11664. * |-------------------------------------------------------------------------|
  11665. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11666. * |-------------------------------------------------------------------------|
  11667. * | htt_tlv_hdr_t |
  11668. * |-------------------------------------------------------------------------|
  11669. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11670. * |-------------------------------------------------------------------------|
  11671. * | htt_tlv_hdr_t |
  11672. * |-------------------------------------------------------------------------|
  11673. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11674. * |-------------------------------------------------------------------------|
  11675. *
  11676. * Where:
  11677. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11678. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11679. * V (valid) - 1 Bit Bit17
  11680. * CHIPID - 3 Bits
  11681. * TIDMASK - 8 Bits
  11682. * CACHE_SET_NUM - 8 Bits
  11683. *
  11684. * The following field definitions describe the format of the rx MLO peer map
  11685. * messages sent from the target to the host.
  11686. * - MSG_TYPE
  11687. * Bits 7:0
  11688. * Purpose: identifies this as an rx mlo peer map message
  11689. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11690. *
  11691. * - MLO_PEER_ID
  11692. * Bits 23:8
  11693. * Purpose: The MLO peer ID (index).
  11694. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11695. * Value: MLO peer ID
  11696. *
  11697. * - NUMLINK
  11698. * Bits: 26:24 (3Bits)
  11699. * Purpose: Indicate the max number of logical links supported per client.
  11700. * Value: number of logical links
  11701. *
  11702. * - PRC
  11703. * Bits: 29:27 (3Bits)
  11704. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11705. * if there is migration of the primary chip.
  11706. * Value: Primary REO CHIPID
  11707. *
  11708. * - MAC_ADDR_L32
  11709. * Bits 31:0
  11710. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11711. * Value: lower 4 bytes of peer node's MAC address
  11712. *
  11713. * - MAC_ADDR_U16
  11714. * Bits 15:0
  11715. * Purpose: Identifies which peer node the peer ID is for.
  11716. * Value: upper 2 bytes of peer node's MAC address
  11717. *
  11718. * - PRIMARY_TCL_AST_IDX
  11719. * Bits 15:0
  11720. * Purpose: Primary TCL AST index for this peer.
  11721. *
  11722. * - V
  11723. * 1 Bit Position 16
  11724. * Purpose: If the ast idx is valid.
  11725. *
  11726. * - CHIPID
  11727. * Bits 19:17
  11728. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11729. *
  11730. * - TIDMASK
  11731. * Bits 27:20
  11732. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11733. *
  11734. * - CACHE_SET_NUM
  11735. * Bits 31:28
  11736. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11737. * Cache set number that should be used to cache the index based
  11738. * search results, for address and flow search.
  11739. * This value should be equal to LSB four bits of the hash value
  11740. * of match data, in case of search index points to an entry which
  11741. * may be used in content based search also. The value can be
  11742. * anything when the entry pointed by search index will not be
  11743. * used for content based search.
  11744. *
  11745. * - htt_tlv_hdr_t
  11746. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11747. *
  11748. * Bits 11:0
  11749. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11750. *
  11751. * Bits 23:12
  11752. * Purpose: Length, Length of the value that follows the header
  11753. *
  11754. * Bits 31:28
  11755. * Purpose: Reserved.
  11756. *
  11757. *
  11758. * - SW_PEER_ID
  11759. * Bits 15:0
  11760. * Purpose: The peer ID (index) that WAL is allocating
  11761. * Value: (rx) peer ID
  11762. *
  11763. * - VDEV_ID
  11764. * Bits 23:16
  11765. * Purpose: Indicates which virtual device the peer is associated with.
  11766. * Value: vdev ID (used in the host to look up the vdev object)
  11767. *
  11768. * - CHIPID
  11769. * Bits 26:24
  11770. * Purpose: Indicates which Chip id the peer is associated with.
  11771. * Value: chip ID (Provided by Host as part of QMI exchange)
  11772. */
  11773. typedef enum {
  11774. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11775. } MLO_PEER_MAP_TLV_TAG_ID;
  11776. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11777. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11778. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11779. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11780. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11781. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11782. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11783. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11784. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11785. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11786. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11787. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11788. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11789. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11790. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11791. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11792. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11793. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11794. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11795. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11796. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11797. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11798. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11799. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11800. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11801. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11802. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11803. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11804. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11805. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11806. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11807. do { \
  11808. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11809. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11810. } while (0)
  11811. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11812. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11813. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11814. do { \
  11815. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11816. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11817. } while (0)
  11818. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11819. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11820. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11821. do { \
  11822. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11823. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11824. } while (0)
  11825. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11826. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11827. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11828. do { \
  11829. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11830. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11831. } while (0)
  11832. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11833. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11834. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11837. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11838. } while (0)
  11839. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11840. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11841. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11844. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11845. } while (0)
  11846. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11847. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11848. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11851. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11852. } while (0)
  11853. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11854. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11855. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11856. do { \
  11857. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11858. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11859. } while (0)
  11860. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11861. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11862. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11863. do { \
  11864. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11865. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11866. } while (0)
  11867. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11868. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11869. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11870. do { \
  11871. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11872. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11873. } while (0)
  11874. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11875. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11876. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11877. do { \
  11878. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11879. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11880. } while (0)
  11881. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11882. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11883. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11884. do { \
  11885. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11886. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11887. } while (0)
  11888. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11889. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11890. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11891. do { \
  11892. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11893. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11894. } while (0)
  11895. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11896. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11897. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11898. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11899. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11900. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11901. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11902. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11903. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11904. *
  11905. * The following diagram shows the format of the rx mlo peer unmap message sent
  11906. * from the target to the host.
  11907. *
  11908. * |31 24|23 16|15 8|7 0|
  11909. * |-----------------------------------------------------------------------|
  11910. * | RSVD_24_31 | MLO peer ID | msg type |
  11911. * |-----------------------------------------------------------------------|
  11912. */
  11913. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11914. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11915. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11916. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11917. /**
  11918. * @brief target -> host message specifying security parameters
  11919. *
  11920. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11921. *
  11922. * @details
  11923. * The following diagram shows the format of the security specification
  11924. * message sent from the target to the host.
  11925. * This security specification message tells the host whether a PN check is
  11926. * necessary on rx data frames, and if so, how large the PN counter is.
  11927. * This message also tells the host about the security processing to apply
  11928. * to defragmented rx frames - specifically, whether a Message Integrity
  11929. * Check is required, and the Michael key to use.
  11930. *
  11931. * |31 24|23 16|15|14 8|7 0|
  11932. * |-----------------------------------------------------------------------|
  11933. * | peer ID | U| security type | msg type |
  11934. * |-----------------------------------------------------------------------|
  11935. * | Michael Key K0 |
  11936. * |-----------------------------------------------------------------------|
  11937. * | Michael Key K1 |
  11938. * |-----------------------------------------------------------------------|
  11939. * | WAPI RSC Low0 |
  11940. * |-----------------------------------------------------------------------|
  11941. * | WAPI RSC Low1 |
  11942. * |-----------------------------------------------------------------------|
  11943. * | WAPI RSC Hi0 |
  11944. * |-----------------------------------------------------------------------|
  11945. * | WAPI RSC Hi1 |
  11946. * |-----------------------------------------------------------------------|
  11947. *
  11948. * The following field definitions describe the format of the security
  11949. * indication message sent from the target to the host.
  11950. * - MSG_TYPE
  11951. * Bits 7:0
  11952. * Purpose: identifies this as a security specification message
  11953. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11954. * - SEC_TYPE
  11955. * Bits 14:8
  11956. * Purpose: specifies which type of security applies to the peer
  11957. * Value: htt_sec_type enum value
  11958. * - UNICAST
  11959. * Bit 15
  11960. * Purpose: whether this security is applied to unicast or multicast data
  11961. * Value: 1 -> unicast, 0 -> multicast
  11962. * - PEER_ID
  11963. * Bits 31:16
  11964. * Purpose: The ID number for the peer the security specification is for
  11965. * Value: peer ID
  11966. * - MICHAEL_KEY_K0
  11967. * Bits 31:0
  11968. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11969. * Value: Michael Key K0 (if security type is TKIP)
  11970. * - MICHAEL_KEY_K1
  11971. * Bits 31:0
  11972. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11973. * Value: Michael Key K1 (if security type is TKIP)
  11974. * - WAPI_RSC_LOW0
  11975. * Bits 31:0
  11976. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11977. * Value: WAPI RSC Low0 (if security type is WAPI)
  11978. * - WAPI_RSC_LOW1
  11979. * Bits 31:0
  11980. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11981. * Value: WAPI RSC Low1 (if security type is WAPI)
  11982. * - WAPI_RSC_HI0
  11983. * Bits 31:0
  11984. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11985. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11986. * - WAPI_RSC_HI1
  11987. * Bits 31:0
  11988. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11989. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11990. */
  11991. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11992. #define HTT_SEC_IND_SEC_TYPE_S 8
  11993. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11994. #define HTT_SEC_IND_UNICAST_S 15
  11995. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11996. #define HTT_SEC_IND_PEER_ID_S 16
  11997. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11998. do { \
  11999. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12000. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12001. } while (0)
  12002. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12003. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12004. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12005. do { \
  12006. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12007. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12008. } while (0)
  12009. #define HTT_SEC_IND_UNICAST_GET(word) \
  12010. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12011. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12012. do { \
  12013. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12014. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12015. } while (0)
  12016. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12017. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12018. #define HTT_SEC_IND_BYTES 28
  12019. /**
  12020. * @brief target -> host rx ADDBA / DELBA message definitions
  12021. *
  12022. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12023. *
  12024. * @details
  12025. * The following diagram shows the format of the rx ADDBA message sent
  12026. * from the target to the host:
  12027. *
  12028. * |31 20|19 16|15 8|7 0|
  12029. * |---------------------------------------------------------------------|
  12030. * | peer ID | TID | window size | msg type |
  12031. * |---------------------------------------------------------------------|
  12032. *
  12033. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12034. *
  12035. * The following diagram shows the format of the rx DELBA message sent
  12036. * from the target to the host:
  12037. *
  12038. * |31 20|19 16|15 10|9 8|7 0|
  12039. * |---------------------------------------------------------------------|
  12040. * | peer ID | TID | window size | IR| msg type |
  12041. * |---------------------------------------------------------------------|
  12042. *
  12043. * The following field definitions describe the format of the rx ADDBA
  12044. * and DELBA messages sent from the target to the host.
  12045. * - MSG_TYPE
  12046. * Bits 7:0
  12047. * Purpose: identifies this as an rx ADDBA or DELBA message
  12048. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12049. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12050. * - IR (initiator / recipient)
  12051. * Bits 9:8 (DELBA only)
  12052. * Purpose: specify whether the DELBA handshake was initiated by the
  12053. * local STA/AP, or by the peer STA/AP
  12054. * Value:
  12055. * 0 - unspecified
  12056. * 1 - initiator (a.k.a. originator)
  12057. * 2 - recipient (a.k.a. responder)
  12058. * 3 - unused / reserved
  12059. * - WIN_SIZE
  12060. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12061. * Purpose: Specifies the length of the block ack window (max = 64).
  12062. * Value:
  12063. * block ack window length specified by the received ADDBA/DELBA
  12064. * management message.
  12065. * - TID
  12066. * Bits 19:16
  12067. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12068. * Value:
  12069. * TID specified by the received ADDBA or DELBA management message.
  12070. * - PEER_ID
  12071. * Bits 31:20
  12072. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12073. * Value:
  12074. * ID (hash value) used by the host for fast, direct lookup of
  12075. * host SW peer info, including rx reorder states.
  12076. */
  12077. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12078. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12079. #define HTT_RX_ADDBA_TID_M 0xf0000
  12080. #define HTT_RX_ADDBA_TID_S 16
  12081. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12082. #define HTT_RX_ADDBA_PEER_ID_S 20
  12083. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12086. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12087. } while (0)
  12088. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12089. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12090. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12093. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12094. } while (0)
  12095. #define HTT_RX_ADDBA_TID_GET(word) \
  12096. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12097. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12098. do { \
  12099. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12100. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12101. } while (0)
  12102. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12103. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12104. #define HTT_RX_ADDBA_BYTES 4
  12105. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12106. #define HTT_RX_DELBA_INITIATOR_S 8
  12107. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12108. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12109. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12110. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12111. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12112. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12113. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12114. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12115. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12116. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12117. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12118. do { \
  12119. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12120. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12121. } while (0)
  12122. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12123. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12124. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12125. do { \
  12126. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12127. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12128. } while (0)
  12129. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12130. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12131. #define HTT_RX_DELBA_BYTES 4
  12132. /**
  12133. * @brief target -> host rx ADDBA / DELBA message definitions
  12134. *
  12135. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12136. *
  12137. * @details
  12138. * The following diagram shows the format of the rx ADDBA extn message sent
  12139. * from the target to the host:
  12140. *
  12141. * |31 20|19 16|15 13|12 8|7 0|
  12142. * |---------------------------------------------------------------------|
  12143. * | peer ID | TID | reserved | msg type |
  12144. * |---------------------------------------------------------------------|
  12145. * | reserved | window size |
  12146. * |---------------------------------------------------------------------|
  12147. *
  12148. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12149. *
  12150. * The following diagram shows the format of the rx DELBA message sent
  12151. * from the target to the host:
  12152. *
  12153. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12154. * |---------------------------------------------------------------------|
  12155. * | peer ID | TID | reserved | IR| msg type |
  12156. * |---------------------------------------------------------------------|
  12157. * | reserved | window size |
  12158. * |---------------------------------------------------------------------|
  12159. *
  12160. * The following field definitions describe the format of the rx ADDBA
  12161. * and DELBA messages sent from the target to the host.
  12162. * - MSG_TYPE
  12163. * Bits 7:0
  12164. * Purpose: identifies this as an rx ADDBA or DELBA message
  12165. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12166. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12167. * - IR (initiator / recipient)
  12168. * Bits 9:8 (DELBA only)
  12169. * Purpose: specify whether the DELBA handshake was initiated by the
  12170. * local STA/AP, or by the peer STA/AP
  12171. * Value:
  12172. * 0 - unspecified
  12173. * 1 - initiator (a.k.a. originator)
  12174. * 2 - recipient (a.k.a. responder)
  12175. * 3 - unused / reserved
  12176. * Value:
  12177. * block ack window length specified by the received ADDBA/DELBA
  12178. * management message.
  12179. * - TID
  12180. * Bits 19:16
  12181. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12182. * Value:
  12183. * TID specified by the received ADDBA or DELBA management message.
  12184. * - PEER_ID
  12185. * Bits 31:20
  12186. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12187. * Value:
  12188. * ID (hash value) used by the host for fast, direct lookup of
  12189. * host SW peer info, including rx reorder states.
  12190. * == DWORD 1
  12191. * - WIN_SIZE
  12192. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12193. * Purpose: Specifies the length of the block ack window (max = 8191).
  12194. */
  12195. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12196. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12197. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12198. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12199. /*--- Dword 0 ---*/
  12200. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12201. do { \
  12202. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12203. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12204. } while (0)
  12205. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12206. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12207. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12208. do { \
  12209. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12210. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12211. } while (0)
  12212. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12213. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12214. /*--- Dword 1 ---*/
  12215. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12216. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12217. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12218. do { \
  12219. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12220. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12221. } while (0)
  12222. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12223. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12224. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12225. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12226. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12227. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12228. #define HTT_RX_DELBA_EXTN_TID_S 16
  12229. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12230. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12231. /*--- Dword 0 ---*/
  12232. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12233. do { \
  12234. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12235. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12236. } while (0)
  12237. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12238. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12239. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12240. do { \
  12241. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12242. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12243. } while (0)
  12244. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12245. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12246. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12247. do { \
  12248. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12249. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12250. } while (0)
  12251. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12252. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12253. /*--- Dword 1 ---*/
  12254. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12255. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12256. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12257. do { \
  12258. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12259. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12260. } while (0)
  12261. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12262. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12263. #define HTT_RX_DELBA_EXTN_BYTES 8
  12264. /**
  12265. * @brief tx queue group information element definition
  12266. *
  12267. * @details
  12268. * The following diagram shows the format of the tx queue group
  12269. * information element, which can be included in target --> host
  12270. * messages to specify the number of tx "credits" (tx descriptors
  12271. * for LL, or tx buffers for HL) available to a particular group
  12272. * of host-side tx queues, and which host-side tx queues belong to
  12273. * the group.
  12274. *
  12275. * |31|30 24|23 16|15|14|13 0|
  12276. * |------------------------------------------------------------------------|
  12277. * | X| reserved | tx queue grp ID | A| S| credit count |
  12278. * |------------------------------------------------------------------------|
  12279. * | vdev ID mask | AC mask |
  12280. * |------------------------------------------------------------------------|
  12281. *
  12282. * The following definitions describe the fields within the tx queue group
  12283. * information element:
  12284. * - credit_count
  12285. * Bits 13:1
  12286. * Purpose: specify how many tx credits are available to the tx queue group
  12287. * Value: An absolute or relative, positive or negative credit value
  12288. * The 'A' bit specifies whether the value is absolute or relative.
  12289. * The 'S' bit specifies whether the value is positive or negative.
  12290. * A negative value can only be relative, not absolute.
  12291. * An absolute value replaces any prior credit value the host has for
  12292. * the tx queue group in question.
  12293. * A relative value is added to the prior credit value the host has for
  12294. * the tx queue group in question.
  12295. * - sign
  12296. * Bit 14
  12297. * Purpose: specify whether the credit count is positive or negative
  12298. * Value: 0 -> positive, 1 -> negative
  12299. * - absolute
  12300. * Bit 15
  12301. * Purpose: specify whether the credit count is absolute or relative
  12302. * Value: 0 -> relative, 1 -> absolute
  12303. * - txq_group_id
  12304. * Bits 23:16
  12305. * Purpose: indicate which tx queue group's credit and/or membership are
  12306. * being specified
  12307. * Value: 0 to max_tx_queue_groups-1
  12308. * - reserved
  12309. * Bits 30:16
  12310. * Value: 0x0
  12311. * - eXtension
  12312. * Bit 31
  12313. * Purpose: specify whether another tx queue group info element follows
  12314. * Value: 0 -> no more tx queue group information elements
  12315. * 1 -> another tx queue group information element immediately follows
  12316. * - ac_mask
  12317. * Bits 15:0
  12318. * Purpose: specify which Access Categories belong to the tx queue group
  12319. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12320. * the tx queue group.
  12321. * The AC bit-mask values are obtained by left-shifting by the
  12322. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12323. * - vdev_id_mask
  12324. * Bits 31:16
  12325. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12326. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12327. * belong to the tx queue group.
  12328. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12329. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12330. */
  12331. PREPACK struct htt_txq_group {
  12332. A_UINT32
  12333. credit_count: 14,
  12334. sign: 1,
  12335. absolute: 1,
  12336. tx_queue_group_id: 8,
  12337. reserved0: 7,
  12338. extension: 1;
  12339. A_UINT32
  12340. ac_mask: 16,
  12341. vdev_id_mask: 16;
  12342. } POSTPACK;
  12343. /* first word */
  12344. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12345. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12346. #define HTT_TXQ_GROUP_SIGN_S 14
  12347. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12348. #define HTT_TXQ_GROUP_ABS_S 15
  12349. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12350. #define HTT_TXQ_GROUP_ID_S 16
  12351. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12352. #define HTT_TXQ_GROUP_EXT_S 31
  12353. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12354. /* second word */
  12355. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12356. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12357. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12358. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12359. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12360. do { \
  12361. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12362. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12363. } while (0)
  12364. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12365. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12366. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12367. do { \
  12368. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12369. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12370. } while (0)
  12371. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12372. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12373. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12374. do { \
  12375. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12376. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12377. } while (0)
  12378. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12379. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12380. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12381. do { \
  12382. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12383. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12384. } while (0)
  12385. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12386. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12387. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12388. do { \
  12389. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12390. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12391. } while (0)
  12392. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12393. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12394. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12395. do { \
  12396. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12397. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12398. } while (0)
  12399. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12400. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12401. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12402. do { \
  12403. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12404. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12405. } while (0)
  12406. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12407. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12408. /**
  12409. * @brief target -> host TX completion indication message definition
  12410. *
  12411. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12412. *
  12413. * @details
  12414. * The following diagram shows the format of the TX completion indication sent
  12415. * from the target to the host
  12416. *
  12417. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12418. * |-------------------------------------------------------------------|
  12419. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12420. * |-------------------------------------------------------------------|
  12421. * payload:| MSDU1 ID | MSDU0 ID |
  12422. * |-------------------------------------------------------------------|
  12423. * : MSDU3 ID | MSDU2 ID :
  12424. * |-------------------------------------------------------------------|
  12425. * | struct htt_tx_compl_ind_append_retries |
  12426. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12427. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12428. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12429. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12430. * |-------------------------------------------------------------------|
  12431. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12432. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12433. * | MSDU0 tx_tsf64_low |
  12434. * |-------------------------------------------------------------------|
  12435. * | MSDU0 tx_tsf64_high |
  12436. * |-------------------------------------------------------------------|
  12437. * | MSDU1 tx_tsf64_low |
  12438. * |-------------------------------------------------------------------|
  12439. * | MSDU1 tx_tsf64_high |
  12440. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12441. * | phy_timestamp |
  12442. * |-------------------------------------------------------------------|
  12443. * | rate specs (see below) |
  12444. * |-------------------------------------------------------------------|
  12445. * | seqctrl | framectrl |
  12446. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12447. * Where:
  12448. * A0 = append (a.k.a. append0)
  12449. * A1 = append1
  12450. * TP = MSDU tx power presence
  12451. * A2 = append2
  12452. * A3 = append3
  12453. * A4 = append4
  12454. *
  12455. * The following field definitions describe the format of the TX completion
  12456. * indication sent from the target to the host
  12457. * Header fields:
  12458. * - msg_type
  12459. * Bits 7:0
  12460. * Purpose: identifies this as HTT TX completion indication
  12461. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12462. * - status
  12463. * Bits 10:8
  12464. * Purpose: the TX completion status of payload fragmentations descriptors
  12465. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12466. * - tid
  12467. * Bits 14:11
  12468. * Purpose: the tid associated with those fragmentation descriptors. It is
  12469. * valid or not, depending on the tid_invalid bit.
  12470. * Value: 0 to 15
  12471. * - tid_invalid
  12472. * Bits 15:15
  12473. * Purpose: this bit indicates whether the tid field is valid or not
  12474. * Value: 0 indicates valid; 1 indicates invalid
  12475. * - num
  12476. * Bits 23:16
  12477. * Purpose: the number of payload in this indication
  12478. * Value: 1 to 255
  12479. * - append (a.k.a. append0)
  12480. * Bits 24:24
  12481. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12482. * the number of tx retries for one MSDU at the end of this message
  12483. * Value: 0 indicates no appending; 1 indicates appending
  12484. * - append1
  12485. * Bits 25:25
  12486. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12487. * contains the timestamp info for each TX msdu id in payload.
  12488. * The order of the timestamps matches the order of the MSDU IDs.
  12489. * Note that a big-endian host needs to account for the reordering
  12490. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12491. * conversion) when determining which tx timestamp corresponds to
  12492. * which MSDU ID.
  12493. * Value: 0 indicates no appending; 1 indicates appending
  12494. * - msdu_tx_power_presence
  12495. * Bits 26:26
  12496. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12497. * for each MSDU referenced by the TX_COMPL_IND message.
  12498. * The tx power is reported in 0.5 dBm units.
  12499. * The order of the per-MSDU tx power reports matches the order
  12500. * of the MSDU IDs.
  12501. * Note that a big-endian host needs to account for the reordering
  12502. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12503. * conversion) when determining which Tx Power corresponds to
  12504. * which MSDU ID.
  12505. * Value: 0 indicates MSDU tx power reports are not appended,
  12506. * 1 indicates MSDU tx power reports are appended
  12507. * - append2
  12508. * Bits 27:27
  12509. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12510. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12511. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12512. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12513. * for each MSDU, for convenience.
  12514. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12515. * this append2 bit is set).
  12516. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12517. * dB above the noise floor.
  12518. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12519. * 1 indicates MSDU ACK RSSI values are appended.
  12520. * - append3
  12521. * Bits 28:28
  12522. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12523. * contains the tx tsf info based on wlan global TSF for
  12524. * each TX msdu id in payload.
  12525. * The order of the tx tsf matches the order of the MSDU IDs.
  12526. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12527. * values to indicate the the lower 32 bits and higher 32 bits of
  12528. * the tx tsf.
  12529. * The tx_tsf64 here represents the time MSDU was acked and the
  12530. * tx_tsf64 has microseconds units.
  12531. * Value: 0 indicates no appending; 1 indicates appending
  12532. * - append4
  12533. * Bits 29:29
  12534. * Purpose: Indicate whether data frame control fields and fields required
  12535. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12536. * message. The order of the this message matches the order of
  12537. * the MSDU IDs.
  12538. * Value: 0 indicates frame control fields and fields required for
  12539. * radio tap header values are not appended,
  12540. * 1 indicates frame control fields and fields required for
  12541. * radio tap header values are appended.
  12542. * Payload fields:
  12543. * - hmsdu_id
  12544. * Bits 15:0
  12545. * Purpose: this ID is used to track the Tx buffer in host
  12546. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12547. */
  12548. PREPACK struct htt_tx_data_hdr_information {
  12549. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12550. A_UINT32 /* word 1 */
  12551. /* preamble:
  12552. * 0-OFDM,
  12553. * 1-CCk,
  12554. * 2-HT,
  12555. * 3-VHT
  12556. */
  12557. preamble: 2, /* [1:0] */
  12558. /* mcs:
  12559. * In case of HT preamble interpret
  12560. * MCS along with NSS.
  12561. * Valid values for HT are 0 to 7.
  12562. * HT mcs 0 with NSS 2 is mcs 8.
  12563. * Valid values for VHT are 0 to 9.
  12564. */
  12565. mcs: 4, /* [5:2] */
  12566. /* rate:
  12567. * This is applicable only for
  12568. * CCK and OFDM preamble type
  12569. * rate 0: OFDM 48 Mbps,
  12570. * 1: OFDM 24 Mbps,
  12571. * 2: OFDM 12 Mbps
  12572. * 3: OFDM 6 Mbps
  12573. * 4: OFDM 54 Mbps
  12574. * 5: OFDM 36 Mbps
  12575. * 6: OFDM 18 Mbps
  12576. * 7: OFDM 9 Mbps
  12577. * rate 0: CCK 11 Mbps Long
  12578. * 1: CCK 5.5 Mbps Long
  12579. * 2: CCK 2 Mbps Long
  12580. * 3: CCK 1 Mbps Long
  12581. * 4: CCK 11 Mbps Short
  12582. * 5: CCK 5.5 Mbps Short
  12583. * 6: CCK 2 Mbps Short
  12584. */
  12585. rate : 3, /* [ 8: 6] */
  12586. rssi : 8, /* [16: 9] units=dBm */
  12587. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12588. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12589. stbc : 1, /* [22] */
  12590. sgi : 1, /* [23] */
  12591. ldpc : 1, /* [24] */
  12592. beamformed: 1, /* [25] */
  12593. /* tx_retry_cnt:
  12594. * Indicates retry count of data tx frames provided by the host.
  12595. */
  12596. tx_retry_cnt: 6; /* [31:26] */
  12597. A_UINT32 /* word 2 */
  12598. framectrl:16, /* [15: 0] */
  12599. seqno:16; /* [31:16] */
  12600. } POSTPACK;
  12601. #define HTT_TX_COMPL_IND_STATUS_S 8
  12602. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12603. #define HTT_TX_COMPL_IND_TID_S 11
  12604. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12605. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12606. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12607. #define HTT_TX_COMPL_IND_NUM_S 16
  12608. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12609. #define HTT_TX_COMPL_IND_APPEND_S 24
  12610. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12611. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12612. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12613. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12614. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12615. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12616. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12617. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12618. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12619. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12620. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12621. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12622. do { \
  12623. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12624. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12625. } while (0)
  12626. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12627. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12628. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12629. do { \
  12630. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12631. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12632. } while (0)
  12633. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12634. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12635. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12636. do { \
  12637. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12638. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12639. } while (0)
  12640. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12641. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12642. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12643. do { \
  12644. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12645. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12646. } while (0)
  12647. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12648. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12649. HTT_TX_COMPL_IND_TID_INV_S)
  12650. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12651. do { \
  12652. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12653. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12654. } while (0)
  12655. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12656. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12657. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12658. do { \
  12659. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12660. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12661. } while (0)
  12662. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12663. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12664. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12665. do { \
  12666. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12667. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12668. } while (0)
  12669. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12670. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12671. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12672. do { \
  12673. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12674. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12675. } while (0)
  12676. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12677. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12678. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12679. do { \
  12680. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12681. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12682. } while (0)
  12683. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12684. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12685. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12686. do { \
  12687. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12688. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12689. } while (0)
  12690. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12691. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12692. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12693. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12694. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12695. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12696. #define HTT_TX_COMPL_IND_STAT_OK 0
  12697. /* DISCARD:
  12698. * current meaning:
  12699. * MSDUs were queued for transmission but filtered by HW or SW
  12700. * without any over the air attempts
  12701. * legacy meaning (HL Rome):
  12702. * MSDUs were discarded by the target FW without any over the air
  12703. * attempts due to lack of space
  12704. */
  12705. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12706. /* NO_ACK:
  12707. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12708. */
  12709. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12710. /* POSTPONE:
  12711. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12712. * be downloaded again later (in the appropriate order), when they are
  12713. * deliverable.
  12714. */
  12715. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12716. /*
  12717. * The PEER_DEL tx completion status is used for HL cases
  12718. * where the peer the frame is for has been deleted.
  12719. * The host has already discarded its copy of the frame, but
  12720. * it still needs the tx completion to restore its credit.
  12721. */
  12722. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12723. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12724. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12725. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12726. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12727. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12728. PREPACK struct htt_tx_compl_ind_base {
  12729. A_UINT32 hdr;
  12730. A_UINT16 payload[1/*or more*/];
  12731. } POSTPACK;
  12732. PREPACK struct htt_tx_compl_ind_append_retries {
  12733. A_UINT16 msdu_id;
  12734. A_UINT8 tx_retries;
  12735. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12736. 0: this is the last append_retries struct */
  12737. } POSTPACK;
  12738. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12739. A_UINT32 timestamp[1/*or more*/];
  12740. } POSTPACK;
  12741. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12742. A_UINT32 tx_tsf64_low;
  12743. A_UINT32 tx_tsf64_high;
  12744. } POSTPACK;
  12745. /* htt_tx_data_hdr_information payload extension fields: */
  12746. /* DWORD zero */
  12747. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12748. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12749. /* DWORD one */
  12750. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12751. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12752. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12753. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12754. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12755. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12756. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12757. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12758. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12759. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12760. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12761. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12762. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12763. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12764. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12765. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12766. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12767. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12768. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12769. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12770. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12771. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12772. /* DWORD two */
  12773. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12774. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12775. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12776. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12777. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12778. do { \
  12779. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12780. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12781. } while (0)
  12782. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12783. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12784. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12785. do { \
  12786. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12787. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12788. } while (0)
  12789. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12790. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12791. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12792. do { \
  12793. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12794. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12795. } while (0)
  12796. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12797. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12798. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12799. do { \
  12800. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12801. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12802. } while (0)
  12803. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12804. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12805. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12806. do { \
  12807. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12808. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12809. } while (0)
  12810. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12811. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12812. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12813. do { \
  12814. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12815. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12816. } while (0)
  12817. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12818. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12819. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12820. do { \
  12821. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12822. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12823. } while (0)
  12824. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12825. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12826. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12827. do { \
  12828. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12829. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12830. } while (0)
  12831. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12832. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12833. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12834. do { \
  12835. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12836. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12837. } while (0)
  12838. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12839. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12840. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12841. do { \
  12842. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12843. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12844. } while (0)
  12845. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12846. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12847. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12848. do { \
  12849. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12850. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12851. } while (0)
  12852. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12853. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12854. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12855. do { \
  12856. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12857. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12858. } while (0)
  12859. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12860. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12861. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12862. do { \
  12863. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12864. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12865. } while (0)
  12866. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12867. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12868. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12869. do { \
  12870. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12871. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12872. } while (0)
  12873. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12874. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12875. /**
  12876. * @brief target -> host rate-control update indication message
  12877. *
  12878. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12879. *
  12880. * @details
  12881. * The following diagram shows the format of the RC Update message
  12882. * sent from the target to the host, while processing the tx-completion
  12883. * of a transmitted PPDU.
  12884. *
  12885. * |31 24|23 16|15 8|7 0|
  12886. * |-------------------------------------------------------------|
  12887. * | peer ID | vdev ID | msg_type |
  12888. * |-------------------------------------------------------------|
  12889. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12890. * |-------------------------------------------------------------|
  12891. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12892. * |-------------------------------------------------------------|
  12893. * | : |
  12894. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12895. * | : |
  12896. * |-------------------------------------------------------------|
  12897. * | : |
  12898. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12899. * | : |
  12900. * |-------------------------------------------------------------|
  12901. * : :
  12902. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12903. *
  12904. */
  12905. typedef struct {
  12906. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12907. A_UINT32 rate_code_flags;
  12908. A_UINT32 flags; /* Encodes information such as excessive
  12909. retransmission, aggregate, some info
  12910. from .11 frame control,
  12911. STBC, LDPC, (SGI and Tx Chain Mask
  12912. are encoded in ptx_rc->flags field),
  12913. AMPDU truncation (BT/time based etc.),
  12914. RTS/CTS attempt */
  12915. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12916. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12917. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12918. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12919. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12920. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12921. } HTT_RC_TX_DONE_PARAMS;
  12922. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12923. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12924. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12925. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12926. #define HTT_RC_UPDATE_VDEVID_S 8
  12927. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12928. #define HTT_RC_UPDATE_PEERID_S 16
  12929. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12930. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12931. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12932. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12933. do { \
  12934. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12935. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12936. } while (0)
  12937. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12938. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12939. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12940. do { \
  12941. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12942. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12943. } while (0)
  12944. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12945. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12946. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12947. do { \
  12948. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12949. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12950. } while (0)
  12951. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12952. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12953. /**
  12954. * @brief target -> host rx fragment indication message definition
  12955. *
  12956. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12957. *
  12958. * @details
  12959. * The following field definitions describe the format of the rx fragment
  12960. * indication message sent from the target to the host.
  12961. * The rx fragment indication message shares the format of the
  12962. * rx indication message, but not all fields from the rx indication message
  12963. * are relevant to the rx fragment indication message.
  12964. *
  12965. *
  12966. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12967. * |-----------+-------------------+---------------------+-------------|
  12968. * | peer ID | |FV| ext TID | msg type |
  12969. * |-------------------------------------------------------------------|
  12970. * | | flush | flush |
  12971. * | | end | start |
  12972. * | | seq num | seq num |
  12973. * |-------------------------------------------------------------------|
  12974. * | reserved | FW rx desc bytes |
  12975. * |-------------------------------------------------------------------|
  12976. * | | FW MSDU Rx |
  12977. * | | desc B0 |
  12978. * |-------------------------------------------------------------------|
  12979. * Header fields:
  12980. * - MSG_TYPE
  12981. * Bits 7:0
  12982. * Purpose: identifies this as an rx fragment indication message
  12983. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12984. * - EXT_TID
  12985. * Bits 12:8
  12986. * Purpose: identify the traffic ID of the rx data, including
  12987. * special "extended" TID values for multicast, broadcast, and
  12988. * non-QoS data frames
  12989. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12990. * - FLUSH_VALID (FV)
  12991. * Bit 13
  12992. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12993. * is valid
  12994. * Value:
  12995. * 1 -> flush IE is valid and needs to be processed
  12996. * 0 -> flush IE is not valid and should be ignored
  12997. * - PEER_ID
  12998. * Bits 31:16
  12999. * Purpose: Identify, by ID, which peer sent the rx data
  13000. * Value: ID of the peer who sent the rx data
  13001. * - FLUSH_SEQ_NUM_START
  13002. * Bits 5:0
  13003. * Purpose: Indicate the start of a series of MPDUs to flush
  13004. * Not all MPDUs within this series are necessarily valid - the host
  13005. * must check each sequence number within this range to see if the
  13006. * corresponding MPDU is actually present.
  13007. * This field is only valid if the FV bit is set.
  13008. * Value:
  13009. * The sequence number for the first MPDUs to check to flush.
  13010. * The sequence number is masked by 0x3f.
  13011. * - FLUSH_SEQ_NUM_END
  13012. * Bits 11:6
  13013. * Purpose: Indicate the end of a series of MPDUs to flush
  13014. * Value:
  13015. * The sequence number one larger than the sequence number of the
  13016. * last MPDU to check to flush.
  13017. * The sequence number is masked by 0x3f.
  13018. * Not all MPDUs within this series are necessarily valid - the host
  13019. * must check each sequence number within this range to see if the
  13020. * corresponding MPDU is actually present.
  13021. * This field is only valid if the FV bit is set.
  13022. * Rx descriptor fields:
  13023. * - FW_RX_DESC_BYTES
  13024. * Bits 15:0
  13025. * Purpose: Indicate how many bytes in the Rx indication are used for
  13026. * FW Rx descriptors
  13027. * Value: 1
  13028. */
  13029. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13030. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13031. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13032. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13033. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13034. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13035. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13036. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13037. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13038. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13039. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13040. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13041. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13042. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13043. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13044. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13045. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13046. #define HTT_RX_FRAG_IND_BYTES \
  13047. (4 /* msg hdr */ + \
  13048. 4 /* flush spec */ + \
  13049. 4 /* (unused) FW rx desc bytes spec */ + \
  13050. 4 /* FW rx desc */)
  13051. /**
  13052. * @brief target -> host test message definition
  13053. *
  13054. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13055. *
  13056. * @details
  13057. * The following field definitions describe the format of the test
  13058. * message sent from the target to the host.
  13059. * The message consists of a 4-octet header, followed by a variable
  13060. * number of 32-bit integer values, followed by a variable number
  13061. * of 8-bit character values.
  13062. *
  13063. * |31 16|15 8|7 0|
  13064. * |-----------------------------------------------------------|
  13065. * | num chars | num ints | msg type |
  13066. * |-----------------------------------------------------------|
  13067. * | int 0 |
  13068. * |-----------------------------------------------------------|
  13069. * | int 1 |
  13070. * |-----------------------------------------------------------|
  13071. * | ... |
  13072. * |-----------------------------------------------------------|
  13073. * | char 3 | char 2 | char 1 | char 0 |
  13074. * |-----------------------------------------------------------|
  13075. * | | | ... | char 4 |
  13076. * |-----------------------------------------------------------|
  13077. * - MSG_TYPE
  13078. * Bits 7:0
  13079. * Purpose: identifies this as a test message
  13080. * Value: HTT_MSG_TYPE_TEST
  13081. * - NUM_INTS
  13082. * Bits 15:8
  13083. * Purpose: indicate how many 32-bit integers follow the message header
  13084. * - NUM_CHARS
  13085. * Bits 31:16
  13086. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13087. */
  13088. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13089. #define HTT_RX_TEST_NUM_INTS_S 8
  13090. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13091. #define HTT_RX_TEST_NUM_CHARS_S 16
  13092. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13093. do { \
  13094. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13095. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13096. } while (0)
  13097. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13098. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13099. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13100. do { \
  13101. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13102. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13103. } while (0)
  13104. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13105. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13106. /**
  13107. * @brief target -> host packet log message
  13108. *
  13109. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13110. *
  13111. * @details
  13112. * The following field definitions describe the format of the packet log
  13113. * message sent from the target to the host.
  13114. * The message consists of a 4-octet header,followed by a variable number
  13115. * of 32-bit character values.
  13116. *
  13117. * |31 16|15 12|11 10|9 8|7 0|
  13118. * |------------------------------------------------------------------|
  13119. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13120. * |------------------------------------------------------------------|
  13121. * | payload |
  13122. * |------------------------------------------------------------------|
  13123. * - MSG_TYPE
  13124. * Bits 7:0
  13125. * Purpose: identifies this as a pktlog message
  13126. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13127. * - mac_id
  13128. * Bits 9:8
  13129. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13130. * Value: 0-3
  13131. * - pdev_id
  13132. * Bits 11:10
  13133. * Purpose: pdev_id
  13134. * Value: 0-3
  13135. * 0 (for rings at SOC level),
  13136. * 1/2/3 PDEV -> 0/1/2
  13137. * - payload_size
  13138. * Bits 31:16
  13139. * Purpose: explicitly specify the payload size
  13140. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13141. */
  13142. PREPACK struct htt_pktlog_msg {
  13143. A_UINT32 header;
  13144. A_UINT32 payload[1/* or more */];
  13145. } POSTPACK;
  13146. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13147. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13148. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13149. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13150. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13151. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13152. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13153. do { \
  13154. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13155. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13156. } while (0)
  13157. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13158. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13159. HTT_T2H_PKTLOG_MAC_ID_S)
  13160. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13161. do { \
  13162. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13163. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13164. } while (0)
  13165. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13166. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13167. HTT_T2H_PKTLOG_PDEV_ID_S)
  13168. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13169. do { \
  13170. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13171. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13172. } while (0)
  13173. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13174. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13175. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13176. /*
  13177. * Rx reorder statistics
  13178. * NB: all the fields must be defined in 4 octets size.
  13179. */
  13180. struct rx_reorder_stats {
  13181. /* Non QoS MPDUs received */
  13182. A_UINT32 deliver_non_qos;
  13183. /* MPDUs received in-order */
  13184. A_UINT32 deliver_in_order;
  13185. /* Flush due to reorder timer expired */
  13186. A_UINT32 deliver_flush_timeout;
  13187. /* Flush due to move out of window */
  13188. A_UINT32 deliver_flush_oow;
  13189. /* Flush due to DELBA */
  13190. A_UINT32 deliver_flush_delba;
  13191. /* MPDUs dropped due to FCS error */
  13192. A_UINT32 fcs_error;
  13193. /* MPDUs dropped due to monitor mode non-data packet */
  13194. A_UINT32 mgmt_ctrl;
  13195. /* Unicast-data MPDUs dropped due to invalid peer */
  13196. A_UINT32 invalid_peer;
  13197. /* MPDUs dropped due to duplication (non aggregation) */
  13198. A_UINT32 dup_non_aggr;
  13199. /* MPDUs dropped due to processed before */
  13200. A_UINT32 dup_past;
  13201. /* MPDUs dropped due to duplicate in reorder queue */
  13202. A_UINT32 dup_in_reorder;
  13203. /* Reorder timeout happened */
  13204. A_UINT32 reorder_timeout;
  13205. /* invalid bar ssn */
  13206. A_UINT32 invalid_bar_ssn;
  13207. /* reorder reset due to bar ssn */
  13208. A_UINT32 ssn_reset;
  13209. /* Flush due to delete peer */
  13210. A_UINT32 deliver_flush_delpeer;
  13211. /* Flush due to offload*/
  13212. A_UINT32 deliver_flush_offload;
  13213. /* Flush due to out of buffer*/
  13214. A_UINT32 deliver_flush_oob;
  13215. /* MPDUs dropped due to PN check fail */
  13216. A_UINT32 pn_fail;
  13217. /* MPDUs dropped due to unable to allocate memory */
  13218. A_UINT32 store_fail;
  13219. /* Number of times the tid pool alloc succeeded */
  13220. A_UINT32 tid_pool_alloc_succ;
  13221. /* Number of times the MPDU pool alloc succeeded */
  13222. A_UINT32 mpdu_pool_alloc_succ;
  13223. /* Number of times the MSDU pool alloc succeeded */
  13224. A_UINT32 msdu_pool_alloc_succ;
  13225. /* Number of times the tid pool alloc failed */
  13226. A_UINT32 tid_pool_alloc_fail;
  13227. /* Number of times the MPDU pool alloc failed */
  13228. A_UINT32 mpdu_pool_alloc_fail;
  13229. /* Number of times the MSDU pool alloc failed */
  13230. A_UINT32 msdu_pool_alloc_fail;
  13231. /* Number of times the tid pool freed */
  13232. A_UINT32 tid_pool_free;
  13233. /* Number of times the MPDU pool freed */
  13234. A_UINT32 mpdu_pool_free;
  13235. /* Number of times the MSDU pool freed */
  13236. A_UINT32 msdu_pool_free;
  13237. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13238. A_UINT32 msdu_queued;
  13239. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13240. A_UINT32 msdu_recycled;
  13241. /* Number of MPDUs with invalid peer but A2 found in AST */
  13242. A_UINT32 invalid_peer_a2_in_ast;
  13243. /* Number of MPDUs with invalid peer but A3 found in AST */
  13244. A_UINT32 invalid_peer_a3_in_ast;
  13245. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13246. A_UINT32 invalid_peer_bmc_mpdus;
  13247. /* Number of MSDUs with err attention word */
  13248. A_UINT32 rxdesc_err_att;
  13249. /* Number of MSDUs with flag of peer_idx_invalid */
  13250. A_UINT32 rxdesc_err_peer_idx_inv;
  13251. /* Number of MSDUs with flag of peer_idx_timeout */
  13252. A_UINT32 rxdesc_err_peer_idx_to;
  13253. /* Number of MSDUs with flag of overflow */
  13254. A_UINT32 rxdesc_err_ov;
  13255. /* Number of MSDUs with flag of msdu_length_err */
  13256. A_UINT32 rxdesc_err_msdu_len;
  13257. /* Number of MSDUs with flag of mpdu_length_err */
  13258. A_UINT32 rxdesc_err_mpdu_len;
  13259. /* Number of MSDUs with flag of tkip_mic_err */
  13260. A_UINT32 rxdesc_err_tkip_mic;
  13261. /* Number of MSDUs with flag of decrypt_err */
  13262. A_UINT32 rxdesc_err_decrypt;
  13263. /* Number of MSDUs with flag of fcs_err */
  13264. A_UINT32 rxdesc_err_fcs;
  13265. /* Number of Unicast (bc_mc bit is not set in attention word)
  13266. * frames with invalid peer handler
  13267. */
  13268. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13269. /* Number of unicast frame directly (direct bit is set in attention word)
  13270. * to DUT with invalid peer handler
  13271. */
  13272. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13273. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13274. * frames with invalid peer handler
  13275. */
  13276. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13277. /* Number of MSDUs dropped due to no first MSDU flag */
  13278. A_UINT32 rxdesc_no_1st_msdu;
  13279. /* Number of MSDUs droped due to ring overflow */
  13280. A_UINT32 msdu_drop_ring_ov;
  13281. /* Number of MSDUs dropped due to FC mismatch */
  13282. A_UINT32 msdu_drop_fc_mismatch;
  13283. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13284. A_UINT32 msdu_drop_mgmt_remote_ring;
  13285. /* Number of MSDUs dropped due to errors not reported in attention word */
  13286. A_UINT32 msdu_drop_misc;
  13287. /* Number of MSDUs go to offload before reorder */
  13288. A_UINT32 offload_msdu_wal;
  13289. /* Number of data frame dropped by offload after reorder */
  13290. A_UINT32 offload_msdu_reorder;
  13291. /* Number of MPDUs with sequence number in the past and within the BA window */
  13292. A_UINT32 dup_past_within_window;
  13293. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13294. A_UINT32 dup_past_outside_window;
  13295. /* Number of MSDUs with decrypt/MIC error */
  13296. A_UINT32 rxdesc_err_decrypt_mic;
  13297. /* Number of data MSDUs received on both local and remote rings */
  13298. A_UINT32 data_msdus_on_both_rings;
  13299. /* MPDUs never filled */
  13300. A_UINT32 holes_not_filled;
  13301. };
  13302. /*
  13303. * Rx Remote buffer statistics
  13304. * NB: all the fields must be defined in 4 octets size.
  13305. */
  13306. struct rx_remote_buffer_mgmt_stats {
  13307. /* Total number of MSDUs reaped for Rx processing */
  13308. A_UINT32 remote_reaped;
  13309. /* MSDUs recycled within firmware */
  13310. A_UINT32 remote_recycled;
  13311. /* MSDUs stored by Data Rx */
  13312. A_UINT32 data_rx_msdus_stored;
  13313. /* Number of HTT indications from WAL Rx MSDU */
  13314. A_UINT32 wal_rx_ind;
  13315. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13316. A_UINT32 wal_rx_ind_unconsumed;
  13317. /* Number of HTT indications from Data Rx MSDU */
  13318. A_UINT32 data_rx_ind;
  13319. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13320. A_UINT32 data_rx_ind_unconsumed;
  13321. /* Number of HTT indications from ATHBUF */
  13322. A_UINT32 athbuf_rx_ind;
  13323. /* Number of remote buffers requested for refill */
  13324. A_UINT32 refill_buf_req;
  13325. /* Number of remote buffers filled by the host */
  13326. A_UINT32 refill_buf_rsp;
  13327. /* Number of times MAC hw_index = f/w write_index */
  13328. A_INT32 mac_no_bufs;
  13329. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13330. A_INT32 fw_indices_equal;
  13331. /* Number of times f/w finds no buffers to post */
  13332. A_INT32 host_no_bufs;
  13333. };
  13334. /*
  13335. * TXBF MU/SU packets and NDPA statistics
  13336. * NB: all the fields must be defined in 4 octets size.
  13337. */
  13338. struct rx_txbf_musu_ndpa_pkts_stats {
  13339. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13340. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13341. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13342. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13343. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13344. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13345. };
  13346. /*
  13347. * htt_dbg_stats_status -
  13348. * present - The requested stats have been delivered in full.
  13349. * This indicates that either the stats information was contained
  13350. * in its entirety within this message, or else this message
  13351. * completes the delivery of the requested stats info that was
  13352. * partially delivered through earlier STATS_CONF messages.
  13353. * partial - The requested stats have been delivered in part.
  13354. * One or more subsequent STATS_CONF messages with the same
  13355. * cookie value will be sent to deliver the remainder of the
  13356. * information.
  13357. * error - The requested stats could not be delivered, for example due
  13358. * to a shortage of memory to construct a message holding the
  13359. * requested stats.
  13360. * invalid - The requested stat type is either not recognized, or the
  13361. * target is configured to not gather the stats type in question.
  13362. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13363. * series_done - This special value indicates that no further stats info
  13364. * elements are present within a series of stats info elems
  13365. * (within a stats upload confirmation message).
  13366. */
  13367. enum htt_dbg_stats_status {
  13368. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13369. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13370. HTT_DBG_STATS_STATUS_ERROR = 2,
  13371. HTT_DBG_STATS_STATUS_INVALID = 3,
  13372. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13373. };
  13374. /**
  13375. * @brief target -> host statistics upload
  13376. *
  13377. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13378. *
  13379. * @details
  13380. * The following field definitions describe the format of the HTT target
  13381. * to host stats upload confirmation message.
  13382. * The message contains a cookie echoed from the HTT host->target stats
  13383. * upload request, which identifies which request the confirmation is
  13384. * for, and a series of tag-length-value stats information elements.
  13385. * The tag-length header for each stats info element also includes a
  13386. * status field, to indicate whether the request for the stat type in
  13387. * question was fully met, partially met, unable to be met, or invalid
  13388. * (if the stat type in question is disabled in the target).
  13389. * A special value of all 1's in this status field is used to indicate
  13390. * the end of the series of stats info elements.
  13391. *
  13392. *
  13393. * |31 16|15 8|7 5|4 0|
  13394. * |------------------------------------------------------------|
  13395. * | reserved | msg type |
  13396. * |------------------------------------------------------------|
  13397. * | cookie LSBs |
  13398. * |------------------------------------------------------------|
  13399. * | cookie MSBs |
  13400. * |------------------------------------------------------------|
  13401. * | stats entry length | reserved | S |stat type|
  13402. * |------------------------------------------------------------|
  13403. * | |
  13404. * | type-specific stats info |
  13405. * | |
  13406. * |------------------------------------------------------------|
  13407. * | stats entry length | reserved | S |stat type|
  13408. * |------------------------------------------------------------|
  13409. * | |
  13410. * | type-specific stats info |
  13411. * | |
  13412. * |------------------------------------------------------------|
  13413. * | n/a | reserved | 111 | n/a |
  13414. * |------------------------------------------------------------|
  13415. * Header fields:
  13416. * - MSG_TYPE
  13417. * Bits 7:0
  13418. * Purpose: identifies this is a statistics upload confirmation message
  13419. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13420. * - COOKIE_LSBS
  13421. * Bits 31:0
  13422. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13423. * message with its preceding host->target stats request message.
  13424. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13425. * - COOKIE_MSBS
  13426. * Bits 31:0
  13427. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13428. * message with its preceding host->target stats request message.
  13429. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13430. *
  13431. * Stats Information Element tag-length header fields:
  13432. * - STAT_TYPE
  13433. * Bits 4:0
  13434. * Purpose: identifies the type of statistics info held in the
  13435. * following information element
  13436. * Value: htt_dbg_stats_type
  13437. * - STATUS
  13438. * Bits 7:5
  13439. * Purpose: indicate whether the requested stats are present
  13440. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13441. * the completion of the stats entry series
  13442. * - LENGTH
  13443. * Bits 31:16
  13444. * Purpose: indicate the stats information size
  13445. * Value: This field specifies the number of bytes of stats information
  13446. * that follows the element tag-length header.
  13447. * It is expected but not required that this length is a multiple of
  13448. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13449. * subsequent stats entry header will begin on a 4-byte aligned
  13450. * boundary.
  13451. */
  13452. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13453. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13454. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13455. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13456. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13457. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13458. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13459. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13460. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13461. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13462. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13463. do { \
  13464. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13465. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13466. } while (0)
  13467. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13468. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13469. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13470. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13471. do { \
  13472. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13473. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13474. } while (0)
  13475. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13476. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13477. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13478. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13479. do { \
  13480. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13481. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13482. } while (0)
  13483. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13484. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13485. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13486. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13487. #define HTT_MAX_AGGR 64
  13488. #define HTT_HL_MAX_AGGR 18
  13489. /**
  13490. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13491. *
  13492. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13493. *
  13494. * @details
  13495. * The following field definitions describe the format of the HTT host
  13496. * to target frag_desc/msdu_ext bank configuration message.
  13497. * The message contains the based address and the min and max id of the
  13498. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13499. * MSDU_EXT/FRAG_DESC.
  13500. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13501. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13502. * the hardware does the mapping/translation.
  13503. *
  13504. * Total banks that can be configured is configured to 16.
  13505. *
  13506. * This should be called before any TX has be initiated by the HTT
  13507. *
  13508. * |31 16|15 8|7 5|4 0|
  13509. * |------------------------------------------------------------|
  13510. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13511. * |------------------------------------------------------------|
  13512. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13513. #if HTT_PADDR64
  13514. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13515. #endif
  13516. * |------------------------------------------------------------|
  13517. * | ... |
  13518. * |------------------------------------------------------------|
  13519. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13520. #if HTT_PADDR64
  13521. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13522. #endif
  13523. * |------------------------------------------------------------|
  13524. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13525. * |------------------------------------------------------------|
  13526. * | ... |
  13527. * |------------------------------------------------------------|
  13528. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13529. * |------------------------------------------------------------|
  13530. * Header fields:
  13531. * - MSG_TYPE
  13532. * Bits 7:0
  13533. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13534. * for systems with 64-bit format for bus addresses:
  13535. * - BANKx_BASE_ADDRESS_LO
  13536. * Bits 31:0
  13537. * Purpose: Provide a mechanism to specify the base address of the
  13538. * MSDU_EXT bank physical/bus address.
  13539. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13540. * - BANKx_BASE_ADDRESS_HI
  13541. * Bits 31:0
  13542. * Purpose: Provide a mechanism to specify the base address of the
  13543. * MSDU_EXT bank physical/bus address.
  13544. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13545. * for systems with 32-bit format for bus addresses:
  13546. * - BANKx_BASE_ADDRESS
  13547. * Bits 31:0
  13548. * Purpose: Provide a mechanism to specify the base address of the
  13549. * MSDU_EXT bank physical/bus address.
  13550. * Value: MSDU_EXT bank physical / bus address
  13551. * - BANKx_MIN_ID
  13552. * Bits 15:0
  13553. * Purpose: Provide a mechanism to specify the min index that needs to
  13554. * mapped.
  13555. * - BANKx_MAX_ID
  13556. * Bits 31:16
  13557. * Purpose: Provide a mechanism to specify the max index that needs to
  13558. * mapped.
  13559. *
  13560. */
  13561. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13562. * safe value.
  13563. * @note MAX supported banks is 16.
  13564. */
  13565. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13566. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13567. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13568. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13569. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13570. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13571. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13572. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13573. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13574. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13575. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13576. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13577. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13578. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13579. do { \
  13580. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13581. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13582. } while (0)
  13583. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13584. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13585. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13586. do { \
  13587. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13588. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13589. } while (0)
  13590. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13591. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13592. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13593. do { \
  13594. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13595. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13596. } while (0)
  13597. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13598. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13599. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13600. do { \
  13601. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13602. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13603. } while (0)
  13604. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13605. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13606. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13607. do { \
  13608. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13609. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13610. } while (0)
  13611. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13612. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13613. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13614. do { \
  13615. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13616. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13617. } while (0)
  13618. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13619. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13620. /*
  13621. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13622. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13623. * addresses are stored in a XXX-bit field.
  13624. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13625. * htt_tx_frag_desc64_bank_cfg_t structs.
  13626. */
  13627. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13628. _paddr_bits_, \
  13629. _paddr__bank_base_address_) \
  13630. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13631. /** word 0 \
  13632. * msg_type: 8, \
  13633. * pdev_id: 2, \
  13634. * swap: 1, \
  13635. * reserved0: 5, \
  13636. * num_banks: 8, \
  13637. * desc_size: 8; \
  13638. */ \
  13639. A_UINT32 word0; \
  13640. /* \
  13641. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13642. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13643. * the second A_UINT32). \
  13644. */ \
  13645. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13646. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13647. } POSTPACK
  13648. /* define htt_tx_frag_desc32_bank_cfg_t */
  13649. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13650. /* define htt_tx_frag_desc64_bank_cfg_t */
  13651. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13652. /*
  13653. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13654. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13655. */
  13656. #if HTT_PADDR64
  13657. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13658. #else
  13659. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13660. #endif
  13661. /**
  13662. * @brief target -> host HTT TX Credit total count update message definition
  13663. *
  13664. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13665. *
  13666. *|31 16|15|14 9| 8 |7 0 |
  13667. *|---------------------+--+----------+-------+----------|
  13668. *|cur htt credit delta | Q| reserved | sign | msg type |
  13669. *|------------------------------------------------------|
  13670. *
  13671. * Header fields:
  13672. * - MSG_TYPE
  13673. * Bits 7:0
  13674. * Purpose: identifies this as a htt tx credit delta update message
  13675. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13676. * - SIGN
  13677. * Bits 8
  13678. * identifies whether credit delta is positive or negative
  13679. * Value:
  13680. * - 0x0: credit delta is positive, rebalance in some buffers
  13681. * - 0x1: credit delta is negative, rebalance out some buffers
  13682. * - reserved
  13683. * Bits 14:9
  13684. * Value: 0x0
  13685. * - TXQ_GRP
  13686. * Bit 15
  13687. * Purpose: indicates whether any tx queue group information elements
  13688. * are appended to the tx credit update message
  13689. * Value: 0 -> no tx queue group information element is present
  13690. * 1 -> a tx queue group information element immediately follows
  13691. * - DELTA_COUNT
  13692. * Bits 31:16
  13693. * Purpose: Specify current htt credit delta absolute count
  13694. */
  13695. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13696. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13697. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13698. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13699. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13700. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13701. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13702. do { \
  13703. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13704. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13705. } while (0)
  13706. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13707. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13708. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13709. do { \
  13710. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13711. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13712. } while (0)
  13713. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13714. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13715. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13716. do { \
  13717. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13718. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13719. } while (0)
  13720. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13721. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13722. #define HTT_TX_CREDIT_MSG_BYTES 4
  13723. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13724. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13725. /**
  13726. * @brief HTT WDI_IPA Operation Response Message
  13727. *
  13728. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13729. *
  13730. * @details
  13731. * HTT WDI_IPA Operation Response message is sent by target
  13732. * to host confirming suspend or resume operation.
  13733. * |31 24|23 16|15 8|7 0|
  13734. * |----------------+----------------+----------------+----------------|
  13735. * | op_code | Rsvd | msg_type |
  13736. * |-------------------------------------------------------------------|
  13737. * | Rsvd | Response len |
  13738. * |-------------------------------------------------------------------|
  13739. * | |
  13740. * | Response-type specific info |
  13741. * | |
  13742. * | |
  13743. * |-------------------------------------------------------------------|
  13744. * Header fields:
  13745. * - MSG_TYPE
  13746. * Bits 7:0
  13747. * Purpose: Identifies this as WDI_IPA Operation Response message
  13748. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13749. * - OP_CODE
  13750. * Bits 31:16
  13751. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13752. * value: = enum htt_wdi_ipa_op_code
  13753. * - RSP_LEN
  13754. * Bits 16:0
  13755. * Purpose: length for the response-type specific info
  13756. * value: = length in bytes for response-type specific info
  13757. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13758. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13759. */
  13760. PREPACK struct htt_wdi_ipa_op_response_t
  13761. {
  13762. /* DWORD 0: flags and meta-data */
  13763. A_UINT32
  13764. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13765. reserved1: 8,
  13766. op_code: 16;
  13767. A_UINT32
  13768. rsp_len: 16,
  13769. reserved2: 16;
  13770. } POSTPACK;
  13771. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13772. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13773. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13774. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13775. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13776. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13777. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13778. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13779. do { \
  13780. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13781. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13782. } while (0)
  13783. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13784. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13785. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13786. do { \
  13787. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13788. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13789. } while (0)
  13790. enum htt_phy_mode {
  13791. htt_phy_mode_11a = 0,
  13792. htt_phy_mode_11g = 1,
  13793. htt_phy_mode_11b = 2,
  13794. htt_phy_mode_11g_only = 3,
  13795. htt_phy_mode_11na_ht20 = 4,
  13796. htt_phy_mode_11ng_ht20 = 5,
  13797. htt_phy_mode_11na_ht40 = 6,
  13798. htt_phy_mode_11ng_ht40 = 7,
  13799. htt_phy_mode_11ac_vht20 = 8,
  13800. htt_phy_mode_11ac_vht40 = 9,
  13801. htt_phy_mode_11ac_vht80 = 10,
  13802. htt_phy_mode_11ac_vht20_2g = 11,
  13803. htt_phy_mode_11ac_vht40_2g = 12,
  13804. htt_phy_mode_11ac_vht80_2g = 13,
  13805. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13806. htt_phy_mode_11ac_vht160 = 15,
  13807. htt_phy_mode_max,
  13808. };
  13809. /**
  13810. * @brief target -> host HTT channel change indication
  13811. *
  13812. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13813. *
  13814. * @details
  13815. * Specify when a channel change occurs.
  13816. * This allows the host to precisely determine which rx frames arrived
  13817. * on the old channel and which rx frames arrived on the new channel.
  13818. *
  13819. *|31 |7 0 |
  13820. *|-------------------------------------------+----------|
  13821. *| reserved | msg type |
  13822. *|------------------------------------------------------|
  13823. *| primary_chan_center_freq_mhz |
  13824. *|------------------------------------------------------|
  13825. *| contiguous_chan1_center_freq_mhz |
  13826. *|------------------------------------------------------|
  13827. *| contiguous_chan2_center_freq_mhz |
  13828. *|------------------------------------------------------|
  13829. *| phy_mode |
  13830. *|------------------------------------------------------|
  13831. *
  13832. * Header fields:
  13833. * - MSG_TYPE
  13834. * Bits 7:0
  13835. * Purpose: identifies this as a htt channel change indication message
  13836. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13837. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13838. * Bits 31:0
  13839. * Purpose: identify the (center of the) new 20 MHz primary channel
  13840. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13841. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13842. * Bits 31:0
  13843. * Purpose: identify the (center of the) contiguous frequency range
  13844. * comprising the new channel.
  13845. * For example, if the new channel is a 80 MHz channel extending
  13846. * 60 MHz beyond the primary channel, this field would be 30 larger
  13847. * than the primary channel center frequency field.
  13848. * Value: center frequency of the contiguous frequency range comprising
  13849. * the full channel in MHz units
  13850. * (80+80 channels also use the CONTIG_CHAN2 field)
  13851. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13852. * Bits 31:0
  13853. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13854. * within a VHT 80+80 channel.
  13855. * This field is only relevant for VHT 80+80 channels.
  13856. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13857. * channel (arbitrary value for cases besides VHT 80+80)
  13858. * - PHY_MODE
  13859. * Bits 31:0
  13860. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13861. * and band
  13862. * Value: htt_phy_mode enum value
  13863. */
  13864. PREPACK struct htt_chan_change_t
  13865. {
  13866. /* DWORD 0: flags and meta-data */
  13867. A_UINT32
  13868. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13869. reserved1: 24;
  13870. A_UINT32 primary_chan_center_freq_mhz;
  13871. A_UINT32 contig_chan1_center_freq_mhz;
  13872. A_UINT32 contig_chan2_center_freq_mhz;
  13873. A_UINT32 phy_mode;
  13874. } POSTPACK;
  13875. /*
  13876. * Due to historical / backwards-compatibility reasons, maintain the
  13877. * below htt_chan_change_msg struct definition, which needs to be
  13878. * consistent with the above htt_chan_change_t struct definition
  13879. * (aside from the htt_chan_change_t definition including the msg_type
  13880. * dword within the message, and the htt_chan_change_msg only containing
  13881. * the payload of the message that follows the msg_type dword).
  13882. */
  13883. PREPACK struct htt_chan_change_msg {
  13884. A_UINT32 chan_mhz; /* frequency in mhz */
  13885. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13886. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13887. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13888. } POSTPACK;
  13889. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13890. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13891. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13892. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13893. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13894. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13895. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13896. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13897. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13898. do { \
  13899. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13900. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13901. } while (0)
  13902. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13903. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13904. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13905. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13906. do { \
  13907. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13908. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13909. } while (0)
  13910. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13911. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13912. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13913. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13914. do { \
  13915. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13916. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13917. } while (0)
  13918. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13919. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13920. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13921. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13922. do { \
  13923. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13924. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13925. } while (0)
  13926. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13927. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13928. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13929. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13930. /**
  13931. * @brief rx offload packet error message
  13932. *
  13933. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13934. *
  13935. * @details
  13936. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13937. * of target payload like mic err.
  13938. *
  13939. * |31 24|23 16|15 8|7 0|
  13940. * |----------------+----------------+----------------+----------------|
  13941. * | tid | vdev_id | msg_sub_type | msg_type |
  13942. * |-------------------------------------------------------------------|
  13943. * : (sub-type dependent content) :
  13944. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13945. * Header fields:
  13946. * - msg_type
  13947. * Bits 7:0
  13948. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13949. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13950. * - msg_sub_type
  13951. * Bits 15:8
  13952. * Purpose: Identifies which type of rx error is reported by this message
  13953. * value: htt_rx_ofld_pkt_err_type
  13954. * - vdev_id
  13955. * Bits 23:16
  13956. * Purpose: Identifies which vdev received the erroneous rx frame
  13957. * value:
  13958. * - tid
  13959. * Bits 31:24
  13960. * Purpose: Identifies the traffic type of the rx frame
  13961. * value:
  13962. *
  13963. * - The payload fields used if the sub-type == MIC error are shown below.
  13964. * Note - MIC err is per MSDU, while PN is per MPDU.
  13965. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13966. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13967. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13968. * instead of sending separate HTT messages for each wrong MSDU within
  13969. * the MPDU.
  13970. *
  13971. * |31 24|23 16|15 8|7 0|
  13972. * |----------------+----------------+----------------+----------------|
  13973. * | Rsvd | key_id | peer_id |
  13974. * |-------------------------------------------------------------------|
  13975. * | receiver MAC addr 31:0 |
  13976. * |-------------------------------------------------------------------|
  13977. * | Rsvd | receiver MAC addr 47:32 |
  13978. * |-------------------------------------------------------------------|
  13979. * | transmitter MAC addr 31:0 |
  13980. * |-------------------------------------------------------------------|
  13981. * | Rsvd | transmitter MAC addr 47:32 |
  13982. * |-------------------------------------------------------------------|
  13983. * | PN 31:0 |
  13984. * |-------------------------------------------------------------------|
  13985. * | Rsvd | PN 47:32 |
  13986. * |-------------------------------------------------------------------|
  13987. * - peer_id
  13988. * Bits 15:0
  13989. * Purpose: identifies which peer is frame is from
  13990. * value:
  13991. * - key_id
  13992. * Bits 23:16
  13993. * Purpose: identifies key_id of rx frame
  13994. * value:
  13995. * - RA_31_0 (receiver MAC addr 31:0)
  13996. * Bits 31:0
  13997. * Purpose: identifies by MAC address which vdev received the frame
  13998. * value: MAC address lower 4 bytes
  13999. * - RA_47_32 (receiver MAC addr 47:32)
  14000. * Bits 15:0
  14001. * Purpose: identifies by MAC address which vdev received the frame
  14002. * value: MAC address upper 2 bytes
  14003. * - TA_31_0 (transmitter MAC addr 31:0)
  14004. * Bits 31:0
  14005. * Purpose: identifies by MAC address which peer transmitted the frame
  14006. * value: MAC address lower 4 bytes
  14007. * - TA_47_32 (transmitter MAC addr 47:32)
  14008. * Bits 15:0
  14009. * Purpose: identifies by MAC address which peer transmitted the frame
  14010. * value: MAC address upper 2 bytes
  14011. * - PN_31_0
  14012. * Bits 31:0
  14013. * Purpose: Identifies pn of rx frame
  14014. * value: PN lower 4 bytes
  14015. * - PN_47_32
  14016. * Bits 15:0
  14017. * Purpose: Identifies pn of rx frame
  14018. * value:
  14019. * TKIP or CCMP: PN upper 2 bytes
  14020. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14021. */
  14022. enum htt_rx_ofld_pkt_err_type {
  14023. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14024. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14025. };
  14026. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14027. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14028. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14029. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14030. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14031. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14032. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14033. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14034. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14035. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14036. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14037. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14038. do { \
  14039. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14040. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14041. } while (0)
  14042. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14043. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14044. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14045. do { \
  14046. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14047. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14048. } while (0)
  14049. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14050. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14051. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14052. do { \
  14053. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14054. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14055. } while (0)
  14056. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14058. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14060. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14063. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14066. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14068. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14069. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14071. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14072. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14073. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14074. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14075. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14076. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14077. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14078. do { \
  14079. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14080. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14081. } while (0)
  14082. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14083. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14084. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14085. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14086. do { \
  14087. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14088. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14089. } while (0)
  14090. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14091. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14092. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14093. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14094. do { \
  14095. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14096. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14097. } while (0)
  14098. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14099. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14100. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14101. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14102. do { \
  14103. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14104. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14105. } while (0)
  14106. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14107. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14108. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14109. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14110. do { \
  14111. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14112. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14113. } while (0)
  14114. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14115. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14116. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14117. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14118. do { \
  14119. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14120. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14121. } while (0)
  14122. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14123. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14124. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14125. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14126. do { \
  14127. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14128. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14129. } while (0)
  14130. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14131. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14132. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14133. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14134. do { \
  14135. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14136. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14137. } while (0)
  14138. /**
  14139. * @brief target -> host peer rate report message
  14140. *
  14141. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14142. *
  14143. * @details
  14144. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14145. * justified rate of all the peers.
  14146. *
  14147. * |31 24|23 16|15 8|7 0|
  14148. * |----------------+----------------+----------------+----------------|
  14149. * | peer_count | | msg_type |
  14150. * |-------------------------------------------------------------------|
  14151. * : Payload (variant number of peer rate report) :
  14152. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14153. * Header fields:
  14154. * - msg_type
  14155. * Bits 7:0
  14156. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14157. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14158. * - reserved
  14159. * Bits 15:8
  14160. * Purpose:
  14161. * value:
  14162. * - peer_count
  14163. * Bits 31:16
  14164. * Purpose: Specify how many peer rate report elements are present in the payload.
  14165. * value:
  14166. *
  14167. * Payload:
  14168. * There are variant number of peer rate report follow the first 32 bits.
  14169. * The peer rate report is defined as follows.
  14170. *
  14171. * |31 20|19 16|15 0|
  14172. * |-----------------------+---------+---------------------------------|-
  14173. * | reserved | phy | peer_id | \
  14174. * |-------------------------------------------------------------------| -> report #0
  14175. * | rate | /
  14176. * |-----------------------+---------+---------------------------------|-
  14177. * | reserved | phy | peer_id | \
  14178. * |-------------------------------------------------------------------| -> report #1
  14179. * | rate | /
  14180. * |-----------------------+---------+---------------------------------|-
  14181. * | reserved | phy | peer_id | \
  14182. * |-------------------------------------------------------------------| -> report #2
  14183. * | rate | /
  14184. * |-------------------------------------------------------------------|-
  14185. * : :
  14186. * : :
  14187. * : :
  14188. * :-------------------------------------------------------------------:
  14189. *
  14190. * - peer_id
  14191. * Bits 15:0
  14192. * Purpose: identify the peer
  14193. * value:
  14194. * - phy
  14195. * Bits 19:16
  14196. * Purpose: identify which phy is in use
  14197. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14198. * Please see enum htt_peer_report_phy_type for detail.
  14199. * - reserved
  14200. * Bits 31:20
  14201. * Purpose:
  14202. * value:
  14203. * - rate
  14204. * Bits 31:0
  14205. * Purpose: represent the justified rate of the peer specified by peer_id
  14206. * value:
  14207. */
  14208. enum htt_peer_rate_report_phy_type {
  14209. HTT_PEER_RATE_REPORT_11B = 0,
  14210. HTT_PEER_RATE_REPORT_11A_G,
  14211. HTT_PEER_RATE_REPORT_11N,
  14212. HTT_PEER_RATE_REPORT_11AC,
  14213. };
  14214. #define HTT_PEER_RATE_REPORT_SIZE 8
  14215. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14216. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14217. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14218. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14219. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14220. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14221. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14222. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14223. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14224. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14225. do { \
  14226. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14227. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14228. } while (0)
  14229. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14230. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14231. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14232. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14233. do { \
  14234. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14235. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14236. } while (0)
  14237. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14238. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14239. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14240. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14241. do { \
  14242. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14243. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14244. } while (0)
  14245. /**
  14246. * @brief target -> host flow pool map message
  14247. *
  14248. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14249. *
  14250. * @details
  14251. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14252. * a flow of descriptors.
  14253. *
  14254. * This message is in TLV format and indicates the parameters to be setup a
  14255. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14256. * receive descriptors from a specified pool.
  14257. *
  14258. * The message would appear as follows:
  14259. *
  14260. * |31 24|23 16|15 8|7 0|
  14261. * |----------------+----------------+----------------+----------------|
  14262. * header | reserved | num_flows | msg_type |
  14263. * |-------------------------------------------------------------------|
  14264. * | |
  14265. * : payload :
  14266. * | |
  14267. * |-------------------------------------------------------------------|
  14268. *
  14269. * The header field is one DWORD long and is interpreted as follows:
  14270. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14271. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14272. * this message
  14273. * b'16-31 - reserved: These bits are reserved for future use
  14274. *
  14275. * Payload:
  14276. * The payload would contain multiple objects of the following structure. Each
  14277. * object represents a flow.
  14278. *
  14279. * |31 24|23 16|15 8|7 0|
  14280. * |----------------+----------------+----------------+----------------|
  14281. * header | reserved | num_flows | msg_type |
  14282. * |-------------------------------------------------------------------|
  14283. * payload0| flow_type |
  14284. * |-------------------------------------------------------------------|
  14285. * | flow_id |
  14286. * |-------------------------------------------------------------------|
  14287. * | reserved0 | flow_pool_id |
  14288. * |-------------------------------------------------------------------|
  14289. * | reserved1 | flow_pool_size |
  14290. * |-------------------------------------------------------------------|
  14291. * | reserved2 |
  14292. * |-------------------------------------------------------------------|
  14293. * payload1| flow_type |
  14294. * |-------------------------------------------------------------------|
  14295. * | flow_id |
  14296. * |-------------------------------------------------------------------|
  14297. * | reserved0 | flow_pool_id |
  14298. * |-------------------------------------------------------------------|
  14299. * | reserved1 | flow_pool_size |
  14300. * |-------------------------------------------------------------------|
  14301. * | reserved2 |
  14302. * |-------------------------------------------------------------------|
  14303. * | . |
  14304. * | . |
  14305. * | . |
  14306. * |-------------------------------------------------------------------|
  14307. *
  14308. * Each payload is 5 DWORDS long and is interpreted as follows:
  14309. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14310. * this flow is associated. It can be VDEV, peer,
  14311. * or tid (AC). Based on enum htt_flow_type.
  14312. *
  14313. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14314. * object. For flow_type vdev it is set to the
  14315. * vdevid, for peer it is peerid and for tid, it is
  14316. * tid_num.
  14317. *
  14318. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14319. * in the host for this flow
  14320. * b'16:31 - reserved0: This field in reserved for the future. In case
  14321. * we have a hierarchical implementation (HCM) of
  14322. * pools, it can be used to indicate the ID of the
  14323. * parent-pool.
  14324. *
  14325. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14326. * Descriptors for this flow will be
  14327. * allocated from this pool in the host.
  14328. * b'16:31 - reserved1: This field in reserved for the future. In case
  14329. * we have a hierarchical implementation of pools,
  14330. * it can be used to indicate the max number of
  14331. * descriptors in the pool. The b'0:15 can be used
  14332. * to indicate min number of descriptors in the
  14333. * HCM scheme.
  14334. *
  14335. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14336. * we have a hierarchical implementation of pools,
  14337. * b'0:15 can be used to indicate the
  14338. * priority-based borrowing (PBB) threshold of
  14339. * the flow's pool. The b'16:31 are still left
  14340. * reserved.
  14341. */
  14342. enum htt_flow_type {
  14343. FLOW_TYPE_VDEV = 0,
  14344. /* Insert new flow types above this line */
  14345. };
  14346. PREPACK struct htt_flow_pool_map_payload_t {
  14347. A_UINT32 flow_type;
  14348. A_UINT32 flow_id;
  14349. A_UINT32 flow_pool_id:16,
  14350. reserved0:16;
  14351. A_UINT32 flow_pool_size:16,
  14352. reserved1:16;
  14353. A_UINT32 reserved2;
  14354. } POSTPACK;
  14355. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14356. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14357. (sizeof(struct htt_flow_pool_map_payload_t))
  14358. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14359. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14360. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14361. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14362. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14363. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14364. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14365. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14366. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14367. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14368. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14369. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14370. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14371. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14372. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14373. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14374. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14375. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14376. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14377. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14378. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14379. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14380. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14381. do { \
  14382. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14383. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14384. } while (0)
  14385. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14386. do { \
  14387. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14388. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14389. } while (0)
  14390. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14391. do { \
  14392. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14393. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14394. } while (0)
  14395. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14396. do { \
  14397. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14398. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14399. } while (0)
  14400. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14401. do { \
  14402. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14403. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14404. } while (0)
  14405. /**
  14406. * @brief target -> host flow pool unmap message
  14407. *
  14408. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14409. *
  14410. * @details
  14411. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14412. * down a flow of descriptors.
  14413. * This message indicates that for the flow (whose ID is provided) is wanting
  14414. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14415. * pool of descriptors from where descriptors are being allocated for this
  14416. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14417. * be unmapped by the host.
  14418. *
  14419. * The message would appear as follows:
  14420. *
  14421. * |31 24|23 16|15 8|7 0|
  14422. * |----------------+----------------+----------------+----------------|
  14423. * | reserved0 | msg_type |
  14424. * |-------------------------------------------------------------------|
  14425. * | flow_type |
  14426. * |-------------------------------------------------------------------|
  14427. * | flow_id |
  14428. * |-------------------------------------------------------------------|
  14429. * | reserved1 | flow_pool_id |
  14430. * |-------------------------------------------------------------------|
  14431. *
  14432. * The message is interpreted as follows:
  14433. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14434. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14435. * b'8:31 - reserved0: Reserved for future use
  14436. *
  14437. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14438. * this flow is associated. It can be VDEV, peer,
  14439. * or tid (AC). Based on enum htt_flow_type.
  14440. *
  14441. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14442. * object. For flow_type vdev it is set to the
  14443. * vdevid, for peer it is peerid and for tid, it is
  14444. * tid_num.
  14445. *
  14446. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14447. * used in the host for this flow
  14448. * b'16:31 - reserved0: This field in reserved for the future.
  14449. *
  14450. */
  14451. PREPACK struct htt_flow_pool_unmap_t {
  14452. A_UINT32 msg_type:8,
  14453. reserved0:24;
  14454. A_UINT32 flow_type;
  14455. A_UINT32 flow_id;
  14456. A_UINT32 flow_pool_id:16,
  14457. reserved1:16;
  14458. } POSTPACK;
  14459. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14460. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14461. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14462. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14463. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14464. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14465. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14466. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14467. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14468. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14469. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14470. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14471. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14472. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14473. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14474. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14475. do { \
  14476. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14477. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14478. } while (0)
  14479. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14480. do { \
  14481. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14482. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14483. } while (0)
  14484. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14485. do { \
  14486. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14487. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14488. } while (0)
  14489. /**
  14490. * @brief target -> host SRING setup done message
  14491. *
  14492. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14493. *
  14494. * @details
  14495. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14496. * SRNG ring setup is done
  14497. *
  14498. * This message indicates whether the last setup operation is successful.
  14499. * It will be sent to host when host set respose_required bit in
  14500. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14501. * The message would appear as follows:
  14502. *
  14503. * |31 24|23 16|15 8|7 0|
  14504. * |--------------- +----------------+----------------+----------------|
  14505. * | setup_status | ring_id | pdev_id | msg_type |
  14506. * |-------------------------------------------------------------------|
  14507. *
  14508. * The message is interpreted as follows:
  14509. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14510. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14511. * b'8:15 - pdev_id:
  14512. * 0 (for rings at SOC/UMAC level),
  14513. * 1/2/3 mac id (for rings at LMAC level)
  14514. * b'16:23 - ring_id: Identify the ring which is set up
  14515. * More details can be got from enum htt_srng_ring_id
  14516. * b'24:31 - setup_status: Indicate status of setup operation
  14517. * Refer to htt_ring_setup_status
  14518. */
  14519. PREPACK struct htt_sring_setup_done_t {
  14520. A_UINT32 msg_type: 8,
  14521. pdev_id: 8,
  14522. ring_id: 8,
  14523. setup_status: 8;
  14524. } POSTPACK;
  14525. enum htt_ring_setup_status {
  14526. htt_ring_setup_status_ok = 0,
  14527. htt_ring_setup_status_error,
  14528. };
  14529. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14530. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14531. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14532. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14533. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14534. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14535. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14536. do { \
  14537. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14538. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14539. } while (0)
  14540. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14541. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14542. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14543. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14544. HTT_SRING_SETUP_DONE_RING_ID_S)
  14545. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14546. do { \
  14547. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14548. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14549. } while (0)
  14550. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14551. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14552. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14553. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14554. HTT_SRING_SETUP_DONE_STATUS_S)
  14555. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14556. do { \
  14557. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14558. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14559. } while (0)
  14560. /**
  14561. * @brief target -> flow map flow info
  14562. *
  14563. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14564. *
  14565. * @details
  14566. * HTT TX map flow entry with tqm flow pointer
  14567. * Sent from firmware to host to add tqm flow pointer in corresponding
  14568. * flow search entry. Flow metadata is replayed back to host as part of this
  14569. * struct to enable host to find the specific flow search entry
  14570. *
  14571. * The message would appear as follows:
  14572. *
  14573. * |31 28|27 18|17 14|13 8|7 0|
  14574. * |-------+------------------------------------------+----------------|
  14575. * | rsvd0 | fse_hsh_idx | msg_type |
  14576. * |-------------------------------------------------------------------|
  14577. * | rsvd1 | tid | peer_id |
  14578. * |-------------------------------------------------------------------|
  14579. * | tqm_flow_pntr_lo |
  14580. * |-------------------------------------------------------------------|
  14581. * | tqm_flow_pntr_hi |
  14582. * |-------------------------------------------------------------------|
  14583. * | fse_meta_data |
  14584. * |-------------------------------------------------------------------|
  14585. *
  14586. * The message is interpreted as follows:
  14587. *
  14588. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14589. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14590. *
  14591. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14592. * for this flow entry
  14593. *
  14594. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14595. *
  14596. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14597. *
  14598. * dword1 - b'14:17 - tid
  14599. *
  14600. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14601. *
  14602. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14603. *
  14604. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14605. *
  14606. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14607. * given by host
  14608. */
  14609. PREPACK struct htt_tx_map_flow_info {
  14610. A_UINT32
  14611. msg_type: 8,
  14612. fse_hsh_idx: 20,
  14613. rsvd0: 4;
  14614. A_UINT32
  14615. peer_id: 14,
  14616. tid: 4,
  14617. rsvd1: 14;
  14618. A_UINT32 tqm_flow_pntr_lo;
  14619. A_UINT32 tqm_flow_pntr_hi;
  14620. struct htt_tx_flow_metadata fse_meta_data;
  14621. } POSTPACK;
  14622. /* DWORD 0 */
  14623. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14624. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14625. /* DWORD 1 */
  14626. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14627. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14628. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14629. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14630. /* DWORD 0 */
  14631. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14632. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14633. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14634. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14635. do { \
  14636. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14637. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14638. } while (0)
  14639. /* DWORD 1 */
  14640. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14641. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14642. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14643. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14644. do { \
  14645. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14646. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14647. } while (0)
  14648. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14649. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14650. HTT_TX_MAP_FLOW_INFO_TID_S)
  14651. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14652. do { \
  14653. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14654. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14655. } while (0)
  14656. /*
  14657. * htt_dbg_ext_stats_status -
  14658. * present - The requested stats have been delivered in full.
  14659. * This indicates that either the stats information was contained
  14660. * in its entirety within this message, or else this message
  14661. * completes the delivery of the requested stats info that was
  14662. * partially delivered through earlier STATS_CONF messages.
  14663. * partial - The requested stats have been delivered in part.
  14664. * One or more subsequent STATS_CONF messages with the same
  14665. * cookie value will be sent to deliver the remainder of the
  14666. * information.
  14667. * error - The requested stats could not be delivered, for example due
  14668. * to a shortage of memory to construct a message holding the
  14669. * requested stats.
  14670. * invalid - The requested stat type is either not recognized, or the
  14671. * target is configured to not gather the stats type in question.
  14672. */
  14673. enum htt_dbg_ext_stats_status {
  14674. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14675. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14676. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14677. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14678. };
  14679. /**
  14680. * @brief target -> host ppdu stats upload
  14681. *
  14682. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14683. *
  14684. * @details
  14685. * The following field definitions describe the format of the HTT target
  14686. * to host ppdu stats indication message.
  14687. *
  14688. *
  14689. * |31 16|15 12|11 10|9 8|7 0 |
  14690. * |----------------------------------------------------------------------|
  14691. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14692. * |----------------------------------------------------------------------|
  14693. * | ppdu_id |
  14694. * |----------------------------------------------------------------------|
  14695. * | Timestamp in us |
  14696. * |----------------------------------------------------------------------|
  14697. * | reserved |
  14698. * |----------------------------------------------------------------------|
  14699. * | type-specific stats info |
  14700. * | (see htt_ppdu_stats.h) |
  14701. * |----------------------------------------------------------------------|
  14702. * Header fields:
  14703. * - MSG_TYPE
  14704. * Bits 7:0
  14705. * Purpose: Identifies this is a PPDU STATS indication
  14706. * message.
  14707. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14708. * - mac_id
  14709. * Bits 9:8
  14710. * Purpose: mac_id of this ppdu_id
  14711. * Value: 0-3
  14712. * - pdev_id
  14713. * Bits 11:10
  14714. * Purpose: pdev_id of this ppdu_id
  14715. * Value: 0-3
  14716. * 0 (for rings at SOC level),
  14717. * 1/2/3 PDEV -> 0/1/2
  14718. * - payload_size
  14719. * Bits 31:16
  14720. * Purpose: total tlv size
  14721. * Value: payload_size in bytes
  14722. */
  14723. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14724. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14725. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14726. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14727. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14728. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14729. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14730. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14731. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14732. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14733. do { \
  14734. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14735. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14736. } while (0)
  14737. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14738. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14739. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14740. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14741. do { \
  14742. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14743. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14744. } while (0)
  14745. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14746. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14747. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14748. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14749. do { \
  14750. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14751. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14752. } while (0)
  14753. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14754. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14755. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14756. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14757. do { \
  14758. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14759. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14760. } while (0)
  14761. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14762. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14763. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14764. /* htt_t2h_ppdu_stats_ind_hdr_t
  14765. * This struct contains the fields within the header of the
  14766. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14767. * stats info.
  14768. * This struct assumes little-endian layout, and thus is only
  14769. * suitable for use within processors known to be little-endian
  14770. * (such as the target).
  14771. * In contrast, the above macros provide endian-portable methods
  14772. * to get and set the bitfields within this PPDU_STATS_IND header.
  14773. */
  14774. typedef struct {
  14775. A_UINT32 msg_type: 8, /* bits 7:0 */
  14776. mac_id: 2, /* bits 9:8 */
  14777. pdev_id: 2, /* bits 11:10 */
  14778. reserved1: 4, /* bits 15:12 */
  14779. payload_size: 16; /* bits 31:16 */
  14780. A_UINT32 ppdu_id;
  14781. A_UINT32 timestamp_us;
  14782. A_UINT32 reserved2;
  14783. } htt_t2h_ppdu_stats_ind_hdr_t;
  14784. /**
  14785. * @brief target -> host extended statistics upload
  14786. *
  14787. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14788. *
  14789. * @details
  14790. * The following field definitions describe the format of the HTT target
  14791. * to host stats upload confirmation message.
  14792. * The message contains a cookie echoed from the HTT host->target stats
  14793. * upload request, which identifies which request the confirmation is
  14794. * for, and a single stats can span over multiple HTT stats indication
  14795. * due to the HTT message size limitation so every HTT ext stats indication
  14796. * will have tag-length-value stats information elements.
  14797. * The tag-length header for each HTT stats IND message also includes a
  14798. * status field, to indicate whether the request for the stat type in
  14799. * question was fully met, partially met, unable to be met, or invalid
  14800. * (if the stat type in question is disabled in the target).
  14801. * A Done bit 1's indicate the end of the of stats info elements.
  14802. *
  14803. *
  14804. * |31 16|15 12|11|10 8|7 5|4 0|
  14805. * |--------------------------------------------------------------|
  14806. * | reserved | msg type |
  14807. * |--------------------------------------------------------------|
  14808. * | cookie LSBs |
  14809. * |--------------------------------------------------------------|
  14810. * | cookie MSBs |
  14811. * |--------------------------------------------------------------|
  14812. * | stats entry length | rsvd | D| S | stat type |
  14813. * |--------------------------------------------------------------|
  14814. * | type-specific stats info |
  14815. * | (see htt_stats.h) |
  14816. * |--------------------------------------------------------------|
  14817. * Header fields:
  14818. * - MSG_TYPE
  14819. * Bits 7:0
  14820. * Purpose: Identifies this is a extended statistics upload confirmation
  14821. * message.
  14822. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14823. * - COOKIE_LSBS
  14824. * Bits 31:0
  14825. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14826. * message with its preceding host->target stats request message.
  14827. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14828. * - COOKIE_MSBS
  14829. * Bits 31:0
  14830. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14831. * message with its preceding host->target stats request message.
  14832. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14833. *
  14834. * Stats Information Element tag-length header fields:
  14835. * - STAT_TYPE
  14836. * Bits 7:0
  14837. * Purpose: identifies the type of statistics info held in the
  14838. * following information element
  14839. * Value: htt_dbg_ext_stats_type
  14840. * - STATUS
  14841. * Bits 10:8
  14842. * Purpose: indicate whether the requested stats are present
  14843. * Value: htt_dbg_ext_stats_status
  14844. * - DONE
  14845. * Bits 11
  14846. * Purpose:
  14847. * Indicates the completion of the stats entry, this will be the last
  14848. * stats conf HTT segment for the requested stats type.
  14849. * Value:
  14850. * 0 -> the stats retrieval is ongoing
  14851. * 1 -> the stats retrieval is complete
  14852. * - LENGTH
  14853. * Bits 31:16
  14854. * Purpose: indicate the stats information size
  14855. * Value: This field specifies the number of bytes of stats information
  14856. * that follows the element tag-length header.
  14857. * It is expected but not required that this length is a multiple of
  14858. * 4 bytes.
  14859. */
  14860. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14861. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14862. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14863. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14864. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14865. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14866. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14867. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14868. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14869. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14870. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14871. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14872. do { \
  14873. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14874. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14875. } while (0)
  14876. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14877. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14878. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14879. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14880. do { \
  14881. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14882. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14883. } while (0)
  14884. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14885. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14886. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14887. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14888. do { \
  14889. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14890. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14891. } while (0)
  14892. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14893. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14894. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14895. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14896. do { \
  14897. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14898. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14899. } while (0)
  14900. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14901. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14902. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14903. /**
  14904. * @brief target -> host streaming statistics upload
  14905. *
  14906. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14907. *
  14908. * @details
  14909. * The following field definitions describe the format of the HTT target
  14910. * to host streaming stats upload indication message.
  14911. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14912. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14913. * use the STREAMING_STATS_REQ message to halt the target's production of
  14914. * STREAMING_STATS_IND messages.
  14915. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14916. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14917. *
  14918. * |31 8|7 0|
  14919. * |--------------------------------------------------------------|
  14920. * | reserved | msg type |
  14921. * |--------------------------------------------------------------|
  14922. * | type-specific stats info |
  14923. * | (see htt_stats.h) |
  14924. * |--------------------------------------------------------------|
  14925. * Header fields:
  14926. * - MSG_TYPE
  14927. * Bits 7:0
  14928. * Purpose: Identifies this as a streaming statistics upload indication
  14929. * message.
  14930. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14931. */
  14932. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14933. typedef enum {
  14934. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14935. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14936. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14937. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14938. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14939. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14940. /* Reserved from 128 - 255 for target internal use.*/
  14941. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14942. } HTT_PEER_TYPE;
  14943. /** macro to convert MAC address from char array to HTT word format */
  14944. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14945. (phtt_mac_addr)->mac_addr31to0 = \
  14946. (((c_macaddr)[0] << 0) | \
  14947. ((c_macaddr)[1] << 8) | \
  14948. ((c_macaddr)[2] << 16) | \
  14949. ((c_macaddr)[3] << 24)); \
  14950. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14951. } while (0)
  14952. /**
  14953. * @brief target -> host monitor mac header indication message
  14954. *
  14955. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14956. *
  14957. * @details
  14958. * The following diagram shows the format of the monitor mac header message
  14959. * sent from the target to the host.
  14960. * This message is primarily sent when promiscuous rx mode is enabled.
  14961. * One message is sent per rx PPDU.
  14962. *
  14963. * |31 24|23 16|15 8|7 0|
  14964. * |-------------------------------------------------------------|
  14965. * | peer_id | reserved0 | msg_type |
  14966. * |-------------------------------------------------------------|
  14967. * | reserved1 | num_mpdu |
  14968. * |-------------------------------------------------------------|
  14969. * | struct hw_rx_desc |
  14970. * | (see wal_rx_desc.h) |
  14971. * |-------------------------------------------------------------|
  14972. * | struct ieee80211_frame_addr4 |
  14973. * | (see ieee80211_defs.h) |
  14974. * |-------------------------------------------------------------|
  14975. * | struct ieee80211_frame_addr4 |
  14976. * | (see ieee80211_defs.h) |
  14977. * |-------------------------------------------------------------|
  14978. * | ...... |
  14979. * |-------------------------------------------------------------|
  14980. *
  14981. * Header fields:
  14982. * - msg_type
  14983. * Bits 7:0
  14984. * Purpose: Identifies this is a monitor mac header indication message.
  14985. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14986. * - peer_id
  14987. * Bits 31:16
  14988. * Purpose: Software peer id given by host during association,
  14989. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14990. * for rx PPDUs received from unassociated peers.
  14991. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14992. * - num_mpdu
  14993. * Bits 15:0
  14994. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14995. * delivered within the message.
  14996. * Value: 1 to 32
  14997. * num_mpdu is limited to a maximum value of 32, due to buffer
  14998. * size limits. For PPDUs with more than 32 MPDUs, only the
  14999. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15000. * the PPDU will be provided.
  15001. */
  15002. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15003. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15004. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15005. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15006. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15007. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15008. do { \
  15009. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15010. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15011. } while (0)
  15012. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15013. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15014. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15015. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15016. do { \
  15017. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15018. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15019. } while (0)
  15020. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15021. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15022. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15023. /**
  15024. * @brief target -> host flow pool resize Message
  15025. *
  15026. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15027. *
  15028. * @details
  15029. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15030. * the flow pool associated with the specified ID is resized
  15031. *
  15032. * The message would appear as follows:
  15033. *
  15034. * |31 16|15 8|7 0|
  15035. * |---------------------------------+----------------+----------------|
  15036. * | reserved0 | Msg type |
  15037. * |-------------------------------------------------------------------|
  15038. * | flow pool new size | flow pool ID |
  15039. * |-------------------------------------------------------------------|
  15040. *
  15041. * The message is interpreted as follows:
  15042. * b'0:7 - msg_type: This will be set to 0x21
  15043. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15044. *
  15045. * b'0:15 - flow pool ID: Existing flow pool ID
  15046. *
  15047. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15048. *
  15049. */
  15050. PREPACK struct htt_flow_pool_resize_t {
  15051. A_UINT32 msg_type:8,
  15052. reserved0:24;
  15053. A_UINT32 flow_pool_id:16,
  15054. flow_pool_new_size:16;
  15055. } POSTPACK;
  15056. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15057. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15058. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15059. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15060. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15061. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15062. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15063. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15064. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15065. do { \
  15066. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15067. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15068. } while (0)
  15069. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15070. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15071. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15072. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15073. do { \
  15074. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15075. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15076. } while (0)
  15077. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15078. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15079. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15080. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15081. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15082. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15083. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15084. /*
  15085. * The read and write indices point to the data within the host buffer.
  15086. * Because the first 4 bytes of the host buffer is used for the read index and
  15087. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15088. * The read index and write index are the byte offsets from the base of the
  15089. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15090. * Refer the ASCII text picture below.
  15091. */
  15092. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15093. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15094. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15095. /*
  15096. ***************************************************************************
  15097. *
  15098. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15099. *
  15100. ***************************************************************************
  15101. *
  15102. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15103. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15104. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15105. * written into the Host memory region mentioned below.
  15106. *
  15107. * Read index is updated by the Host. At any point of time, the read index will
  15108. * indicate the index that will next be read by the Host. The read index is
  15109. * in units of bytes offset from the base of the meta-data buffer.
  15110. *
  15111. * Write index is updated by the FW. At any point of time, the write index will
  15112. * indicate from where the FW can start writing any new data. The write index is
  15113. * in units of bytes offset from the base of the meta-data buffer.
  15114. *
  15115. * If the Host is not fast enough in reading the CFR data, any new capture data
  15116. * would be dropped if there is no space left to write the new captures.
  15117. *
  15118. * The last 4 bytes of the memory region will have the magic pattern
  15119. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15120. * not overrun the host buffer.
  15121. *
  15122. * ,--------------------. read and write indices store the
  15123. * | | byte offset from the base of the
  15124. * | ,--------+--------. meta-data buffer to the next
  15125. * | | | | location within the data buffer
  15126. * | | v v that will be read / written
  15127. * ************************************************************************
  15128. * * Read * Write * * Magic *
  15129. * * index * index * CFR data1 ...... CFR data N * pattern *
  15130. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15131. * ************************************************************************
  15132. * |<---------- data buffer ---------->|
  15133. *
  15134. * |<----------------- meta-data buffer allocated in Host ----------------|
  15135. *
  15136. * Note:
  15137. * - Considering the 4 bytes needed to store the Read index (R) and the
  15138. * Write index (W), the initial value is as follows:
  15139. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15140. * - Buffer empty condition:
  15141. * R = W
  15142. *
  15143. * Regarding CFR data format:
  15144. * --------------------------
  15145. *
  15146. * Each CFR tone is stored in HW as 16-bits with the following format:
  15147. * {bits[15:12], bits[11:6], bits[5:0]} =
  15148. * {unsigned exponent (4 bits),
  15149. * signed mantissa_real (6 bits),
  15150. * signed mantissa_imag (6 bits)}
  15151. *
  15152. * CFR_real = mantissa_real * 2^(exponent-5)
  15153. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15154. *
  15155. *
  15156. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15157. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15158. *
  15159. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15160. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15161. * .
  15162. * .
  15163. * .
  15164. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15165. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15166. */
  15167. /* Bandwidth of peer CFR captures */
  15168. typedef enum {
  15169. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15170. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15171. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15172. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15173. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15174. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15175. } HTT_PEER_CFR_CAPTURE_BW;
  15176. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15177. * was captured
  15178. */
  15179. typedef enum {
  15180. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15181. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15182. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15183. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15184. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15185. } HTT_PEER_CFR_CAPTURE_MODE;
  15186. typedef enum {
  15187. /* This message type is currently used for the below purpose:
  15188. *
  15189. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15190. * wmi_peer_cfr_capture_cmd.
  15191. * If payload_present bit is set to 0 then the associated memory region
  15192. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15193. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15194. * message; the CFR dump will be present at the end of the message,
  15195. * after the chan_phy_mode.
  15196. */
  15197. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15198. /* Always keep this last */
  15199. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15200. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15201. /**
  15202. * @brief target -> host CFR dump completion indication message definition
  15203. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15204. *
  15205. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15206. *
  15207. * @details
  15208. * The following diagram shows the format of the Channel Frequency Response
  15209. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15210. * the channel capture of a peer is copied by Firmware into the Host memory
  15211. *
  15212. * **************************************************************************
  15213. *
  15214. * Message format when the CFR capture message type is
  15215. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15216. *
  15217. * **************************************************************************
  15218. *
  15219. * |31 16|15 |8|7 0|
  15220. * |----------------------------------------------------------------|
  15221. * header: | reserved |P| msg_type |
  15222. * word 0 | | | |
  15223. * |----------------------------------------------------------------|
  15224. * payload: | cfr_capture_msg_type |
  15225. * word 1 | |
  15226. * |----------------------------------------------------------------|
  15227. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15228. * word 2 | | | | | | | | |
  15229. * |----------------------------------------------------------------|
  15230. * | mac_addr31to0 |
  15231. * word 3 | |
  15232. * |----------------------------------------------------------------|
  15233. * | unused / reserved | mac_addr47to32 |
  15234. * word 4 | | |
  15235. * |----------------------------------------------------------------|
  15236. * | index |
  15237. * word 5 | |
  15238. * |----------------------------------------------------------------|
  15239. * | length |
  15240. * word 6 | |
  15241. * |----------------------------------------------------------------|
  15242. * | timestamp |
  15243. * word 7 | |
  15244. * |----------------------------------------------------------------|
  15245. * | counter |
  15246. * word 8 | |
  15247. * |----------------------------------------------------------------|
  15248. * | chan_mhz |
  15249. * word 9 | |
  15250. * |----------------------------------------------------------------|
  15251. * | band_center_freq1 |
  15252. * word 10 | |
  15253. * |----------------------------------------------------------------|
  15254. * | band_center_freq2 |
  15255. * word 11 | |
  15256. * |----------------------------------------------------------------|
  15257. * | chan_phy_mode |
  15258. * word 12 | |
  15259. * |----------------------------------------------------------------|
  15260. * where,
  15261. * P - payload present bit (payload_present explained below)
  15262. * req_id - memory request id (mem_req_id explained below)
  15263. * S - status field (status explained below)
  15264. * capbw - capture bandwidth (capture_bw explained below)
  15265. * mode - mode of capture (mode explained below)
  15266. * sts - space time streams (sts_count explained below)
  15267. * chbw - channel bandwidth (channel_bw explained below)
  15268. * captype - capture type (cap_type explained below)
  15269. *
  15270. * The following field definitions describe the format of the CFR dump
  15271. * completion indication sent from the target to the host
  15272. *
  15273. * Header fields:
  15274. *
  15275. * Word 0
  15276. * - msg_type
  15277. * Bits 7:0
  15278. * Purpose: Identifies this as CFR TX completion indication
  15279. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15280. * - payload_present
  15281. * Bit 8
  15282. * Purpose: Identifies how CFR data is sent to host
  15283. * Value: 0 - If CFR Payload is written to host memory
  15284. * 1 - If CFR Payload is sent as part of HTT message
  15285. * (This is the requirement for SDIO/USB where it is
  15286. * not possible to write CFR data to host memory)
  15287. * - reserved
  15288. * Bits 31:9
  15289. * Purpose: Reserved
  15290. * Value: 0
  15291. *
  15292. * Payload fields:
  15293. *
  15294. * Word 1
  15295. * - cfr_capture_msg_type
  15296. * Bits 31:0
  15297. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15298. * to specify the format used for the remainder of the message
  15299. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15300. * (currently only MSG_TYPE_1 is defined)
  15301. *
  15302. * Word 2
  15303. * - mem_req_id
  15304. * Bits 6:0
  15305. * Purpose: Contain the mem request id of the region where the CFR capture
  15306. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15307. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15308. this value is invalid)
  15309. * - status
  15310. * Bit 7
  15311. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15312. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15313. * - capture_bw
  15314. * Bits 10:8
  15315. * Purpose: Carry the bandwidth of the CFR capture
  15316. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15317. * - mode
  15318. * Bits 13:11
  15319. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15320. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15321. * - sts_count
  15322. * Bits 16:14
  15323. * Purpose: Carry the number of space time streams
  15324. * Value: Number of space time streams
  15325. * - channel_bw
  15326. * Bits 19:17
  15327. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15328. * measurement
  15329. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15330. * - cap_type
  15331. * Bits 23:20
  15332. * Purpose: Carry the type of the capture
  15333. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15334. * - vdev_id
  15335. * Bits 31:24
  15336. * Purpose: Carry the virtual device id
  15337. * Value: vdev ID
  15338. *
  15339. * Word 3
  15340. * - mac_addr31to0
  15341. * Bits 31:0
  15342. * Purpose: Contain the bits 31:0 of the peer MAC address
  15343. * Value: Bits 31:0 of the peer MAC address
  15344. *
  15345. * Word 4
  15346. * - mac_addr47to32
  15347. * Bits 15:0
  15348. * Purpose: Contain the bits 47:32 of the peer MAC address
  15349. * Value: Bits 47:32 of the peer MAC address
  15350. *
  15351. * Word 5
  15352. * - index
  15353. * Bits 31:0
  15354. * Purpose: Contain the index at which this CFR dump was written in the Host
  15355. * allocated memory. This index is the number of bytes from the base address.
  15356. * Value: Index position
  15357. *
  15358. * Word 6
  15359. * - length
  15360. * Bits 31:0
  15361. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15362. * Value: Length of the CFR capture of the peer
  15363. *
  15364. * Word 7
  15365. * - timestamp
  15366. * Bits 31:0
  15367. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15368. * clock used for this timestamp is private to the target and not visible to
  15369. * the host i.e., Host can interpret only the relative timestamp deltas from
  15370. * one message to the next, but can't interpret the absolute timestamp from a
  15371. * single message.
  15372. * Value: Timestamp in microseconds
  15373. *
  15374. * Word 8
  15375. * - counter
  15376. * Bits 31:0
  15377. * Purpose: Carry the count of the current CFR capture from FW. This is
  15378. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15379. * in host memory)
  15380. * Value: Count of the current CFR capture
  15381. *
  15382. * Word 9
  15383. * - chan_mhz
  15384. * Bits 31:0
  15385. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15386. * Value: Primary 20 channel frequency
  15387. *
  15388. * Word 10
  15389. * - band_center_freq1
  15390. * Bits 31:0
  15391. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15392. * Value: Center frequency 1 in MHz
  15393. *
  15394. * Word 11
  15395. * - band_center_freq2
  15396. * Bits 31:0
  15397. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15398. * the VDEV
  15399. * 80plus80 mode
  15400. * Value: Center frequency 2 in MHz
  15401. *
  15402. * Word 12
  15403. * - chan_phy_mode
  15404. * Bits 31:0
  15405. * Purpose: Carry the phy mode of the channel, of the VDEV
  15406. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15407. */
  15408. PREPACK struct htt_cfr_dump_ind_type_1 {
  15409. A_UINT32 mem_req_id:7,
  15410. status:1,
  15411. capture_bw:3,
  15412. mode:3,
  15413. sts_count:3,
  15414. channel_bw:3,
  15415. cap_type:4,
  15416. vdev_id:8;
  15417. htt_mac_addr addr;
  15418. A_UINT32 index;
  15419. A_UINT32 length;
  15420. A_UINT32 timestamp;
  15421. A_UINT32 counter;
  15422. struct htt_chan_change_msg chan;
  15423. } POSTPACK;
  15424. PREPACK struct htt_cfr_dump_compl_ind {
  15425. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15426. union {
  15427. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15428. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15429. /* If there is a need to change the memory layout and its associated
  15430. * HTT indication format, a new CFR capture message type can be
  15431. * introduced and added into this union.
  15432. */
  15433. };
  15434. } POSTPACK;
  15435. /*
  15436. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15437. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15438. */
  15439. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15440. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15441. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15442. do { \
  15443. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15444. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15445. } while(0)
  15446. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15447. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15448. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15449. /*
  15450. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15451. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15452. */
  15453. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15454. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15455. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15456. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15457. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15458. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15459. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15460. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15461. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15462. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15463. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15464. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15465. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15466. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15467. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15468. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15469. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15470. do { \
  15471. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15472. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15473. } while (0)
  15474. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15475. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15476. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15477. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15478. do { \
  15479. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15480. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15481. } while (0)
  15482. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15483. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15484. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15485. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15486. do { \
  15487. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15488. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15489. } while (0)
  15490. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15491. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15492. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15493. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15494. do { \
  15495. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15496. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15497. } while (0)
  15498. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15499. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15500. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15501. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15502. do { \
  15503. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15504. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15505. } while (0)
  15506. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15507. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15508. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15509. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15510. do { \
  15511. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15512. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15513. } while (0)
  15514. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15515. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15516. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15517. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15518. do { \
  15519. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15520. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15521. } while (0)
  15522. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15523. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15524. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15525. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15526. do { \
  15527. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15528. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15529. } while (0)
  15530. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15531. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15532. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15533. /**
  15534. * @brief target -> host peer (PPDU) stats message
  15535. *
  15536. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15537. *
  15538. * @details
  15539. * This message is generated by FW when FW is sending stats to host
  15540. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15541. * This message is sent autonomously by the target rather than upon request
  15542. * by the host.
  15543. * The following field definitions describe the format of the HTT target
  15544. * to host peer stats indication message.
  15545. *
  15546. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15547. * or more PPDU stats records.
  15548. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15549. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15550. * then the message would start with the
  15551. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15552. * below.
  15553. *
  15554. * |31 16|15|14|13 11|10 9|8|7 0|
  15555. * |-------------------------------------------------------------|
  15556. * | reserved |MSG_TYPE |
  15557. * |-------------------------------------------------------------|
  15558. * rec 0 | TLV header |
  15559. * rec 0 |-------------------------------------------------------------|
  15560. * rec 0 | ppdu successful bytes |
  15561. * rec 0 |-------------------------------------------------------------|
  15562. * rec 0 | ppdu retry bytes |
  15563. * rec 0 |-------------------------------------------------------------|
  15564. * rec 0 | ppdu failed bytes |
  15565. * rec 0 |-------------------------------------------------------------|
  15566. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15567. * rec 0 |-------------------------------------------------------------|
  15568. * rec 0 | retried MSDUs | successful MSDUs |
  15569. * rec 0 |-------------------------------------------------------------|
  15570. * rec 0 | TX duration | failed MSDUs |
  15571. * rec 0 |-------------------------------------------------------------|
  15572. * ...
  15573. * |-------------------------------------------------------------|
  15574. * rec N | TLV header |
  15575. * rec N |-------------------------------------------------------------|
  15576. * rec N | ppdu successful bytes |
  15577. * rec N |-------------------------------------------------------------|
  15578. * rec N | ppdu retry bytes |
  15579. * rec N |-------------------------------------------------------------|
  15580. * rec N | ppdu failed bytes |
  15581. * rec N |-------------------------------------------------------------|
  15582. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15583. * rec N |-------------------------------------------------------------|
  15584. * rec N | retried MSDUs | successful MSDUs |
  15585. * rec N |-------------------------------------------------------------|
  15586. * rec N | TX duration | failed MSDUs |
  15587. * rec N |-------------------------------------------------------------|
  15588. *
  15589. * where:
  15590. * A = is A-MPDU flag
  15591. * BA = block-ack failure flags
  15592. * BW = bandwidth spec
  15593. * SG = SGI enabled spec
  15594. * S = skipped rate ctrl
  15595. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15596. *
  15597. * Header
  15598. * ------
  15599. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15600. * dword0 - b'8:31 - reserved : Reserved for future use
  15601. *
  15602. * payload include below peer_stats information
  15603. * --------------------------------------------
  15604. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15605. * @tx_success_bytes : total successful bytes in the PPDU.
  15606. * @tx_retry_bytes : total retried bytes in the PPDU.
  15607. * @tx_failed_bytes : total failed bytes in the PPDU.
  15608. * @tx_ratecode : rate code used for the PPDU.
  15609. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15610. * @ba_ack_failed : BA/ACK failed for this PPDU
  15611. * b00 -> BA received
  15612. * b01 -> BA failed once
  15613. * b10 -> BA failed twice, when HW retry is enabled.
  15614. * @bw : BW
  15615. * b00 -> 20 MHz
  15616. * b01 -> 40 MHz
  15617. * b10 -> 80 MHz
  15618. * b11 -> 160 MHz (or 80+80)
  15619. * @sg : SGI enabled
  15620. * @s : skipped ratectrl
  15621. * @peer_id : peer id
  15622. * @tx_success_msdus : successful MSDUs
  15623. * @tx_retry_msdus : retried MSDUs
  15624. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15625. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15626. */
  15627. /**
  15628. * @brief target -> host backpressure event
  15629. *
  15630. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15631. *
  15632. * @details
  15633. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15634. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15635. * This message will only be sent if the backpressure condition has existed
  15636. * continuously for an initial period (100 ms).
  15637. * Repeat messages with updated information will be sent after each
  15638. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15639. * This message indicates the ring id along with current head and tail index
  15640. * locations (i.e. write and read indices).
  15641. * The backpressure time indicates the time in ms for which continous
  15642. * backpressure has been observed in the ring.
  15643. *
  15644. * The message format is as follows:
  15645. *
  15646. * |31 24|23 16|15 8|7 0|
  15647. * |----------------+----------------+----------------+----------------|
  15648. * | ring_id | ring_type | pdev_id | msg_type |
  15649. * |-------------------------------------------------------------------|
  15650. * | tail_idx | head_idx |
  15651. * |-------------------------------------------------------------------|
  15652. * | backpressure_time_ms |
  15653. * |-------------------------------------------------------------------|
  15654. *
  15655. * The message is interpreted as follows:
  15656. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15657. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15658. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15659. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15660. the msg is for LMAC ring.
  15661. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15662. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15663. * htt_backpressure_lmac_ring_id. This represents
  15664. * the ring id for which continous backpressure is seen
  15665. *
  15666. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15667. * the ring indicated by the ring_id
  15668. *
  15669. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15670. * the ring indicated by the ring id
  15671. *
  15672. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15673. * backpressure has been seen in the ring
  15674. * indicated by the ring_id.
  15675. * Units = milliseconds
  15676. */
  15677. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15678. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15679. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15680. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15681. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15682. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15683. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15684. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15685. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15686. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15687. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15688. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15689. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15690. do { \
  15691. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15692. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15693. } while (0)
  15694. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15695. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15696. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15697. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15698. do { \
  15699. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15700. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15701. } while (0)
  15702. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15703. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15704. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15705. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15706. do { \
  15707. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15708. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15709. } while (0)
  15710. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15711. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15712. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15713. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15714. do { \
  15715. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15716. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15717. } while (0)
  15718. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15719. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15720. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15721. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15722. do { \
  15723. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15724. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15725. } while (0)
  15726. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15727. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15728. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15729. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15730. do { \
  15731. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15732. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15733. } while (0)
  15734. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15735. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15736. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15737. enum htt_backpressure_ring_type {
  15738. HTT_SW_RING_TYPE_UMAC,
  15739. HTT_SW_RING_TYPE_LMAC,
  15740. HTT_SW_RING_TYPE_MAX,
  15741. };
  15742. /* Ring id for which the message is sent to host */
  15743. enum htt_backpressure_umac_ringid {
  15744. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15745. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15746. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15747. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15748. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15749. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15750. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15751. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15752. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15753. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15754. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15755. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15756. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15757. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15758. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15759. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15760. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15761. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15762. HTT_SW_UMAC_RING_IDX_MAX,
  15763. };
  15764. enum htt_backpressure_lmac_ringid {
  15765. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15766. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15767. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15768. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15769. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15770. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15771. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15772. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15773. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15774. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15775. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15776. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15777. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15778. HTT_SW_LMAC_RING_IDX_MAX,
  15779. };
  15780. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15781. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15782. pdev_id: 8,
  15783. ring_type: 8, /* htt_backpressure_ring_type */
  15784. /*
  15785. * ring_id holds an enum value from either
  15786. * htt_backpressure_umac_ringid or
  15787. * htt_backpressure_lmac_ringid, based on
  15788. * the ring_type setting.
  15789. */
  15790. ring_id: 8;
  15791. A_UINT16 head_idx;
  15792. A_UINT16 tail_idx;
  15793. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15794. } POSTPACK;
  15795. /*
  15796. * Defines two 32 bit words that can be used by the target to indicate a per
  15797. * user RU allocation and rate information.
  15798. *
  15799. * This information is currently provided in the "sw_response_reference_ptr"
  15800. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15801. * "rx_ppdu_end_user_stats" TLV.
  15802. *
  15803. * VALID:
  15804. * The consumer of these words must explicitly check the valid bit,
  15805. * and only attempt interpretation of any of the remaining fields if
  15806. * the valid bit is set to 1.
  15807. *
  15808. * VERSION:
  15809. * The consumer of these words must also explicitly check the version bit,
  15810. * and only use the V0 definition if the VERSION field is set to 0.
  15811. *
  15812. * Version 1 is currently undefined, with the exception of the VALID and
  15813. * VERSION fields.
  15814. *
  15815. * Version 0:
  15816. *
  15817. * The fields below are duplicated per BW.
  15818. *
  15819. * The consumer must determine which BW field to use, based on the UL OFDMA
  15820. * PPDU BW indicated by HW.
  15821. *
  15822. * RU_START: RU26 start index for the user.
  15823. * Note that this is always using the RU26 index, regardless
  15824. * of the actual RU assigned to the user
  15825. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15826. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15827. *
  15828. * For example, 20MHz (the value in the top row is RU_START)
  15829. *
  15830. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15831. * RU Size 1 (52): | | | | | |
  15832. * RU Size 2 (106): | | | |
  15833. * RU Size 3 (242): | |
  15834. *
  15835. * RU_SIZE: Indicates the RU size, as defined by enum
  15836. * htt_ul_ofdma_user_info_ru_size.
  15837. *
  15838. * LDPC: LDPC enabled (if 0, BCC is used)
  15839. *
  15840. * DCM: DCM enabled
  15841. *
  15842. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15843. * |---------------------------------+--------------------------------|
  15844. * |Ver|Valid| FW internal |
  15845. * |---------------------------------+--------------------------------|
  15846. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15847. * |---------------------------------+--------------------------------|
  15848. */
  15849. enum htt_ul_ofdma_user_info_ru_size {
  15850. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15851. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15852. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15853. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15854. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15855. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15856. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15857. };
  15858. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15859. struct htt_ul_ofdma_user_info_v0 {
  15860. A_UINT32 word0;
  15861. A_UINT32 word1;
  15862. };
  15863. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15864. A_UINT32 w0_fw_rsvd:30; \
  15865. A_UINT32 w0_valid:1; \
  15866. A_UINT32 w0_version:1;
  15867. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15868. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15869. };
  15870. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15871. A_UINT32 w1_nss:3; \
  15872. A_UINT32 w1_mcs:4; \
  15873. A_UINT32 w1_ldpc:1; \
  15874. A_UINT32 w1_dcm:1; \
  15875. A_UINT32 w1_ru_start:7; \
  15876. A_UINT32 w1_ru_size:3; \
  15877. A_UINT32 w1_trig_type:4; \
  15878. A_UINT32 w1_unused:9;
  15879. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15880. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15881. };
  15882. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15883. A_UINT32 w0_fw_rsvd:27; \
  15884. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15885. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15886. 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) */
  15887. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15888. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15889. };
  15890. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15891. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15892. A_UINT32 w1_trig_type:4; \
  15893. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15894. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15895. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15896. };
  15897. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15898. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15899. union {
  15900. A_UINT32 word0;
  15901. struct {
  15902. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15903. };
  15904. };
  15905. union {
  15906. A_UINT32 word1;
  15907. struct {
  15908. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15909. };
  15910. };
  15911. } POSTPACK;
  15912. /*
  15913. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15914. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15915. * this should be picked.
  15916. */
  15917. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15918. union {
  15919. A_UINT32 word0;
  15920. struct {
  15921. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15922. };
  15923. };
  15924. union {
  15925. A_UINT32 word1;
  15926. struct {
  15927. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15928. };
  15929. };
  15930. } POSTPACK;
  15931. enum HTT_UL_OFDMA_TRIG_TYPE {
  15932. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15933. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15934. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15935. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15936. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15937. };
  15938. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15939. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15940. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15941. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15942. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15943. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15944. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15945. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15946. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15947. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15948. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15949. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15950. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15951. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15952. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15953. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15954. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15955. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15956. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15957. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15958. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15959. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15960. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15961. /*--- word 0 ---*/
  15962. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15963. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15964. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15965. do { \
  15966. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15967. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15968. } while (0)
  15969. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15970. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15971. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15972. do { \
  15973. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15974. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15975. } while (0)
  15976. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15977. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15978. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15979. do { \
  15980. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15981. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15982. } while (0)
  15983. /*--- word 1 ---*/
  15984. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15985. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15986. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15987. do { \
  15988. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15989. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15990. } while (0)
  15991. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15992. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15993. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15994. do { \
  15995. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15996. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15997. } while (0)
  15998. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15999. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16000. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16001. do { \
  16002. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16003. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16004. } while (0)
  16005. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16006. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16007. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16008. do { \
  16009. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16010. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16011. } while (0)
  16012. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16013. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16014. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16015. do { \
  16016. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16017. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16018. } while (0)
  16019. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16020. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16021. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16022. do { \
  16023. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16024. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16025. } while (0)
  16026. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16027. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16028. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16029. do { \
  16030. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16031. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16032. } while (0)
  16033. /**
  16034. * @brief target -> host channel calibration data message
  16035. *
  16036. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16037. *
  16038. * @brief host -> target channel calibration data message
  16039. *
  16040. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16041. *
  16042. * @details
  16043. * The following field definitions describe the format of the channel
  16044. * calibration data message sent from the target to the host when
  16045. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16046. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16047. * The message is defined as htt_chan_caldata_msg followed by a variable
  16048. * number of 32-bit character values.
  16049. *
  16050. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16051. * |------------------------------------------------------------------|
  16052. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16053. * |------------------------------------------------------------------|
  16054. * | payload size | mhz |
  16055. * |------------------------------------------------------------------|
  16056. * | center frequency 2 | center frequency 1 |
  16057. * |------------------------------------------------------------------|
  16058. * | check sum |
  16059. * |------------------------------------------------------------------|
  16060. * | payload |
  16061. * |------------------------------------------------------------------|
  16062. * message info field:
  16063. * - MSG_TYPE
  16064. * Bits 7:0
  16065. * Purpose: identifies this as a channel calibration data message
  16066. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16067. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16068. * - SUB_TYPE
  16069. * Bits 11:8
  16070. * Purpose: T2H: indicates whether target is providing chan cal data
  16071. * to the host to store, or requesting that the host
  16072. * download previously-stored data.
  16073. * H2T: indicates whether the host is providing the requested
  16074. * channel cal data, or if it is rejecting the data
  16075. * request because it does not have the requested data.
  16076. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16077. * - CHKSUM_VALID
  16078. * Bit 12
  16079. * Purpose: indicates if the checksum field is valid
  16080. * value:
  16081. * - FRAG
  16082. * Bit 19:16
  16083. * Purpose: indicates the fragment index for message
  16084. * value: 0 for first fragment, 1 for second fragment, ...
  16085. * - APPEND
  16086. * Bit 20
  16087. * Purpose: indicates if this is the last fragment
  16088. * value: 0 = final fragment, 1 = more fragments will be appended
  16089. *
  16090. * channel and payload size field
  16091. * - MHZ
  16092. * Bits 15:0
  16093. * Purpose: indicates the channel primary frequency
  16094. * Value:
  16095. * - PAYLOAD_SIZE
  16096. * Bits 31:16
  16097. * Purpose: indicates the bytes of calibration data in payload
  16098. * Value:
  16099. *
  16100. * center frequency field
  16101. * - CENTER FREQUENCY 1
  16102. * Bits 15:0
  16103. * Purpose: indicates the channel center frequency
  16104. * Value: channel center frequency, in MHz units
  16105. * - CENTER FREQUENCY 2
  16106. * Bits 31:16
  16107. * Purpose: indicates the secondary channel center frequency,
  16108. * only for 11acvht 80plus80 mode
  16109. * Value: secondary channel center frequeny, in MHz units, if applicable
  16110. *
  16111. * checksum field
  16112. * - CHECK_SUM
  16113. * Bits 31:0
  16114. * Purpose: check the payload data, it is just for this fragment.
  16115. * This is intended for the target to check that the channel
  16116. * calibration data returned by the host is the unmodified data
  16117. * that was previously provided to the host by the target.
  16118. * value: checksum of fragment payload
  16119. */
  16120. PREPACK struct htt_chan_caldata_msg {
  16121. /* DWORD 0: message info */
  16122. A_UINT32
  16123. msg_type: 8,
  16124. sub_type: 4 ,
  16125. chksum_valid: 1, /** 1:valid, 0:invalid */
  16126. reserved1: 3,
  16127. frag_idx: 4, /** fragment index for calibration data */
  16128. appending: 1, /** 0: no fragment appending,
  16129. * 1: extra fragment appending */
  16130. reserved2: 11;
  16131. /* DWORD 1: channel and payload size */
  16132. A_UINT32
  16133. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16134. payload_size: 16; /** unit: bytes */
  16135. /* DWORD 2: center frequency */
  16136. A_UINT32
  16137. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16138. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16139. * valid only for 11acvht 80plus80 mode */
  16140. /* DWORD 3: check sum */
  16141. A_UINT32 chksum;
  16142. /* variable length for calibration data */
  16143. A_UINT32 payload[1/* or more */];
  16144. } POSTPACK;
  16145. /* T2H SUBTYPE */
  16146. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16147. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16148. /* H2T SUBTYPE */
  16149. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16150. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16151. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16152. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16153. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16154. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16155. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16156. do { \
  16157. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16158. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16159. } while (0)
  16160. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16161. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16162. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16163. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16164. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16165. do { \
  16166. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16167. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16168. } while (0)
  16169. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16170. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16171. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16172. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16173. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16174. do { \
  16175. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16176. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16177. } while (0)
  16178. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16179. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16180. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16181. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16182. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16183. do { \
  16184. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16185. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16186. } while (0)
  16187. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16188. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16189. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16190. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16191. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16192. do { \
  16193. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16194. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16195. } while (0)
  16196. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16197. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16198. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16199. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16200. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16201. do { \
  16202. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16203. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16204. } while (0)
  16205. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16206. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16207. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16208. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16209. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16210. do { \
  16211. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16212. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16213. } while (0)
  16214. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16215. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16216. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16217. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16218. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16219. do { \
  16220. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16221. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16222. } while (0)
  16223. /**
  16224. * @brief target -> host FSE CMEM based send
  16225. *
  16226. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16227. *
  16228. * @details
  16229. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16230. * FSE placement in CMEM is enabled.
  16231. *
  16232. * This message sends the non-secure CMEM base address.
  16233. * It will be sent to host in response to message
  16234. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16235. * The message would appear as follows:
  16236. *
  16237. * |31 24|23 16|15 8|7 0|
  16238. * |----------------+----------------+----------------+----------------|
  16239. * | reserved | num_entries | msg_type |
  16240. * |----------------+----------------+----------------+----------------|
  16241. * | base_address_lo |
  16242. * |----------------+----------------+----------------+----------------|
  16243. * | base_address_hi |
  16244. * |-------------------------------------------------------------------|
  16245. *
  16246. * The message is interpreted as follows:
  16247. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16248. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16249. * b'8:15 - number_entries: Indicated the number of entries
  16250. * programmed.
  16251. * b'16:31 - reserved.
  16252. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16253. * CMEM base address
  16254. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16255. * CMEM base address
  16256. */
  16257. PREPACK struct htt_cmem_base_send_t {
  16258. A_UINT32 msg_type: 8,
  16259. num_entries: 8,
  16260. reserved: 16;
  16261. A_UINT32 base_address_lo;
  16262. A_UINT32 base_address_hi;
  16263. } POSTPACK;
  16264. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16265. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16266. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16267. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16268. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16269. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16270. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16271. do { \
  16272. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16273. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16274. } while (0)
  16275. /**
  16276. * @brief - HTT PPDU ID format
  16277. *
  16278. * @details
  16279. * The following field definitions describe the format of the PPDU ID.
  16280. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16281. *
  16282. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16283. * +--------------------------------------------------------------------------
  16284. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16285. * +--------------------------------------------------------------------------
  16286. *
  16287. * sch id :Schedule command id
  16288. * Bits [11 : 0] : monotonically increasing counter to track the
  16289. * PPDU posted to a specific transmit queue.
  16290. *
  16291. * hwq_id: Hardware Queue ID.
  16292. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16293. *
  16294. * mac_id: MAC ID
  16295. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16296. *
  16297. * seq_idx: Sequence index.
  16298. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16299. * a particular TXOP.
  16300. *
  16301. * tqm_cmd: HWSCH/TQM flag.
  16302. * Bit [23] : Always set to 0.
  16303. *
  16304. * seq_cmd_type: Sequence command type.
  16305. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16306. * Refer to enum HTT_STATS_FTYPE for values.
  16307. */
  16308. PREPACK struct htt_ppdu_id {
  16309. A_UINT32
  16310. sch_id: 12,
  16311. hwq_id: 5,
  16312. mac_id: 2,
  16313. seq_idx: 2,
  16314. reserved1: 2,
  16315. tqm_cmd: 1,
  16316. seq_cmd_type: 6,
  16317. reserved2: 2;
  16318. } POSTPACK;
  16319. #define HTT_PPDU_ID_SCH_ID_S 0
  16320. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16321. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16322. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16323. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16324. do { \
  16325. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16326. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16327. } while (0)
  16328. #define HTT_PPDU_ID_HWQ_ID_S 12
  16329. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16330. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16331. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16332. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16333. do { \
  16334. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16335. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16336. } while (0)
  16337. #define HTT_PPDU_ID_MAC_ID_S 17
  16338. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16339. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16340. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16341. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16342. do { \
  16343. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16344. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16345. } while (0)
  16346. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16347. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16348. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16349. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16350. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16351. do { \
  16352. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16353. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16354. } while (0)
  16355. #define HTT_PPDU_ID_TQM_CMD_S 23
  16356. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16357. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16358. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16359. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16360. do { \
  16361. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16362. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16363. } while (0)
  16364. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16365. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16366. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16367. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16368. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16369. do { \
  16370. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16371. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16372. } while (0)
  16373. /**
  16374. * @brief target -> RX PEER METADATA V0 format
  16375. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16376. * message from target, and will confirm to the target which peer metadata
  16377. * version to use in the wmi_init message.
  16378. *
  16379. * The following diagram shows the format of the RX PEER METADATA.
  16380. *
  16381. * |31 24|23 16|15 8|7 0|
  16382. * |-----------------------------------------------------------------------|
  16383. * | Reserved | VDEV ID | PEER ID |
  16384. * |-----------------------------------------------------------------------|
  16385. */
  16386. PREPACK struct htt_rx_peer_metadata_v0 {
  16387. A_UINT32
  16388. peer_id: 16,
  16389. vdev_id: 8,
  16390. reserved1: 8;
  16391. } POSTPACK;
  16392. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16393. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16394. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16395. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16396. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16397. do { \
  16398. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16399. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16400. } while (0)
  16401. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16402. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16403. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16404. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16405. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16406. do { \
  16407. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16408. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16409. } while (0)
  16410. /**
  16411. * @brief target -> RX PEER METADATA V1 format
  16412. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16413. * message from target, and will confirm to the target which peer metadata
  16414. * version to use in the wmi_init message.
  16415. *
  16416. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16417. *
  16418. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16419. * |-----------------------------------------------------------------------|
  16420. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16421. * |-----------------------------------------------------------------------|
  16422. */
  16423. PREPACK struct htt_rx_peer_metadata_v1 {
  16424. A_UINT32
  16425. peer_id: 13,
  16426. ml_peer_valid: 1,
  16427. reserved1: 2,
  16428. vdev_id: 8,
  16429. lmac_id: 2,
  16430. chip_id: 3,
  16431. reserved2: 3;
  16432. } POSTPACK;
  16433. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16434. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16435. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16436. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16437. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16438. do { \
  16439. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16440. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16441. } while (0)
  16442. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16443. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16444. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16445. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16446. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16447. do { \
  16448. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16449. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16450. } while (0)
  16451. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16452. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16453. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16454. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16455. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16456. do { \
  16457. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16458. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16459. } while (0)
  16460. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16461. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16462. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16463. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16464. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16465. do { \
  16466. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16467. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16468. } while (0)
  16469. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16470. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16471. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16472. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16473. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16474. do { \
  16475. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16476. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16477. } while (0)
  16478. /*
  16479. * In some systems, the host SW wants to specify priorities between
  16480. * different MSDU / flow queues within the same peer-TID.
  16481. * The below enums are used for the host to identify to the target
  16482. * which MSDU queue's priority it wants to adjust.
  16483. */
  16484. /*
  16485. * The MSDUQ index describe index of TCL HW, where each index is
  16486. * used for queuing particular types of MSDUs.
  16487. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16488. */
  16489. enum HTT_MSDUQ_INDEX {
  16490. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16491. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16492. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16493. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16494. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16495. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16496. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16497. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16498. HTT_MSDUQ_MAX_INDEX,
  16499. };
  16500. /* MSDU qtype definition */
  16501. enum HTT_MSDU_QTYPE {
  16502. /*
  16503. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16504. * relative priority. Instead, the relative priority of CRIT_0 versus
  16505. * CRIT_1 is controlled by the FW, through the configuration parameters
  16506. * it applies to the queues.
  16507. */
  16508. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16509. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16510. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16511. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16512. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16513. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16514. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16515. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16516. /* New MSDU_QTYPE should be added above this line */
  16517. /*
  16518. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16519. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16520. * any host/target message definitions. The QTYPE_MAX value can
  16521. * only be used internally within the host or within the target.
  16522. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16523. * it must regard the unexpected value as a default qtype value,
  16524. * or ignore it.
  16525. */
  16526. HTT_MSDU_QTYPE_MAX,
  16527. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16528. };
  16529. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16530. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16531. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16532. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16533. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16534. };
  16535. /**
  16536. * @brief target -> host mlo timestamp offset indication
  16537. *
  16538. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16539. *
  16540. * @details
  16541. * The following field definitions describe the format of the HTT target
  16542. * to host mlo timestamp offset indication message.
  16543. *
  16544. *
  16545. * |31 16|15 12|11 10|9 8|7 0 |
  16546. * |----------------------------------------------------------------------|
  16547. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16548. * |----------------------------------------------------------------------|
  16549. * | Sync time stamp lo in us |
  16550. * |----------------------------------------------------------------------|
  16551. * | Sync time stamp hi in us |
  16552. * |----------------------------------------------------------------------|
  16553. * | mlo time stamp offset lo in us |
  16554. * |----------------------------------------------------------------------|
  16555. * | mlo time stamp offset hi in us |
  16556. * |----------------------------------------------------------------------|
  16557. * | mlo time stamp offset clocks in clock ticks |
  16558. * |----------------------------------------------------------------------|
  16559. * |31 26|25 16|15 0 |
  16560. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16561. * | | compensation in clks | |
  16562. * |----------------------------------------------------------------------|
  16563. * |31 22|21 0 |
  16564. * | rsvd 3 | mlo time stamp comp timer period |
  16565. * |----------------------------------------------------------------------|
  16566. * The message is interpreted as follows:
  16567. *
  16568. * dword0 - b'0:7 - msg_type: This will be set to
  16569. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16570. * value: 0x28
  16571. *
  16572. * dword0 - b'9:8 - pdev_id
  16573. *
  16574. * dword0 - b'11:10 - chip_id
  16575. *
  16576. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16577. *
  16578. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16579. *
  16580. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16581. * which last sync interrupt was received
  16582. *
  16583. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16584. * which last sync interrupt was received
  16585. *
  16586. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16587. *
  16588. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16589. *
  16590. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16591. *
  16592. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16593. *
  16594. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16595. * for sub us resolution
  16596. *
  16597. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16598. *
  16599. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16600. * is applied, in us
  16601. *
  16602. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16603. */
  16604. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16605. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16606. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16607. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16608. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16609. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16610. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16611. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16612. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16613. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16614. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16615. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16616. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16617. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16618. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16619. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16620. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16621. do { \
  16622. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16623. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16624. } while (0)
  16625. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16626. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16627. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16628. do { \
  16629. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16630. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16631. } while (0)
  16632. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16633. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16634. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16635. do { \
  16636. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16637. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16638. } while (0)
  16639. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16640. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16641. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16642. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16643. do { \
  16644. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16645. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16646. } while (0)
  16647. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16648. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16649. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16650. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16651. do { \
  16652. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16653. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16654. } while (0)
  16655. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16656. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16657. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16658. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16659. do { \
  16660. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16661. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16662. } while (0)
  16663. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16664. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16665. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16666. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16667. do { \
  16668. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16669. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16670. } while (0)
  16671. typedef struct {
  16672. A_UINT32 msg_type: 8, /* bits 7:0 */
  16673. pdev_id: 2, /* bits 9:8 */
  16674. chip_id: 2, /* bits 11:10 */
  16675. reserved1: 4, /* bits 15:12 */
  16676. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16677. A_UINT32 sync_timestamp_lo_us;
  16678. A_UINT32 sync_timestamp_hi_us;
  16679. A_UINT32 mlo_timestamp_offset_lo_us;
  16680. A_UINT32 mlo_timestamp_offset_hi_us;
  16681. A_UINT32 mlo_timestamp_offset_clks;
  16682. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16683. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16684. reserved2: 6; /* bits 31:26 */
  16685. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16686. reserved3: 10; /* bits 31:22 */
  16687. } htt_t2h_mlo_offset_ind_t;
  16688. /*
  16689. * @brief target -> host VDEV TX RX STATS
  16690. *
  16691. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16692. *
  16693. * @details
  16694. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16695. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16696. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16697. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16698. * periodically by target even in the absence of any further HTT request
  16699. * messages from host.
  16700. *
  16701. * The message is formatted as follows:
  16702. *
  16703. * |31 16|15 8|7 0|
  16704. * |---------------------------------+----------------+----------------|
  16705. * | payload_size | pdev_id | msg_type |
  16706. * |---------------------------------+----------------+----------------|
  16707. * | reserved0 |
  16708. * |-------------------------------------------------------------------|
  16709. * | reserved1 |
  16710. * |-------------------------------------------------------------------|
  16711. * | reserved2 |
  16712. * |-------------------------------------------------------------------|
  16713. * | |
  16714. * | VDEV specific Tx Rx stats info |
  16715. * | |
  16716. * |-------------------------------------------------------------------|
  16717. *
  16718. * The message is interpreted as follows:
  16719. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16720. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16721. * b'8:15 - pdev_id
  16722. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16723. * message header fields (msg_type through reserved2)
  16724. * dword1 - b'0:31 - reserved0.
  16725. * dword2 - b'0:31 - reserved1.
  16726. * dword3 - b'0:31 - reserved2.
  16727. */
  16728. typedef struct {
  16729. A_UINT32 msg_type: 8,
  16730. pdev_id: 8,
  16731. payload_size: 16;
  16732. A_UINT32 reserved0;
  16733. A_UINT32 reserved1;
  16734. A_UINT32 reserved2;
  16735. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16736. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16737. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16738. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16739. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16740. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16741. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16742. do { \
  16743. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16744. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16745. } while (0)
  16746. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16747. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16748. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16749. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16750. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16751. do { \
  16752. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16753. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16754. } while (0)
  16755. /* SOC related stats */
  16756. typedef struct {
  16757. htt_tlv_hdr_t tlv_hdr;
  16758. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16759. * This can be due to either the peer is deleted or deletion is ongoing
  16760. * */
  16761. A_UINT32 inv_peers_msdu_drop_count_lo;
  16762. A_UINT32 inv_peers_msdu_drop_count_hi;
  16763. } htt_t2h_soc_txrx_stats_common_tlv;
  16764. /* VDEV HW Tx/Rx stats */
  16765. typedef struct {
  16766. htt_tlv_hdr_t tlv_hdr;
  16767. A_UINT32 vdev_id;
  16768. /* Rx msdu byte cnt */
  16769. A_UINT32 rx_msdu_byte_cnt_lo;
  16770. A_UINT32 rx_msdu_byte_cnt_hi;
  16771. /* Rx msdu cnt */
  16772. A_UINT32 rx_msdu_cnt_lo;
  16773. A_UINT32 rx_msdu_cnt_hi;
  16774. /* tx msdu byte cnt */
  16775. A_UINT32 tx_msdu_byte_cnt_lo;
  16776. A_UINT32 tx_msdu_byte_cnt_hi;
  16777. /* tx msdu cnt */
  16778. A_UINT32 tx_msdu_cnt_lo;
  16779. A_UINT32 tx_msdu_cnt_hi;
  16780. /* tx excessive retry discarded msdu cnt */
  16781. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16782. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16783. /* TX congestion ctrl msdu drop cnt */
  16784. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16785. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16786. /* discarded tx msdus cnt coz of time to live expiry */
  16787. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16788. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16789. /* tx excessive retry discarded msdu byte cnt */
  16790. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16791. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16792. /* TX congestion ctrl msdu drop byte cnt */
  16793. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16794. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16795. /* discarded tx msdus byte cnt coz of time to live expiry */
  16796. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16797. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16798. /* TQM bypass frame cnt */
  16799. A_UINT32 tqm_bypass_frame_cnt_lo;
  16800. A_UINT32 tqm_bypass_frame_cnt_hi;
  16801. /* TQM bypass byte cnt */
  16802. A_UINT32 tqm_bypass_byte_cnt_lo;
  16803. A_UINT32 tqm_bypass_byte_cnt_hi;
  16804. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16805. /*
  16806. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16807. *
  16808. * @details
  16809. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16810. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16811. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16812. * the default MSDU queues of each of the specified TIDs for the peer
  16813. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16814. * If the default MSDU queues of a given TID within the peer are not linked
  16815. * to a service class, the svc_class_id field for that TID will have a
  16816. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16817. * queues for that TID are not mapped to any service class.
  16818. *
  16819. * |31 16|15 8|7 0|
  16820. * |------------------------------+--------------+--------------|
  16821. * | peer ID | reserved | msg type |
  16822. * |------------------------------+--------------+------+-------|
  16823. * | reserved | svc class ID | TID |
  16824. * |------------------------------------------------------------|
  16825. * ...
  16826. * |------------------------------------------------------------|
  16827. * | reserved | svc class ID | TID |
  16828. * |------------------------------------------------------------|
  16829. * Header fields:
  16830. * dword0 - b'7:0 - msg_type: This will be set to
  16831. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16832. * b'31:16 - peer ID
  16833. * dword1 - b'7:0 - TID
  16834. * b'15:8 - svc class ID
  16835. * (dword2, etc. same format as dword1)
  16836. */
  16837. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16838. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16839. A_UINT32 msg_type :8,
  16840. reserved0 :8,
  16841. peer_id :16;
  16842. struct {
  16843. A_UINT32 tid :8,
  16844. svc_class_id :8,
  16845. reserved1 :16;
  16846. } tid_reports[1/*or more*/];
  16847. } POSTPACK;
  16848. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16849. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16850. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16851. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16852. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16853. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16854. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16855. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16856. do { \
  16857. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16858. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16859. } while (0)
  16860. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16861. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16862. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16863. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16864. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16865. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16866. do { \
  16867. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16868. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16869. } while (0)
  16870. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16871. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16872. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16873. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16874. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16875. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16876. do { \
  16877. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16878. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16879. } while (0)
  16880. /*
  16881. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16882. *
  16883. * @details
  16884. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16885. * flow if the flow is seen the associated service class is conveyed to the
  16886. * target via TCL Data Command. Target on the other hand internally creates the
  16887. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16888. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16889. * the newly created MSDUQ
  16890. *
  16891. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16892. * |------------------------------+------------------------+--------------|
  16893. * | peer ID | HTT qtype | msg type |
  16894. * |---------------------------------+--------------+--+---+-------+------|
  16895. * | reserved |AST list index|FO|WC | HLOS | remap|
  16896. * | | | | | TID | TID |
  16897. * |---------------------+------------------------------------------------|
  16898. * | reserved1 | tgt_opaque_id |
  16899. * |---------------------+------------------------------------------------|
  16900. *
  16901. * Header fields:
  16902. *
  16903. * dword0 - b'7:0 - msg_type: This will be set to
  16904. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16905. * b'15:8 - HTT qtype
  16906. * b'31:16 - peer ID
  16907. *
  16908. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16909. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16910. * hlos_tid : Common to Lithium and Beryllium
  16911. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16912. * TCL Data Command : Beryllium
  16913. * b10 - flow_override (FO), as sent by host in
  16914. * TCL Data Command: Beryllium
  16915. * b11:14 - ast_list_idx
  16916. * Array index into the list of extension AST entries
  16917. * (not the actual AST 16-bit index).
  16918. * The ast_list_idx is one-based, with the following
  16919. * range of values:
  16920. * - legacy targets supporting 16 user-defined
  16921. * MSDU queues: 1-2
  16922. * - legacy targets supporting 48 user-defined
  16923. * MSDU queues: 1-6
  16924. * - new targets: 0 (peer_id is used instead)
  16925. * Note that since ast_list_idx is one-based,
  16926. * the host will need to subtract 1 to use it as an
  16927. * index into a list of extension AST entries.
  16928. * b15:31 - reserved
  16929. *
  16930. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16931. * unique MSDUQ id in firmware
  16932. * b'24:31 - reserved1
  16933. */
  16934. PREPACK struct htt_t2h_sawf_msduq_event {
  16935. A_UINT32 msg_type : 8,
  16936. htt_qtype : 8,
  16937. peer_id :16;
  16938. A_UINT32 remap_tid : 4,
  16939. hlos_tid : 4,
  16940. who_classify_info_sel : 2,
  16941. flow_override : 1,
  16942. ast_list_idx : 4,
  16943. reserved :17;
  16944. A_UINT32 tgt_opaque_id :24,
  16945. reserved1 : 8;
  16946. } POSTPACK;
  16947. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16948. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16949. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16950. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16951. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16952. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16953. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16954. do { \
  16955. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16956. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16957. } while (0)
  16958. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16959. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16960. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16961. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16962. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16963. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16964. do { \
  16965. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16966. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16967. } while (0)
  16968. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16969. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16970. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16971. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16972. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16973. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16974. do { \
  16975. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16976. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16977. } while (0)
  16978. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16979. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16980. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16981. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16982. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16983. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16984. do { \
  16985. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16986. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16987. } while (0)
  16988. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16989. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16990. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16991. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16992. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16993. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16994. do { \
  16995. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16996. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16997. } while (0)
  16998. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16999. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17000. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17001. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17002. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17003. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17004. do { \
  17005. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17006. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17007. } while (0)
  17008. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17009. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17010. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17011. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17012. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17013. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17014. do { \
  17015. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17016. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17017. } while (0)
  17018. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17019. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17020. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17021. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17022. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17023. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17024. do { \
  17025. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17026. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17027. } while (0)
  17028. /**
  17029. * @brief target -> PPDU id format indication
  17030. *
  17031. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17032. *
  17033. * @details
  17034. * The following field definitions describe the format of the HTT target
  17035. * to host PPDU ID format indication message.
  17036. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17037. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17038. * seq_idx :- Sequence control index of this PPDU.
  17039. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17040. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17041. * tqm_cmd:-
  17042. *
  17043. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17044. * |--------------------------------------------------+------------------------|
  17045. * | rsvd0 | msg type |
  17046. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17047. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17048. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17049. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17050. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17051. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17052. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17053. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17054. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17055. * Where: OF = bit offset, NB = number of bits, V = valid
  17056. * The message is interpreted as follows:
  17057. *
  17058. * dword0 - b'7:0 - msg_type: This will be set to
  17059. * HTT_T2H_PPDU_ID_FMT_IND
  17060. * value: 0x30
  17061. *
  17062. * dword0 - b'31:8 - reserved
  17063. *
  17064. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17065. *
  17066. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17067. *
  17068. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17069. *
  17070. * dword1 - b'15:11 - reserved for future use
  17071. *
  17072. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17073. *
  17074. * dword1 - b'21:17 - number of bits in ring_id
  17075. *
  17076. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17077. *
  17078. * dword1 - b'31:27 - reserved for future use
  17079. *
  17080. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17081. *
  17082. * dword2 - b'5:1 - number of bits in sequence index
  17083. *
  17084. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17085. *
  17086. * dword2 - b'15:11 - reserved for future use
  17087. *
  17088. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17089. *
  17090. * dword2 - b'21:17 - number of bits in link_id
  17091. *
  17092. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17093. *
  17094. * dword2 - b'31:27 - reserved for future use
  17095. *
  17096. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17097. *
  17098. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17099. *
  17100. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17101. *
  17102. * dword3 - b'15:11 - reserved for future use
  17103. *
  17104. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17105. *
  17106. * dword3 - b'21:17 - number of bits in tqm_cmd
  17107. *
  17108. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17109. *
  17110. * dword3 - b'31:27 - reserved for future use
  17111. *
  17112. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17113. *
  17114. * dword4 - b'5:1 - number of bits in mac_id
  17115. *
  17116. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17117. *
  17118. * dword4 - b'15:11 - reserved for future use
  17119. *
  17120. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17121. *
  17122. * dword4 - b'21:17 - number of bits in crc
  17123. *
  17124. * dword4 - b'26:22 - offset of crc (in number of bits)
  17125. *
  17126. * dword4 - b'31:27 - reserved for future use
  17127. *
  17128. */
  17129. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17130. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17131. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17132. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17133. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17134. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17135. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17136. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17137. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17138. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17139. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17140. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17141. /* macros for accessing lower 16 bits in dword */
  17142. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17143. do { \
  17144. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17145. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17146. } while (0)
  17147. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17148. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17149. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17150. do { \
  17151. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17152. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17153. } while (0)
  17154. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17155. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17156. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17157. do { \
  17158. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17159. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17160. } while (0)
  17161. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17162. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17163. /* macros for accessing upper 16 bits in dword */
  17164. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17165. do { \
  17166. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17167. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17168. } while (0)
  17169. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17170. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17171. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17172. do { \
  17173. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17174. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17175. } while (0)
  17176. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17177. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17178. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17179. do { \
  17180. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17181. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17182. } while (0)
  17183. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17184. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17185. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17186. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17187. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17188. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17189. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17190. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17191. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17192. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17193. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17194. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17195. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17196. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17197. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17198. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17199. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17200. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17201. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17202. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17203. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17204. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17205. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17206. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17207. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17208. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17209. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17210. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17211. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17212. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17213. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17214. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17215. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17216. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17217. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17218. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17219. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17220. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17221. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17222. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17223. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17224. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17225. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17226. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17227. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17228. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17229. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17230. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17231. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17232. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17233. /* offsets in number dwords */
  17234. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17235. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17236. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17237. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17238. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17239. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17240. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17241. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17242. typedef struct {
  17243. A_UINT32 msg_type: 8, /* bits 7:0 */
  17244. rsvd0: 24;/* bits 31:8 */
  17245. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17246. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17247. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17248. rsvd1: 5, /* bits 15:11 */
  17249. ring_id_valid: 1, /* bits 16:16 */
  17250. ring_id_bits: 5, /* bits 21:17 */
  17251. ring_id_offset: 5, /* bits 26:22 */
  17252. rsvd2: 5; /* bits 31:27 */
  17253. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17254. seq_idx_bits: 5, /* bits 5:1 */
  17255. seq_idx_offset: 5, /* bits 10:6 */
  17256. rsvd3: 5, /* bits 15:11 */
  17257. link_id_valid: 1, /* bits 16:16 */
  17258. link_id_bits: 5, /* bits 21:17 */
  17259. link_id_offset: 5, /* bits 26:22 */
  17260. rsvd4: 5; /* bits 31:27 */
  17261. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17262. seq_cmd_type_bits: 5, /* bits 5:1 */
  17263. seq_cmd_type_offset: 5, /* bits 10:6 */
  17264. rsvd5: 5, /* bits 15:11 */
  17265. tqm_cmd_valid: 1, /* bits 16:16 */
  17266. tqm_cmd_bits: 5, /* bits 21:17 */
  17267. tqm_cmd_offset: 5, /* bits 26:12 */
  17268. rsvd6: 5; /* bits 31:27 */
  17269. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17270. mac_id_bits: 5, /* bits 5:1 */
  17271. mac_id_offset: 5, /* bits 10:6 */
  17272. rsvd8: 5, /* bits 15:11 */
  17273. crc_valid: 1, /* bits 16:16 */
  17274. crc_bits: 5, /* bits 21:17 */
  17275. crc_offset: 5, /* bits 26:12 */
  17276. rsvd9: 5; /* bits 31:27 */
  17277. } htt_t2h_ppdu_id_fmt_ind_t;
  17278. #endif