htt.h 847 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416
  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. */
  227. #define HTT_CURRENT_VERSION_MAJOR 3
  228. #define HTT_CURRENT_VERSION_MINOR 105
  229. #define HTT_NUM_TX_FRAG_DESC 1024
  230. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  231. #define HTT_CHECK_SET_VAL(field, val) \
  232. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  233. /* macros to assist in sign-extending fields from HTT messages */
  234. #define HTT_SIGN_BIT_MASK(field) \
  235. ((field ## _M + (1 << field ## _S)) >> 1)
  236. #define HTT_SIGN_BIT(_val, field) \
  237. (_val & HTT_SIGN_BIT_MASK(field))
  238. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  239. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  240. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  241. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  242. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  243. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  244. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  245. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  246. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  247. /*
  248. * TEMPORARY:
  249. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  250. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  251. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  252. * updated.
  253. */
  254. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  255. /*
  256. * TEMPORARY:
  257. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  258. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  259. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  260. * updated.
  261. */
  262. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  263. /**
  264. * htt_dbg_stats_type -
  265. * bit positions for each stats type within a stats type bitmask
  266. * The bitmask contains 24 bits.
  267. */
  268. enum htt_dbg_stats_type {
  269. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  270. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  271. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  272. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  273. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  274. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  275. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  276. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  277. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  278. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  279. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  280. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  281. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  282. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  283. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  284. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  285. /* bits 16-23 currently reserved */
  286. /* keep this last */
  287. HTT_DBG_NUM_STATS
  288. };
  289. /*=== HTT option selection TLVs ===
  290. * Certain HTT messages have alternatives or options.
  291. * For such cases, the host and target need to agree on which option to use.
  292. * Option specification TLVs can be appended to the VERSION_REQ and
  293. * VERSION_CONF messages to select options other than the default.
  294. * These TLVs are entirely optional - if they are not provided, there is a
  295. * well-defined default for each option. If they are provided, they can be
  296. * provided in any order. Each TLV can be present or absent independent of
  297. * the presence / absence of other TLVs.
  298. *
  299. * The HTT option selection TLVs use the following format:
  300. * |31 16|15 8|7 0|
  301. * |---------------------------------+----------------+----------------|
  302. * | value (payload) | length | tag |
  303. * |-------------------------------------------------------------------|
  304. * The value portion need not be only 2 bytes; it can be extended by any
  305. * integer number of 4-byte units. The total length of the TLV, including
  306. * the tag and length fields, must be a multiple of 4 bytes. The length
  307. * field specifies the total TLV size in 4-byte units. Thus, the typical
  308. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  309. * field, would store 0x1 in its length field, to show that the TLV occupies
  310. * a single 4-byte unit.
  311. */
  312. /*--- TLV header format - applies to all HTT option TLVs ---*/
  313. enum HTT_OPTION_TLV_TAGS {
  314. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  315. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  316. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  317. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  318. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  319. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  320. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  321. };
  322. #define HTT_TCL_METADATA_VER_SZ 4
  323. PREPACK struct htt_option_tlv_header_t {
  324. A_UINT8 tag;
  325. A_UINT8 length;
  326. } POSTPACK;
  327. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  328. #define HTT_OPTION_TLV_TAG_S 0
  329. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  330. #define HTT_OPTION_TLV_LENGTH_S 8
  331. /*
  332. * value0 - 16 bit value field stored in word0
  333. * The TLV's value field may be longer than 2 bytes, in which case
  334. * the remainder of the value is stored in word1, word2, etc.
  335. */
  336. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  337. #define HTT_OPTION_TLV_VALUE0_S 16
  338. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  339. do { \
  340. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  341. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  342. } while (0)
  343. #define HTT_OPTION_TLV_TAG_GET(word) \
  344. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  345. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  346. do { \
  347. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  348. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  349. } while (0)
  350. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  351. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  352. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  353. do { \
  354. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  355. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  356. } while (0)
  357. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  358. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  359. /*--- format of specific HTT option TLVs ---*/
  360. /*
  361. * HTT option TLV for specifying LL bus address size
  362. * Some chips require bus addresses used by the target to access buffers
  363. * within the host's memory to be 32 bits; others require bus addresses
  364. * used by the target to access buffers within the host's memory to be
  365. * 64 bits.
  366. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  367. * a suffix to the VERSION_CONF message to specify which bus address format
  368. * the target requires.
  369. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  370. * default to providing bus addresses to the target in 32-bit format.
  371. */
  372. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  373. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  374. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  375. };
  376. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  377. struct htt_option_tlv_header_t hdr;
  378. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  379. } POSTPACK;
  380. /*
  381. * HTT option TLV for specifying whether HL systems should indicate
  382. * over-the-air tx completion for individual frames, or should instead
  383. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  384. * requests an OTA tx completion for a particular tx frame.
  385. * This option does not apply to LL systems, where the TX_COMPL_IND
  386. * is mandatory.
  387. * This option is primarily intended for HL systems in which the tx frame
  388. * downloads over the host --> target bus are as slow as or slower than
  389. * the transmissions over the WLAN PHY. For cases where the bus is faster
  390. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  391. * and consquently will send one TX_COMPL_IND message that covers several
  392. * tx frames. For cases where the WLAN PHY is faster than the bus,
  393. * the target will end up transmitting very short A-MPDUs, and consequently
  394. * sending many TX_COMPL_IND messages, which each cover a very small number
  395. * of tx frames.
  396. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  397. * a suffix to the VERSION_REQ message to request whether the host desires to
  398. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  399. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  400. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  401. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  402. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  403. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  404. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  405. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  406. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  407. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  408. * TLV.
  409. */
  410. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  411. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  412. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  413. };
  414. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  415. struct htt_option_tlv_header_t hdr;
  416. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  417. } POSTPACK;
  418. /*
  419. * HTT option TLV for specifying how many tx queue groups the target
  420. * may establish.
  421. * This TLV specifies the maximum value the target may send in the
  422. * txq_group_id field of any TXQ_GROUP information elements sent by
  423. * the target to the host. This allows the host to pre-allocate an
  424. * appropriate number of tx queue group structs.
  425. *
  426. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  427. * a suffix to the VERSION_REQ message to specify whether the host supports
  428. * tx queue groups at all, and if so if there is any limit on the number of
  429. * tx queue groups that the host supports.
  430. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  431. * a suffix to the VERSION_CONF message. If the host has specified in the
  432. * VER_REQ message a limit on the number of tx queue groups the host can
  433. * supprt, the target shall limit its specification of the maximum tx groups
  434. * to be no larger than this host-specified limit.
  435. *
  436. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  437. * shall preallocate 4 tx queue group structs, and the target shall not
  438. * specify a txq_group_id larger than 3.
  439. */
  440. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  441. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  442. /*
  443. * values 1 through N specify the max number of tx queue groups
  444. * the sender supports
  445. */
  446. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  447. };
  448. /* TEMPORARY backwards-compatibility alias for a typo fix -
  449. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  450. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  451. * to support the old name (with the typo) until all references to the
  452. * old name are replaced with the new name.
  453. */
  454. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  455. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  456. struct htt_option_tlv_header_t hdr;
  457. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  458. } POSTPACK;
  459. /*
  460. * HTT option TLV for specifying whether the target supports an extended
  461. * version of the HTT tx descriptor. If the target provides this TLV
  462. * and specifies in the TLV that the target supports an extended version
  463. * of the HTT tx descriptor, the target must check the "extension" bit in
  464. * the HTT tx descriptor, and if the extension bit is set, to expect a
  465. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  466. * descriptor. Furthermore, the target must provide room for the HTT
  467. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  468. * This option is intended for systems where the host needs to explicitly
  469. * control the transmission parameters such as tx power for individual
  470. * tx frames.
  471. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  472. * as a suffix to the VERSION_CONF message to explicitly specify whether
  473. * the target supports the HTT tx MSDU extension descriptor.
  474. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  475. * by the host as lack of target support for the HTT tx MSDU extension
  476. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  477. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  478. * the HTT tx MSDU extension descriptor.
  479. * The host is not required to provide the HTT tx MSDU extension descriptor
  480. * just because the target supports it; the target must check the
  481. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  482. * extension descriptor is present.
  483. */
  484. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  485. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  486. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  487. };
  488. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  489. struct htt_option_tlv_header_t hdr;
  490. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  491. } POSTPACK;
  492. /*
  493. * For the tcl data command V2 and higher support added a new
  494. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  495. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  496. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  497. * HTT option TLV for specifying which version of the TCL metadata struct
  498. * should be used:
  499. * V1 -> use htt_tx_tcl_metadata struct
  500. * V2 -> use htt_tx_tcl_metadata_v2 struct
  501. * Old FW will only support V1.
  502. * New FW will support V2. New FW will still support V1, at least during
  503. * a transition period.
  504. * Similarly, old host will only support V1, and new host will support V1 + V2.
  505. *
  506. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  507. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  508. * of TCL metadata the host supports. If the host doesn't provide a
  509. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  510. * is implicitly understood that the host only supports V1.
  511. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  512. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  513. * the host shall use. The target shall only select one of the versions
  514. * supported by the host. If the target doesn't provide a
  515. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  516. * is implicitly understood that the V1 TCL metadata shall be used.
  517. */
  518. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  519. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  520. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  521. };
  522. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  523. struct htt_option_tlv_header_t hdr;
  524. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  525. } POSTPACK;
  526. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  527. HTT_OPTION_TLV_VALUE0_SET(word, value)
  528. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  529. HTT_OPTION_TLV_VALUE0_GET(word)
  530. typedef struct {
  531. union {
  532. /* BIT [11 : 0] :- tag
  533. * BIT [23 : 12] :- length
  534. * BIT [31 : 24] :- reserved
  535. */
  536. A_UINT32 tag__length;
  537. /*
  538. * The following struct is not endian-portable.
  539. * It is suitable for use within the target, which is known to be
  540. * little-endian.
  541. * The host should use the above endian-portable macros to access
  542. * the tag and length bitfields in an endian-neutral manner.
  543. */
  544. struct {
  545. A_UINT32 tag : 12, /* BIT [11 : 0] */
  546. length : 12, /* BIT [23 : 12] */
  547. reserved : 8; /* BIT [31 : 24] */
  548. };
  549. };
  550. } htt_tlv_hdr_t;
  551. /** HTT stats TLV tag values */
  552. typedef enum {
  553. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  554. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  555. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  556. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  557. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  558. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  559. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  560. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  561. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  562. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  563. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  564. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  565. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  566. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  567. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  568. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  569. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  570. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  571. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  572. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  573. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  574. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  575. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  576. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  577. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  578. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  579. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  580. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  581. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  582. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  583. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  584. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  585. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  586. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  587. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  588. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  589. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  590. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  591. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  592. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  593. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  594. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  595. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  596. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  597. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  598. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  599. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  600. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  601. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  602. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  603. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  604. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  605. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  606. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  607. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  608. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  609. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  610. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  611. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  612. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  613. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  614. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  615. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  616. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  617. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  618. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  619. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  620. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  621. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  622. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  623. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  624. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  625. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  626. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  627. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  628. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  629. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  630. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  631. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  632. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  633. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  634. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  635. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  636. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  637. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  638. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  639. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  640. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  641. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  642. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  643. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  644. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  645. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  646. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  647. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  648. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  649. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  650. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  651. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  652. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  653. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  654. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  655. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  656. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  657. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  658. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  659. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  660. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  661. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  662. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  663. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  664. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  665. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  666. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  667. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  668. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  669. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  670. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  671. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  672. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  673. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  674. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  675. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  676. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  677. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  678. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  679. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  680. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  681. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  682. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  683. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  684. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  685. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  686. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  687. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  688. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  689. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  690. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  691. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  692. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  693. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  694. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  695. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  696. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  697. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  698. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  699. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  700. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  701. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  702. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  703. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  704. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  708. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  709. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  710. HTT_STATS_MAX_TAG,
  711. } htt_stats_tlv_tag_t;
  712. /* retain deprecated enum name as an alias for the current enum name */
  713. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  714. #define HTT_STATS_TLV_TAG_M 0x00000fff
  715. #define HTT_STATS_TLV_TAG_S 0
  716. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  717. #define HTT_STATS_TLV_LENGTH_S 12
  718. #define HTT_STATS_TLV_TAG_GET(_var) \
  719. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  720. HTT_STATS_TLV_TAG_S)
  721. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  722. do { \
  723. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  724. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  725. } while (0)
  726. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  727. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  728. HTT_STATS_TLV_LENGTH_S)
  729. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  730. do { \
  731. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  732. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  733. } while (0)
  734. /*=== host -> target messages ===============================================*/
  735. enum htt_h2t_msg_type {
  736. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  737. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  738. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  739. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  740. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  741. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  742. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  743. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  744. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  745. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  746. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  747. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  748. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  749. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  750. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  751. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  752. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  753. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  754. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  755. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  756. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  757. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  758. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  759. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  760. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  761. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  762. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  763. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  764. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  765. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  766. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  767. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  768. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  769. /* keep this last */
  770. HTT_H2T_NUM_MSGS
  771. };
  772. /*
  773. * HTT host to target message type -
  774. * stored in bits 7:0 of the first word of the message
  775. */
  776. #define HTT_H2T_MSG_TYPE_M 0xff
  777. #define HTT_H2T_MSG_TYPE_S 0
  778. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  779. do { \
  780. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  781. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  782. } while (0)
  783. #define HTT_H2T_MSG_TYPE_GET(word) \
  784. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  785. /**
  786. * @brief host -> target version number request message definition
  787. *
  788. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  789. *
  790. *
  791. * |31 24|23 16|15 8|7 0|
  792. * |----------------+----------------+----------------+----------------|
  793. * | reserved | msg type |
  794. * |-------------------------------------------------------------------|
  795. * : option request TLV (optional) |
  796. * :...................................................................:
  797. *
  798. * The VER_REQ message may consist of a single 4-byte word, or may be
  799. * extended with TLVs that specify which HTT options the host is requesting
  800. * from the target.
  801. * The following option TLVs may be appended to the VER_REQ message:
  802. * - HL_SUPPRESS_TX_COMPL_IND
  803. * - HL_MAX_TX_QUEUE_GROUPS
  804. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  805. * may be appended to the VER_REQ message (but only one TLV of each type).
  806. *
  807. * Header fields:
  808. * - MSG_TYPE
  809. * Bits 7:0
  810. * Purpose: identifies this as a version number request message
  811. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  812. */
  813. #define HTT_VER_REQ_BYTES 4
  814. /* TBDXXX: figure out a reasonable number */
  815. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  816. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  817. /**
  818. * @brief HTT tx MSDU descriptor
  819. *
  820. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  821. *
  822. * @details
  823. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  824. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  825. * the target firmware needs for the FW's tx processing, particularly
  826. * for creating the HW msdu descriptor.
  827. * The same HTT tx descriptor is used for HL and LL systems, though
  828. * a few fields within the tx descriptor are used only by LL or
  829. * only by HL.
  830. * The HTT tx descriptor is defined in two manners: by a struct with
  831. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  832. * definitions.
  833. * The target should use the struct def, for simplicitly and clarity,
  834. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  835. * neutral. Specifically, the host shall use the get/set macros built
  836. * around the mask + shift defs.
  837. */
  838. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  839. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  840. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  841. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  842. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  843. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  844. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  845. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  846. #define HTT_TX_VDEV_ID_WORD 0
  847. #define HTT_TX_VDEV_ID_MASK 0x3f
  848. #define HTT_TX_VDEV_ID_SHIFT 16
  849. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  850. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  851. #define HTT_TX_MSDU_LEN_DWORD 1
  852. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  853. /*
  854. * HTT_VAR_PADDR macros
  855. * Allow physical / bus addresses to be either a single 32-bit value,
  856. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  857. */
  858. #define HTT_VAR_PADDR32(var_name) \
  859. A_UINT32 var_name
  860. #define HTT_VAR_PADDR64_LE(var_name) \
  861. struct { \
  862. /* little-endian: lo precedes hi */ \
  863. A_UINT32 lo; \
  864. A_UINT32 hi; \
  865. } var_name
  866. /*
  867. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  868. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  869. * addresses are stored in a XXX-bit field.
  870. * This macro is used to define both htt_tx_msdu_desc32_t and
  871. * htt_tx_msdu_desc64_t structs.
  872. */
  873. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  874. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  875. { \
  876. /* DWORD 0: flags and meta-data */ \
  877. A_UINT32 \
  878. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  879. \
  880. /* pkt_subtype - \
  881. * Detailed specification of the tx frame contents, extending the \
  882. * general specification provided by pkt_type. \
  883. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  884. * pkt_type | pkt_subtype \
  885. * ============================================================== \
  886. * 802.3 | bit 0:3 - Reserved \
  887. * | bit 4: 0x0 - Copy-Engine Classification Results \
  888. * | not appended to the HTT message \
  889. * | 0x1 - Copy-Engine Classification Results \
  890. * | appended to the HTT message in the \
  891. * | format: \
  892. * | [HTT tx desc, frame header, \
  893. * | CE classification results] \
  894. * | The CE classification results begin \
  895. * | at the next 4-byte boundary after \
  896. * | the frame header. \
  897. * ------------+------------------------------------------------- \
  898. * Eth2 | bit 0:3 - Reserved \
  899. * | bit 4: 0x0 - Copy-Engine Classification Results \
  900. * | not appended to the HTT message \
  901. * | 0x1 - Copy-Engine Classification Results \
  902. * | appended to the HTT message. \
  903. * | See the above specification of the \
  904. * | CE classification results location. \
  905. * ------------+------------------------------------------------- \
  906. * native WiFi | bit 0:3 - Reserved \
  907. * | bit 4: 0x0 - Copy-Engine Classification Results \
  908. * | not appended to the HTT message \
  909. * | 0x1 - Copy-Engine Classification Results \
  910. * | appended to the HTT message. \
  911. * | See the above specification of the \
  912. * | CE classification results location. \
  913. * ------------+------------------------------------------------- \
  914. * mgmt | 0x0 - 802.11 MAC header absent \
  915. * | 0x1 - 802.11 MAC header present \
  916. * ------------+------------------------------------------------- \
  917. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  918. * | 0x1 - 802.11 MAC header present \
  919. * | bit 1: 0x0 - allow aggregation \
  920. * | 0x1 - don't allow aggregation \
  921. * | bit 2: 0x0 - perform encryption \
  922. * | 0x1 - don't perform encryption \
  923. * | bit 3: 0x0 - perform tx classification / queuing \
  924. * | 0x1 - don't perform tx classification; \
  925. * | insert the frame into the "misc" \
  926. * | tx queue \
  927. * | bit 4: 0x0 - Copy-Engine Classification Results \
  928. * | not appended to the HTT message \
  929. * | 0x1 - Copy-Engine Classification Results \
  930. * | appended to the HTT message. \
  931. * | See the above specification of the \
  932. * | CE classification results location. \
  933. */ \
  934. pkt_subtype: 5, \
  935. \
  936. /* pkt_type - \
  937. * General specification of the tx frame contents. \
  938. * The htt_pkt_type enum should be used to specify and check the \
  939. * value of this field. \
  940. */ \
  941. pkt_type: 3, \
  942. \
  943. /* vdev_id - \
  944. * ID for the vdev that is sending this tx frame. \
  945. * For certain non-standard packet types, e.g. pkt_type == raw \
  946. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  947. * This field is used primarily for determining where to queue \
  948. * broadcast and multicast frames. \
  949. */ \
  950. vdev_id: 6, \
  951. /* ext_tid - \
  952. * The extended traffic ID. \
  953. * If the TID is unknown, the extended TID is set to \
  954. * HTT_TX_EXT_TID_INVALID. \
  955. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  956. * value of the QoS TID. \
  957. * If the tx frame is non-QoS data, then the extended TID is set to \
  958. * HTT_TX_EXT_TID_NON_QOS. \
  959. * If the tx frame is multicast or broadcast, then the extended TID \
  960. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  961. */ \
  962. ext_tid: 5, \
  963. \
  964. /* postponed - \
  965. * This flag indicates whether the tx frame has been downloaded to \
  966. * the target before but discarded by the target, and now is being \
  967. * downloaded again; or if this is a new frame that is being \
  968. * downloaded for the first time. \
  969. * This flag allows the target to determine the correct order for \
  970. * transmitting new vs. old frames. \
  971. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  972. * This flag only applies to HL systems, since in LL systems, \
  973. * the tx flow control is handled entirely within the target. \
  974. */ \
  975. postponed: 1, \
  976. \
  977. /* extension - \
  978. * This flag indicates whether a HTT tx MSDU extension descriptor \
  979. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  980. * \
  981. * 0x0 - no extension MSDU descriptor is present \
  982. * 0x1 - an extension MSDU descriptor immediately follows the \
  983. * regular MSDU descriptor \
  984. */ \
  985. extension: 1, \
  986. \
  987. /* cksum_offload - \
  988. * This flag indicates whether checksum offload is enabled or not \
  989. * for this frame. Target FW use this flag to turn on HW checksumming \
  990. * 0x0 - No checksum offload \
  991. * 0x1 - L3 header checksum only \
  992. * 0x2 - L4 checksum only \
  993. * 0x3 - L3 header checksum + L4 checksum \
  994. */ \
  995. cksum_offload: 2, \
  996. \
  997. /* tx_comp_req - \
  998. * This flag indicates whether Tx Completion \
  999. * from fw is required or not. \
  1000. * This flag is only relevant if tx completion is not \
  1001. * universally enabled. \
  1002. * For all LL systems, tx completion is mandatory, \
  1003. * so this flag will be irrelevant. \
  1004. * For HL systems tx completion is optional, but HL systems in which \
  1005. * the bus throughput exceeds the WLAN throughput will \
  1006. * probably want to always use tx completion, and thus \
  1007. * would not check this flag. \
  1008. * This flag is required when tx completions are not used universally, \
  1009. * but are still required for certain tx frames for which \
  1010. * an OTA delivery acknowledgment is needed by the host. \
  1011. * In practice, this would be for HL systems in which the \
  1012. * bus throughput is less than the WLAN throughput. \
  1013. * \
  1014. * 0x0 - Tx Completion Indication from Fw not required \
  1015. * 0x1 - Tx Completion Indication from Fw is required \
  1016. */ \
  1017. tx_compl_req: 1; \
  1018. \
  1019. \
  1020. /* DWORD 1: MSDU length and ID */ \
  1021. A_UINT32 \
  1022. len: 16, /* MSDU length, in bytes */ \
  1023. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1024. * and this id is used to calculate fragmentation \
  1025. * descriptor pointer inside the target based on \
  1026. * the base address, configured inside the target. \
  1027. */ \
  1028. \
  1029. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1030. /* frags_desc_ptr - \
  1031. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1032. * where the tx frame's fragments reside in memory. \
  1033. * This field only applies to LL systems, since in HL systems the \
  1034. * (degenerate single-fragment) fragmentation descriptor is created \
  1035. * within the target. \
  1036. */ \
  1037. _paddr__frags_desc_ptr_; \
  1038. \
  1039. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1040. /* \
  1041. * Peer ID : Target can use this value to know which peer-id packet \
  1042. * destined to. \
  1043. * It's intended to be specified by host in case of NAWDS. \
  1044. */ \
  1045. A_UINT16 peerid; \
  1046. \
  1047. /* \
  1048. * Channel frequency: This identifies the desired channel \
  1049. * frequency (in mhz) for tx frames. This is used by FW to help \
  1050. * determine when it is safe to transmit or drop frames for \
  1051. * off-channel operation. \
  1052. * The default value of zero indicates to FW that the corresponding \
  1053. * VDEV's home channel (if there is one) is the desired channel \
  1054. * frequency. \
  1055. */ \
  1056. A_UINT16 chanfreq; \
  1057. \
  1058. /* Reason reserved is commented is increasing the htt structure size \
  1059. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1060. * A_UINT32 reserved_dword3_bits0_31; \
  1061. */ \
  1062. } POSTPACK
  1063. /* define a htt_tx_msdu_desc32_t type */
  1064. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1065. /* define a htt_tx_msdu_desc64_t type */
  1066. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1067. /*
  1068. * Make htt_tx_msdu_desc_t be an alias for either
  1069. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1070. */
  1071. #if HTT_PADDR64
  1072. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1073. #else
  1074. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1075. #endif
  1076. /* decriptor information for Management frame*/
  1077. /*
  1078. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1079. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1080. */
  1081. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1082. extern A_UINT32 mgmt_hdr_len;
  1083. PREPACK struct htt_mgmt_tx_desc_t {
  1084. A_UINT32 msg_type;
  1085. #if HTT_PADDR64
  1086. A_UINT64 frag_paddr; /* DMAble address of the data */
  1087. #else
  1088. A_UINT32 frag_paddr; /* DMAble address of the data */
  1089. #endif
  1090. A_UINT32 desc_id; /* returned to host during completion
  1091. * to free the meory*/
  1092. A_UINT32 len; /* Fragment length */
  1093. A_UINT32 vdev_id; /* virtual device ID*/
  1094. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1095. } POSTPACK;
  1096. PREPACK struct htt_mgmt_tx_compl_ind {
  1097. A_UINT32 desc_id;
  1098. A_UINT32 status;
  1099. } POSTPACK;
  1100. /*
  1101. * This SDU header size comes from the summation of the following:
  1102. * 1. Max of:
  1103. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1104. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1105. * b. 802.11 header, for raw frames: 36 bytes
  1106. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1107. * QoS header, HT header)
  1108. * c. 802.3 header, for ethernet frames: 14 bytes
  1109. * (destination address, source address, ethertype / length)
  1110. * 2. Max of:
  1111. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1112. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1113. * 3. 802.1Q VLAN header: 4 bytes
  1114. * 4. LLC/SNAP header: 8 bytes
  1115. */
  1116. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1117. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1118. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1119. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1120. A_COMPILE_TIME_ASSERT(
  1121. htt_encap_hdr_size_max_check_nwifi,
  1122. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1123. A_COMPILE_TIME_ASSERT(
  1124. htt_encap_hdr_size_max_check_enet,
  1125. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1126. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1127. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1128. #define HTT_TX_HDR_SIZE_802_1Q 4
  1129. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1130. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1131. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1132. HTT_TX_HDR_SIZE_802_1Q + \
  1133. HTT_TX_HDR_SIZE_LLC_SNAP)
  1134. #define HTT_HL_TX_FRM_HDR_LEN \
  1135. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1136. #define HTT_LL_TX_FRM_HDR_LEN \
  1137. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1138. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1139. /* dword 0 */
  1140. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1141. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1142. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1143. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1144. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1145. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1146. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1147. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1148. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1149. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1150. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1151. #define HTT_TX_DESC_PKT_TYPE_S 13
  1152. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1153. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1154. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1155. #define HTT_TX_DESC_VDEV_ID_S 16
  1156. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1157. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1158. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1159. #define HTT_TX_DESC_EXT_TID_S 22
  1160. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1161. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1162. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1163. #define HTT_TX_DESC_POSTPONED_S 27
  1164. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1165. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1166. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1167. #define HTT_TX_DESC_EXTENSION_S 28
  1168. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1169. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1170. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1171. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1172. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1173. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1174. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1175. #define HTT_TX_DESC_TX_COMP_S 31
  1176. /* dword 1 */
  1177. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1178. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1179. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1180. #define HTT_TX_DESC_FRM_LEN_S 0
  1181. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1182. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1183. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1184. #define HTT_TX_DESC_FRM_ID_S 16
  1185. /* dword 2 */
  1186. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1187. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1188. /* for systems using 64-bit format for bus addresses */
  1189. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1190. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1191. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1192. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1193. /* for systems using 32-bit format for bus addresses */
  1194. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1195. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1196. /* dword 3 */
  1197. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1198. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1199. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1200. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1201. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1202. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1203. #if HTT_PADDR64
  1204. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1205. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1206. #else
  1207. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1208. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1209. #endif
  1210. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1211. #define HTT_TX_DESC_PEER_ID_S 0
  1212. /*
  1213. * TEMPORARY:
  1214. * The original definitions for the PEER_ID fields contained typos
  1215. * (with _DESC_PADDR appended to this PEER_ID field name).
  1216. * Retain deprecated original names for PEER_ID fields until all code that
  1217. * refers to them has been updated.
  1218. */
  1219. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1220. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1221. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1222. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1223. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1224. HTT_TX_DESC_PEER_ID_M
  1225. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1226. HTT_TX_DESC_PEER_ID_S
  1227. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1228. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1229. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1230. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1231. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1232. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1233. #if HTT_PADDR64
  1234. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1235. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1236. #else
  1237. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1238. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1239. #endif
  1240. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1241. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1242. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1243. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1244. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1248. } while (0)
  1249. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1250. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1251. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1255. } while (0)
  1256. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1257. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1258. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1261. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1262. } while (0)
  1263. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1264. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1265. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1269. } while (0)
  1270. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1271. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1272. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1276. } while (0)
  1277. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1278. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1279. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1283. } while (0)
  1284. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1285. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1286. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1290. } while (0)
  1291. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1292. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1293. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1297. } while (0)
  1298. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1299. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1300. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1304. } while (0)
  1305. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1306. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1307. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1311. } while (0)
  1312. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1313. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1314. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1318. } while (0)
  1319. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1320. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1321. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1322. do { \
  1323. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1324. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1325. } while (0)
  1326. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1327. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1328. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1332. } while (0)
  1333. /* enums used in the HTT tx MSDU extension descriptor */
  1334. enum {
  1335. htt_tx_guard_interval_regular = 0,
  1336. htt_tx_guard_interval_short = 1,
  1337. };
  1338. enum {
  1339. htt_tx_preamble_type_ofdm = 0,
  1340. htt_tx_preamble_type_cck = 1,
  1341. htt_tx_preamble_type_ht = 2,
  1342. htt_tx_preamble_type_vht = 3,
  1343. };
  1344. enum {
  1345. htt_tx_bandwidth_5MHz = 0,
  1346. htt_tx_bandwidth_10MHz = 1,
  1347. htt_tx_bandwidth_20MHz = 2,
  1348. htt_tx_bandwidth_40MHz = 3,
  1349. htt_tx_bandwidth_80MHz = 4,
  1350. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1351. };
  1352. /**
  1353. * @brief HTT tx MSDU extension descriptor
  1354. * @details
  1355. * If the target supports HTT tx MSDU extension descriptors, the host has
  1356. * the option of appending the following struct following the regular
  1357. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1358. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1359. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1360. * tx specs for each frame.
  1361. */
  1362. PREPACK struct htt_tx_msdu_desc_ext_t {
  1363. /* DWORD 0: flags */
  1364. A_UINT32
  1365. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1366. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1367. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1368. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1369. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1370. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1371. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1372. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1373. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1374. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1375. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1376. /* DWORD 1: tx power, tx rate, tx BW */
  1377. A_UINT32
  1378. /* pwr -
  1379. * Specify what power the tx frame needs to be transmitted at.
  1380. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1381. * The value needs to be appropriately sign-extended when extracting
  1382. * the value from the message and storing it in a variable that is
  1383. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1384. * automatically handles this sign-extension.)
  1385. * If the transmission uses multiple tx chains, this power spec is
  1386. * the total transmit power, assuming incoherent combination of
  1387. * per-chain power to produce the total power.
  1388. */
  1389. pwr: 8,
  1390. /* mcs_mask -
  1391. * Specify the allowable values for MCS index (modulation and coding)
  1392. * to use for transmitting the frame.
  1393. *
  1394. * For HT / VHT preamble types, this mask directly corresponds to
  1395. * the HT or VHT MCS indices that are allowed. For each bit N set
  1396. * within the mask, MCS index N is allowed for transmitting the frame.
  1397. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1398. * rates versus OFDM rates, so the host has the option of specifying
  1399. * that the target must transmit the frame with CCK or OFDM rates
  1400. * (not HT or VHT), but leaving the decision to the target whether
  1401. * to use CCK or OFDM.
  1402. *
  1403. * For CCK and OFDM, the bits within this mask are interpreted as
  1404. * follows:
  1405. * bit 0 -> CCK 1 Mbps rate is allowed
  1406. * bit 1 -> CCK 2 Mbps rate is allowed
  1407. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1408. * bit 3 -> CCK 11 Mbps rate is allowed
  1409. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1410. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1411. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1412. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1413. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1414. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1415. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1416. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1417. *
  1418. * The MCS index specification needs to be compatible with the
  1419. * bandwidth mask specification. For example, a MCS index == 9
  1420. * specification is inconsistent with a preamble type == VHT,
  1421. * Nss == 1, and channel bandwidth == 20 MHz.
  1422. *
  1423. * Furthermore, the host has only a limited ability to specify to
  1424. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1425. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1426. */
  1427. mcs_mask: 12,
  1428. /* nss_mask -
  1429. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1430. * Each bit in this mask corresponds to a Nss value:
  1431. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1432. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1433. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1434. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1435. * The values in the Nss mask must be suitable for the recipient, e.g.
  1436. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1437. * recipient which only supports 2x2 MIMO.
  1438. */
  1439. nss_mask: 4,
  1440. /* guard_interval -
  1441. * Specify a htt_tx_guard_interval enum value to indicate whether
  1442. * the transmission should use a regular guard interval or a
  1443. * short guard interval.
  1444. */
  1445. guard_interval: 1,
  1446. /* preamble_type_mask -
  1447. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1448. * may choose from for transmitting this frame.
  1449. * The bits in this mask correspond to the values in the
  1450. * htt_tx_preamble_type enum. For example, to allow the target
  1451. * to transmit the frame as either CCK or OFDM, this field would
  1452. * be set to
  1453. * (1 << htt_tx_preamble_type_ofdm) |
  1454. * (1 << htt_tx_preamble_type_cck)
  1455. */
  1456. preamble_type_mask: 4,
  1457. reserved1_31_29: 3; /* unused, set to 0x0 */
  1458. /* DWORD 2: tx chain mask, tx retries */
  1459. A_UINT32
  1460. /* chain_mask - specify which chains to transmit from */
  1461. chain_mask: 4,
  1462. /* retry_limit -
  1463. * Specify the maximum number of transmissions, including the
  1464. * initial transmission, to attempt before giving up if no ack
  1465. * is received.
  1466. * If the tx rate is specified, then all retries shall use the
  1467. * same rate as the initial transmission.
  1468. * If no tx rate is specified, the target can choose whether to
  1469. * retain the original rate during the retransmissions, or to
  1470. * fall back to a more robust rate.
  1471. */
  1472. retry_limit: 4,
  1473. /* bandwidth_mask -
  1474. * Specify what channel widths may be used for the transmission.
  1475. * A value of zero indicates "don't care" - the target may choose
  1476. * the transmission bandwidth.
  1477. * The bits within this mask correspond to the htt_tx_bandwidth
  1478. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1479. * The bandwidth_mask must be consistent with the preamble_type_mask
  1480. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1481. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1482. */
  1483. bandwidth_mask: 6,
  1484. reserved2_31_14: 18; /* unused, set to 0x0 */
  1485. /* DWORD 3: tx expiry time (TSF) LSBs */
  1486. A_UINT32 expire_tsf_lo;
  1487. /* DWORD 4: tx expiry time (TSF) MSBs */
  1488. A_UINT32 expire_tsf_hi;
  1489. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1490. } POSTPACK;
  1491. /* DWORD 0 */
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1495. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1503. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1512. /* DWORD 1 */
  1513. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1514. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1515. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1516. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1517. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1518. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1519. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1520. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1521. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1522. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1523. /* DWORD 2 */
  1524. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1525. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1526. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1527. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1528. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1529. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1530. /* DWORD 0 */
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1532. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1533. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1535. do { \
  1536. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1537. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1538. } while (0)
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1540. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1541. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1543. do { \
  1544. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1545. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1546. } while (0)
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL( \
  1553. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1554. ((_var) |= ((_val) \
  1555. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1556. } while (0)
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1558. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1559. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1561. do { \
  1562. HTT_CHECK_SET_VAL( \
  1563. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1564. ((_var) |= ((_val) \
  1565. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1566. } while (0)
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1568. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1569. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1571. do { \
  1572. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1573. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1574. } while (0)
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1576. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1577. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1579. do { \
  1580. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1581. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1582. } while (0)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1584. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1585. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1587. do { \
  1588. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1589. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1590. } while (0)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1593. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1597. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1598. } while (0)
  1599. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1600. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1601. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1602. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1603. do { \
  1604. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1605. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1606. } while (0)
  1607. /* DWORD 1 */
  1608. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1609. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1610. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1611. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1612. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1613. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1614. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1615. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1616. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1617. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1618. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1619. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1620. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1621. do { \
  1622. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1623. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1624. } while (0)
  1625. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1627. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1628. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1635. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1636. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1644. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1648. } while (0)
  1649. /* DWORD 2 */
  1650. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1651. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1652. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1653. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1654. do { \
  1655. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1656. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1657. } while (0)
  1658. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1659. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1660. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1661. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1662. do { \
  1663. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1664. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1665. } while (0)
  1666. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1668. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1669. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1673. } while (0)
  1674. typedef enum {
  1675. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1676. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1677. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1678. } htt_11ax_ltf_subtype_t;
  1679. typedef enum {
  1680. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1681. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1682. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1683. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1684. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1685. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1686. } htt_tx_ext2_preamble_type_t;
  1687. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1688. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1689. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1690. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1691. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1692. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1693. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1694. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1695. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1696. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1697. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1698. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1699. /**
  1700. * @brief HTT tx MSDU extension descriptor v2
  1701. * @details
  1702. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1703. * is received as tcl_exit_base->host_meta_info in firmware.
  1704. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1705. * are already part of tcl_exit_base.
  1706. */
  1707. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1708. /* DWORD 0: flags */
  1709. A_UINT32
  1710. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1711. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1712. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1713. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1714. valid_retries : 1, /* if set, tx retries spec is valid */
  1715. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1716. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1717. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1718. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1719. valid_key_flags : 1, /* if set, key flags is valid */
  1720. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1721. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1722. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1723. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1724. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1725. 1 = ENCRYPT,
  1726. 2 ~ 3 - Reserved */
  1727. /* retry_limit -
  1728. * Specify the maximum number of transmissions, including the
  1729. * initial transmission, to attempt before giving up if no ack
  1730. * is received.
  1731. * If the tx rate is specified, then all retries shall use the
  1732. * same rate as the initial transmission.
  1733. * If no tx rate is specified, the target can choose whether to
  1734. * retain the original rate during the retransmissions, or to
  1735. * fall back to a more robust rate.
  1736. */
  1737. retry_limit : 4,
  1738. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1739. * Valid only for 11ax preamble types HE_SU
  1740. * and HE_EXT_SU
  1741. */
  1742. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1743. * Valid only for 11ax preamble types HE_SU
  1744. * and HE_EXT_SU
  1745. */
  1746. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1747. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1748. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1749. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1750. */
  1751. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1752. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1753. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1754. * Use cases:
  1755. * Any time firmware uses TQM-BYPASS for Data
  1756. * TID, firmware expect host to set this bit.
  1757. */
  1758. /* DWORD 1: tx power, tx rate */
  1759. A_UINT32
  1760. power : 8, /* unit of the power field is 0.5 dbm
  1761. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1762. * signed value ranging from -64dbm to 63.5 dbm
  1763. */
  1764. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1765. * Setting more than one MCS isn't currently
  1766. * supported by the target (but is supported
  1767. * in the interface in case in the future
  1768. * the target supports specifications of
  1769. * a limited set of MCS values.
  1770. */
  1771. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1772. * Setting more than one Nss isn't currently
  1773. * supported by the target (but is supported
  1774. * in the interface in case in the future
  1775. * the target supports specifications of
  1776. * a limited set of Nss values.
  1777. */
  1778. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1779. update_peer_cache : 1; /* When set these custom values will be
  1780. * used for all packets, until the next
  1781. * update via this ext header.
  1782. * This is to make sure not all packets
  1783. * need to include this header.
  1784. */
  1785. /* DWORD 2: tx chain mask, tx retries */
  1786. A_UINT32
  1787. /* chain_mask - specify which chains to transmit from */
  1788. chain_mask : 8,
  1789. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1790. * TODO: Update Enum values for key_flags
  1791. */
  1792. /*
  1793. * Channel frequency: This identifies the desired channel
  1794. * frequency (in MHz) for tx frames. This is used by FW to help
  1795. * determine when it is safe to transmit or drop frames for
  1796. * off-channel operation.
  1797. * The default value of zero indicates to FW that the corresponding
  1798. * VDEV's home channel (if there is one) is the desired channel
  1799. * frequency.
  1800. */
  1801. chanfreq : 16;
  1802. /* DWORD 3: tx expiry time (TSF) LSBs */
  1803. A_UINT32 expire_tsf_lo;
  1804. /* DWORD 4: tx expiry time (TSF) MSBs */
  1805. A_UINT32 expire_tsf_hi;
  1806. /* DWORD 5: flags to control routing / processing of the MSDU */
  1807. A_UINT32
  1808. /* learning_frame
  1809. * When this flag is set, this frame will be dropped by FW
  1810. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1811. */
  1812. learning_frame : 1,
  1813. /* send_as_standalone
  1814. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1815. * i.e. with no A-MSDU or A-MPDU aggregation.
  1816. * The scope is extended to other use-cases.
  1817. */
  1818. send_as_standalone : 1,
  1819. /* is_host_opaque_valid
  1820. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1821. * with valid information.
  1822. */
  1823. is_host_opaque_valid : 1,
  1824. rsvd0 : 29;
  1825. /* DWORD 6 : Host opaque cookie for special frames */
  1826. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1827. rsvd1 : 16;
  1828. /*
  1829. * This structure can be expanded further up to 40 bytes
  1830. * by adding further DWORDs as needed.
  1831. */
  1832. } POSTPACK;
  1833. /* DWORD 0 */
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1860. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1861. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1862. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1863. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1864. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1865. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1866. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1867. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1868. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1869. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1870. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1871. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1872. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1873. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1874. /* DWORD 1 */
  1875. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1876. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1877. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1878. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1879. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1880. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1881. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1882. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1883. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1884. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1885. /* DWORD 2 */
  1886. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1887. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1888. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1889. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1890. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1891. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1892. /* DWORD 5 */
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1899. /* DWORD 6 */
  1900. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1901. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1902. /* DWORD 0 */
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1904. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1905. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1907. do { \
  1908. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1909. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1910. } while (0)
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1912. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1913. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1915. do { \
  1916. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1917. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1918. } while (0)
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1920. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1921. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1923. do { \
  1924. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1925. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1926. } while (0)
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1928. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1929. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL( \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1934. ((_var) |= ((_val) \
  1935. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1936. } while (0)
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1938. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1939. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1941. do { \
  1942. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1943. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1944. } while (0)
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1946. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1947. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1952. } while (0)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1954. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1955. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL( \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1960. ((_var) |= ((_val) \
  1961. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1962. } while (0)
  1963. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1964. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1965. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1966. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1967. do { \
  1968. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1969. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1970. } while (0)
  1971. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1972. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1973. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1974. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1978. } while (0)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1980. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1981. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1986. } while (0)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1994. } while (0)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1996. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1997. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1998. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2002. } while (0)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2004. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2005. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2006. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2010. } while (0)
  2011. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2012. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2013. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2014. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2018. } while (0)
  2019. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2020. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2021. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2022. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2026. } while (0)
  2027. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2028. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2029. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2030. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2031. do { \
  2032. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2033. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2034. } while (0)
  2035. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2036. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2037. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2038. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2039. do { \
  2040. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2041. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2042. } while (0)
  2043. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2044. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2045. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2046. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2047. do { \
  2048. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2049. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2050. } while (0)
  2051. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2052. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2053. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2054. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2055. do { \
  2056. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2057. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2058. } while (0)
  2059. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2066. } while (0)
  2067. /* DWORD 1 */
  2068. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2070. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2071. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2072. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2073. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2074. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2075. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2076. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2077. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2078. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2079. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2080. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2081. do { \
  2082. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2083. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2084. } while (0)
  2085. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2086. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2087. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2088. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2092. } while (0)
  2093. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2094. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2095. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2096. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2100. } while (0)
  2101. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2102. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2103. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2104. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2108. } while (0)
  2109. /* DWORD 2 */
  2110. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2111. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2112. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2113. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2116. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2117. } while (0)
  2118. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2120. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2121. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2125. } while (0)
  2126. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2127. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2128. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2129. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2130. do { \
  2131. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2132. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2133. } while (0)
  2134. /* DWORD 5 */
  2135. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2136. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2137. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2138. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2139. do { \
  2140. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2141. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2142. } while (0)
  2143. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2144. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2145. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2146. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2150. } while (0)
  2151. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2152. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2153. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2154. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2158. } while (0)
  2159. /* DWORD 6 */
  2160. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2161. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2162. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2163. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2167. } while (0)
  2168. typedef enum {
  2169. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2170. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2171. } htt_tcl_metadata_type;
  2172. /**
  2173. * @brief HTT TCL command number format
  2174. * @details
  2175. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2176. * available to firmware as tcl_exit_base->tcl_status_number.
  2177. * For regular / multicast packets host will send vdev and mac id and for
  2178. * NAWDS packets, host will send peer id.
  2179. * A_UINT32 is used to avoid endianness conversion problems.
  2180. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2181. */
  2182. typedef struct {
  2183. A_UINT32
  2184. type: 1, /* vdev_id based or peer_id based */
  2185. rsvd: 31;
  2186. } htt_tx_tcl_vdev_or_peer_t;
  2187. typedef struct {
  2188. A_UINT32
  2189. type: 1, /* vdev_id based or peer_id based */
  2190. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2191. vdev_id: 8,
  2192. pdev_id: 2,
  2193. host_inspected:1,
  2194. rsvd: 19;
  2195. } htt_tx_tcl_vdev_metadata;
  2196. typedef struct {
  2197. A_UINT32
  2198. type: 1, /* vdev_id based or peer_id based */
  2199. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2200. peer_id: 14,
  2201. rsvd: 16;
  2202. } htt_tx_tcl_peer_metadata;
  2203. PREPACK struct htt_tx_tcl_metadata {
  2204. union {
  2205. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2206. htt_tx_tcl_vdev_metadata vdev_meta;
  2207. htt_tx_tcl_peer_metadata peer_meta;
  2208. };
  2209. } POSTPACK;
  2210. /* DWORD 0 */
  2211. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2212. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2213. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2214. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2215. /* VDEV metadata */
  2216. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2217. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2218. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2219. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2220. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2221. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2222. /* PEER metadata */
  2223. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2224. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2225. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2226. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2227. HTT_TX_TCL_METADATA_TYPE_S)
  2228. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2229. do { \
  2230. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2231. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2232. } while (0)
  2233. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2234. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2235. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2236. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2237. do { \
  2238. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2239. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2240. } while (0)
  2241. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2242. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2243. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2244. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2245. do { \
  2246. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2247. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2248. } while (0)
  2249. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2250. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2251. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2252. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2255. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2256. } while (0)
  2257. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2258. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2259. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2260. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2264. } while (0)
  2265. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2266. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2267. HTT_TX_TCL_METADATA_PEER_ID_S)
  2268. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2272. } while (0)
  2273. /*------------------------------------------------------------------
  2274. * V2 Version of TCL Data Command
  2275. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2276. * MLO global_seq all flavours of TCL Data Cmd.
  2277. *-----------------------------------------------------------------*/
  2278. typedef enum {
  2279. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2280. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2281. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2282. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2283. } htt_tcl_metadata_type_v2;
  2284. /**
  2285. * @brief HTT TCL command number format
  2286. * @details
  2287. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2288. * available to firmware as tcl_exit_base->tcl_status_number.
  2289. * A_UINT32 is used to avoid endianness conversion problems.
  2290. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2291. */
  2292. typedef struct {
  2293. A_UINT32
  2294. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2295. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2296. vdev_id: 8,
  2297. pdev_id: 2,
  2298. host_inspected:1,
  2299. rsvd: 2,
  2300. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2301. } htt_tx_tcl_vdev_metadata_v2;
  2302. typedef struct {
  2303. A_UINT32
  2304. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2305. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2306. peer_id: 13,
  2307. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2308. } htt_tx_tcl_peer_metadata_v2;
  2309. typedef struct {
  2310. A_UINT32
  2311. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2312. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2313. svc_class_id: 8,
  2314. rsvd: 5,
  2315. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2316. } htt_tx_tcl_svc_class_id_metadata;
  2317. typedef struct {
  2318. A_UINT32
  2319. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2320. host_inspected: 1,
  2321. global_seq_no: 12,
  2322. rsvd: 1,
  2323. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2324. } htt_tx_tcl_global_seq_metadata;
  2325. PREPACK struct htt_tx_tcl_metadata_v2 {
  2326. union {
  2327. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2328. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2329. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2330. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2331. };
  2332. } POSTPACK;
  2333. /* DWORD 0 */
  2334. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2335. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2336. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2337. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2338. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2339. /* VDEV V2 metadata */
  2340. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2341. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2342. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2343. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2344. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2345. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2346. /* PEER V2 metadata */
  2347. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2348. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2349. /* SVC_CLASS_ID metadata */
  2350. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2351. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2352. /* Global Seq no metadata */
  2353. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2354. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2355. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2356. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2357. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2358. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2359. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2360. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2361. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2362. do { \
  2363. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2364. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2365. } while (0)
  2366. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2367. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2368. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2369. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2370. do { \
  2371. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2372. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2373. } while (0)
  2374. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2375. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2376. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2377. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2378. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2379. do { \
  2380. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2381. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2382. } while (0)
  2383. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2384. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2385. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2386. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2387. do { \
  2388. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2389. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2390. } while (0)
  2391. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2392. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2393. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2394. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2395. do { \
  2396. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2397. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2398. } while (0)
  2399. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2400. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2401. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2402. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2403. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2404. do { \
  2405. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2406. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2407. } while (0)
  2408. /*----- Get and Set V2 type field in Service Class fields ----*/
  2409. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2410. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2411. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2412. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2413. do { \
  2414. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2415. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2416. } while (0)
  2417. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2418. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2419. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2420. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2421. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2422. do { \
  2423. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2424. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2425. } while (0)
  2426. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2427. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2428. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2429. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2430. do { \
  2431. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2432. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2433. } while (0)
  2434. /*------------------------------------------------------------------
  2435. * End V2 Version of TCL Data Command
  2436. *-----------------------------------------------------------------*/
  2437. typedef enum {
  2438. HTT_TX_FW2WBM_TX_STATUS_OK,
  2439. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2440. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2441. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2442. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2443. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2444. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2445. HTT_TX_FW2WBM_TX_STATUS_MAX
  2446. } htt_tx_fw2wbm_tx_status_t;
  2447. typedef enum {
  2448. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2449. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2450. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2451. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2452. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2453. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2454. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2455. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2456. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2457. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2458. } htt_tx_fw2wbm_reinject_reason_t;
  2459. /**
  2460. * @brief HTT TX WBM Completion from firmware to host
  2461. * @details
  2462. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2463. * DWORD 3 and 4 for software based completions (Exception frames and
  2464. * TQM bypass frames)
  2465. * For software based completions, wbm_release_ring->release_source_module will
  2466. * be set to release_source_fw
  2467. */
  2468. PREPACK struct htt_tx_wbm_completion {
  2469. A_UINT32
  2470. sch_cmd_id: 24,
  2471. exception_frame: 1, /* If set, this packet was queued via exception path */
  2472. rsvd0_31_25: 7;
  2473. A_UINT32
  2474. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2475. * reception of an ACK or BA, this field indicates
  2476. * the RSSI of the received ACK or BA frame.
  2477. * When the frame is removed as result of a direct
  2478. * remove command from the SW, this field is set
  2479. * to 0x0 (which is never a valid value when real
  2480. * RSSI is available).
  2481. * Units: dB w.r.t noise floor
  2482. */
  2483. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2484. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2485. rsvd1_31_16: 16;
  2486. } POSTPACK;
  2487. /* DWORD 0 */
  2488. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2489. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2490. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2491. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2492. /* DWORD 1 */
  2493. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2494. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2495. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2496. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2497. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2498. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2499. /* DWORD 0 */
  2500. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2501. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2502. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2503. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2504. do { \
  2505. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2506. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2507. } while (0)
  2508. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2509. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2510. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2511. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2512. do { \
  2513. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2514. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2515. } while (0)
  2516. /* DWORD 1 */
  2517. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2518. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2519. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2520. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2521. do { \
  2522. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2523. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2524. } while (0)
  2525. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2526. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2527. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2528. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2529. do { \
  2530. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2531. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2532. } while (0)
  2533. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2534. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2535. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2536. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2537. do { \
  2538. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2539. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2540. } while (0)
  2541. /**
  2542. * @brief HTT TX WBM Completion from firmware to host
  2543. * @details
  2544. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2545. * (WBM) offload HW.
  2546. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2547. * For software based completions, release_source_module will
  2548. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2549. * struct wbm_release_ring and then switch to this after looking at
  2550. * release_source_module.
  2551. */
  2552. PREPACK struct htt_tx_wbm_completion_v2 {
  2553. A_UINT32
  2554. used_by_hw0; /* Refer to struct wbm_release_ring */
  2555. A_UINT32
  2556. used_by_hw1; /* Refer to struct wbm_release_ring */
  2557. A_UINT32
  2558. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2559. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2560. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2561. exception_frame: 1,
  2562. rsvd0: 12, /* For future use */
  2563. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2564. rsvd1: 1; /* For future use */
  2565. A_UINT32
  2566. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2567. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2568. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2569. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2570. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2571. */
  2572. A_UINT32
  2573. data1: 32;
  2574. A_UINT32
  2575. data2: 32;
  2576. A_UINT32
  2577. used_by_hw3; /* Refer to struct wbm_release_ring */
  2578. } POSTPACK;
  2579. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2580. /* DWORD 3 */
  2581. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2582. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2583. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2584. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2585. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2586. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2587. /* DWORD 3 */
  2588. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2589. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2590. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2591. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2592. do { \
  2593. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2594. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2595. } while (0)
  2596. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2597. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2598. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2599. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2600. do { \
  2601. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2602. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2603. } while (0)
  2604. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2605. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2606. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2607. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2608. do { \
  2609. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2610. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2611. } while (0)
  2612. /**
  2613. * @brief HTT TX WBM Completion from firmware to host (V3)
  2614. * @details
  2615. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2616. * (WBM) offload HW.
  2617. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2618. * For software based completions, release_source_module will
  2619. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2620. * struct wbm_release_ring and then switch to this after looking at
  2621. * release_source_module.
  2622. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2623. * by new generations of targets.
  2624. */
  2625. PREPACK struct htt_tx_wbm_completion_v3 {
  2626. A_UINT32
  2627. used_by_hw0; /* Refer to struct wbm_release_ring */
  2628. A_UINT32
  2629. used_by_hw1; /* Refer to struct wbm_release_ring */
  2630. A_UINT32
  2631. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2632. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2633. used_by_hw3: 15;
  2634. A_UINT32
  2635. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2636. exception_frame: 1,
  2637. rsvd0: 27; /* For future use */
  2638. A_UINT32
  2639. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2640. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2641. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2642. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2643. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2644. */
  2645. A_UINT32
  2646. data1: 32;
  2647. A_UINT32
  2648. data2: 32;
  2649. A_UINT32
  2650. rsvd1: 20,
  2651. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2652. } POSTPACK;
  2653. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2654. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2655. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2656. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2657. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2658. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2659. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2660. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2661. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2662. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2663. do { \
  2664. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2665. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2666. } while (0)
  2667. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2668. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2669. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2670. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2671. do { \
  2672. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2673. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2674. } while (0)
  2675. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2676. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2677. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2678. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2679. do { \
  2680. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2681. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2682. } while (0)
  2683. typedef enum {
  2684. TX_FRAME_TYPE_UNDEFINED = 0,
  2685. TX_FRAME_TYPE_EAPOL = 1,
  2686. } htt_tx_wbm_status_frame_type;
  2687. /**
  2688. * @brief HTT TX WBM transmit status from firmware to host
  2689. * @details
  2690. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2691. * (WBM) offload HW.
  2692. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2693. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2694. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2695. */
  2696. PREPACK struct htt_tx_wbm_transmit_status {
  2697. A_UINT32
  2698. sch_cmd_id: 24,
  2699. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2700. * reception of an ACK or BA, this field indicates
  2701. * the RSSI of the received ACK or BA frame.
  2702. * When the frame is removed as result of a direct
  2703. * remove command from the SW, this field is set
  2704. * to 0x0 (which is never a valid value when real
  2705. * RSSI is available).
  2706. * Units: dB w.r.t noise floor
  2707. */
  2708. A_UINT32
  2709. sw_peer_id: 16,
  2710. tid_num: 5,
  2711. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2712. * and tid_num fields contain valid data.
  2713. * If this "valid" flag is not set, the
  2714. * sw_peer_id and tid_num fields must be ignored.
  2715. */
  2716. mcast: 1,
  2717. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2718. * contains valid data.
  2719. */
  2720. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2721. reserved: 4;
  2722. A_UINT32
  2723. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2724. * packets in the wbm completion path
  2725. */
  2726. } POSTPACK;
  2727. /* DWORD 4 */
  2728. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2729. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2730. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2731. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2732. /* DWORD 5 */
  2733. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2734. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2735. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2736. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2737. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2738. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2739. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2740. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2741. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2742. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2743. /* DWORD 4 */
  2744. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2745. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2746. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2747. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2748. do { \
  2749. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2750. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2751. } while (0)
  2752. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2753. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2754. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2755. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2756. do { \
  2757. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2758. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2759. } while (0)
  2760. /* DWORD 5 */
  2761. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2762. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2763. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2764. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2765. do { \
  2766. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2767. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2768. } while (0)
  2769. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2770. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2771. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2772. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2775. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2776. } while (0)
  2777. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2778. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2779. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2780. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2781. do { \
  2782. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2783. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2784. } while (0)
  2785. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2786. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2787. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2788. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2789. do { \
  2790. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2791. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2792. } while (0)
  2793. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2794. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2795. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2796. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2799. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2800. } while (0)
  2801. /**
  2802. * @brief HTT TX WBM reinject status from firmware to host
  2803. * @details
  2804. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2805. * (WBM) offload HW.
  2806. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2807. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2808. */
  2809. PREPACK struct htt_tx_wbm_reinject_status {
  2810. A_UINT32
  2811. reserved0: 32;
  2812. A_UINT32
  2813. reserved1: 32;
  2814. A_UINT32
  2815. reserved2: 32;
  2816. } POSTPACK;
  2817. /**
  2818. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2819. * @details
  2820. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2821. * (WBM) offload HW.
  2822. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2823. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2824. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2825. * STA side.
  2826. */
  2827. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2828. A_UINT32
  2829. mec_sa_addr_31_0;
  2830. A_UINT32
  2831. mec_sa_addr_47_32: 16,
  2832. sa_ast_index: 16;
  2833. A_UINT32
  2834. vdev_id: 8,
  2835. reserved0: 24;
  2836. } POSTPACK;
  2837. /* DWORD 4 - mec_sa_addr_31_0 */
  2838. /* DWORD 5 */
  2839. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2840. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2841. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2842. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2843. /* DWORD 6 */
  2844. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2845. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2846. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2847. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2848. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2849. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2852. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2853. } while (0)
  2854. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2855. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2856. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2857. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2860. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2861. } while (0)
  2862. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2863. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2864. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2865. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2868. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2869. } while (0)
  2870. typedef enum {
  2871. TX_FLOW_PRIORITY_BE,
  2872. TX_FLOW_PRIORITY_HIGH,
  2873. TX_FLOW_PRIORITY_LOW,
  2874. } htt_tx_flow_priority_t;
  2875. typedef enum {
  2876. TX_FLOW_LATENCY_SENSITIVE,
  2877. TX_FLOW_LATENCY_INSENSITIVE,
  2878. } htt_tx_flow_latency_t;
  2879. typedef enum {
  2880. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2881. TX_FLOW_INTERACTIVE_TRAFFIC,
  2882. TX_FLOW_PERIODIC_TRAFFIC,
  2883. TX_FLOW_BURSTY_TRAFFIC,
  2884. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2885. } htt_tx_flow_traffic_pattern_t;
  2886. /**
  2887. * @brief HTT TX Flow search metadata format
  2888. * @details
  2889. * Host will set this metadata in flow table's flow search entry along with
  2890. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2891. * firmware and TQM ring if the flow search entry wins.
  2892. * This metadata is available to firmware in that first MSDU's
  2893. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2894. * to one of the available flows for specific tid and returns the tqm flow
  2895. * pointer as part of htt_tx_map_flow_info message.
  2896. */
  2897. PREPACK struct htt_tx_flow_metadata {
  2898. A_UINT32
  2899. rsvd0_1_0: 2,
  2900. tid: 4,
  2901. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2902. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2903. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2904. * Else choose final tid based on latency, priority.
  2905. */
  2906. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2907. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2908. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2909. } POSTPACK;
  2910. /* DWORD 0 */
  2911. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2912. #define HTT_TX_FLOW_METADATA_TID_S 2
  2913. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2914. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2915. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2916. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2917. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2918. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2919. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2920. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2921. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2922. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2923. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2924. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2925. /* DWORD 0 */
  2926. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2927. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2928. HTT_TX_FLOW_METADATA_TID_S)
  2929. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2932. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2933. } while (0)
  2934. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2935. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2936. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2937. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2940. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2941. } while (0)
  2942. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2943. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2944. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2945. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2948. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2949. } while (0)
  2950. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2951. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2952. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2953. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2956. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2957. } while (0)
  2958. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2959. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2960. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2961. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2964. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2965. } while (0)
  2966. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2967. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2968. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2969. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2972. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2973. } while (0)
  2974. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2975. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2976. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2977. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2980. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2981. } while (0)
  2982. /**
  2983. * @brief host -> target ADD WDS Entry
  2984. *
  2985. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2986. *
  2987. * @brief host -> target DELETE WDS Entry
  2988. *
  2989. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2990. *
  2991. * @details
  2992. * HTT wds entry from source port learning
  2993. * Host will learn wds entries from rx and send this message to firmware
  2994. * to enable firmware to configure/delete AST entries for wds clients.
  2995. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2996. * and when SA's entry is deleted, firmware removes this AST entry
  2997. *
  2998. * The message would appear as follows:
  2999. *
  3000. * |31 30|29 |17 16|15 8|7 0|
  3001. * |----------------+----------------+----------------+----------------|
  3002. * | rsvd0 |PDVID| vdev_id | msg_type |
  3003. * |-------------------------------------------------------------------|
  3004. * | sa_addr_31_0 |
  3005. * |-------------------------------------------------------------------|
  3006. * | | ta_peer_id | sa_addr_47_32 |
  3007. * |-------------------------------------------------------------------|
  3008. * Where PDVID = pdev_id
  3009. *
  3010. * The message is interpreted as follows:
  3011. *
  3012. * dword0 - b'0:7 - msg_type: This will be set to
  3013. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3014. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3015. *
  3016. * dword0 - b'8:15 - vdev_id
  3017. *
  3018. * dword0 - b'16:17 - pdev_id
  3019. *
  3020. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3021. *
  3022. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3023. *
  3024. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3025. *
  3026. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3027. */
  3028. PREPACK struct htt_wds_entry {
  3029. A_UINT32
  3030. msg_type: 8,
  3031. vdev_id: 8,
  3032. pdev_id: 2,
  3033. rsvd0: 14;
  3034. A_UINT32 sa_addr_31_0;
  3035. A_UINT32
  3036. sa_addr_47_32: 16,
  3037. ta_peer_id: 14,
  3038. rsvd2: 2;
  3039. } POSTPACK;
  3040. /* DWORD 0 */
  3041. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3042. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3043. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3044. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3045. /* DWORD 2 */
  3046. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3047. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3048. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3049. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3050. /* DWORD 0 */
  3051. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3052. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3053. HTT_WDS_ENTRY_VDEV_ID_S)
  3054. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3055. do { \
  3056. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3057. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3058. } while (0)
  3059. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3060. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3061. HTT_WDS_ENTRY_PDEV_ID_S)
  3062. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3063. do { \
  3064. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3065. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3066. } while (0)
  3067. /* DWORD 2 */
  3068. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3069. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3070. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3071. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3072. do { \
  3073. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3074. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3075. } while (0)
  3076. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3077. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3078. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3079. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3080. do { \
  3081. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3082. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3083. } while (0)
  3084. /**
  3085. * @brief MAC DMA rx ring setup specification
  3086. *
  3087. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3088. *
  3089. * @details
  3090. * To allow for dynamic rx ring reconfiguration and to avoid race
  3091. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3092. * it uses. Instead, it sends this message to the target, indicating how
  3093. * the rx ring used by the host should be set up and maintained.
  3094. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3095. * specifications.
  3096. *
  3097. * |31 16|15 8|7 0|
  3098. * |---------------------------------------------------------------|
  3099. * header: | reserved | num rings | msg type |
  3100. * |---------------------------------------------------------------|
  3101. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3102. #if HTT_PADDR64
  3103. * | FW_IDX shadow register physical address (bits 63:32) |
  3104. #endif
  3105. * |---------------------------------------------------------------|
  3106. * | rx ring base physical address (bits 31:0) |
  3107. #if HTT_PADDR64
  3108. * | rx ring base physical address (bits 63:32) |
  3109. #endif
  3110. * |---------------------------------------------------------------|
  3111. * | rx ring buffer size | rx ring length |
  3112. * |---------------------------------------------------------------|
  3113. * | FW_IDX initial value | enabled flags |
  3114. * |---------------------------------------------------------------|
  3115. * | MSDU payload offset | 802.11 header offset |
  3116. * |---------------------------------------------------------------|
  3117. * | PPDU end offset | PPDU start offset |
  3118. * |---------------------------------------------------------------|
  3119. * | MPDU end offset | MPDU start offset |
  3120. * |---------------------------------------------------------------|
  3121. * | MSDU end offset | MSDU start offset |
  3122. * |---------------------------------------------------------------|
  3123. * | frag info offset | rx attention offset |
  3124. * |---------------------------------------------------------------|
  3125. * payload 2, if present, has the same format as payload 1
  3126. * Header fields:
  3127. * - MSG_TYPE
  3128. * Bits 7:0
  3129. * Purpose: identifies this as an rx ring configuration message
  3130. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3131. * - NUM_RINGS
  3132. * Bits 15:8
  3133. * Purpose: indicates whether the host is setting up one rx ring or two
  3134. * Value: 1 or 2
  3135. * Payload:
  3136. * for systems using 64-bit format for bus addresses:
  3137. * - IDX_SHADOW_REG_PADDR_LO
  3138. * Bits 31:0
  3139. * Value: lower 4 bytes of physical address of the host's
  3140. * FW_IDX shadow register
  3141. * - IDX_SHADOW_REG_PADDR_HI
  3142. * Bits 31:0
  3143. * Value: upper 4 bytes of physical address of the host's
  3144. * FW_IDX shadow register
  3145. * - RING_BASE_PADDR_LO
  3146. * Bits 31:0
  3147. * Value: lower 4 bytes of physical address of the host's rx ring
  3148. * - RING_BASE_PADDR_HI
  3149. * Bits 31:0
  3150. * Value: uppper 4 bytes of physical address of the host's rx ring
  3151. * for systems using 32-bit format for bus addresses:
  3152. * - IDX_SHADOW_REG_PADDR
  3153. * Bits 31:0
  3154. * Value: physical address of the host's FW_IDX shadow register
  3155. * - RING_BASE_PADDR
  3156. * Bits 31:0
  3157. * Value: physical address of the host's rx ring
  3158. * - RING_LEN
  3159. * Bits 15:0
  3160. * Value: number of elements in the rx ring
  3161. * - RING_BUF_SZ
  3162. * Bits 31:16
  3163. * Value: size of the buffers referenced by the rx ring, in byte units
  3164. * - ENABLED_FLAGS
  3165. * Bits 15:0
  3166. * Value: 1-bit flags to show whether different rx fields are enabled
  3167. * bit 0: 802.11 header enabled (1) or disabled (0)
  3168. * bit 1: MSDU payload enabled (1) or disabled (0)
  3169. * bit 2: PPDU start enabled (1) or disabled (0)
  3170. * bit 3: PPDU end enabled (1) or disabled (0)
  3171. * bit 4: MPDU start enabled (1) or disabled (0)
  3172. * bit 5: MPDU end enabled (1) or disabled (0)
  3173. * bit 6: MSDU start enabled (1) or disabled (0)
  3174. * bit 7: MSDU end enabled (1) or disabled (0)
  3175. * bit 8: rx attention enabled (1) or disabled (0)
  3176. * bit 9: frag info enabled (1) or disabled (0)
  3177. * bit 10: unicast rx enabled (1) or disabled (0)
  3178. * bit 11: multicast rx enabled (1) or disabled (0)
  3179. * bit 12: ctrl rx enabled (1) or disabled (0)
  3180. * bit 13: mgmt rx enabled (1) or disabled (0)
  3181. * bit 14: null rx enabled (1) or disabled (0)
  3182. * bit 15: phy data rx enabled (1) or disabled (0)
  3183. * - IDX_INIT_VAL
  3184. * Bits 31:16
  3185. * Purpose: Specify the initial value for the FW_IDX.
  3186. * Value: the number of buffers initially present in the host's rx ring
  3187. * - OFFSET_802_11_HDR
  3188. * Bits 15:0
  3189. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3190. * - OFFSET_MSDU_PAYLOAD
  3191. * Bits 31:16
  3192. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3193. * - OFFSET_PPDU_START
  3194. * Bits 15:0
  3195. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3196. * - OFFSET_PPDU_END
  3197. * Bits 31:16
  3198. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3199. * - OFFSET_MPDU_START
  3200. * Bits 15:0
  3201. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3202. * - OFFSET_MPDU_END
  3203. * Bits 31:16
  3204. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3205. * - OFFSET_MSDU_START
  3206. * Bits 15:0
  3207. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3208. * - OFFSET_MSDU_END
  3209. * Bits 31:16
  3210. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3211. * - OFFSET_RX_ATTN
  3212. * Bits 15:0
  3213. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3214. * - OFFSET_FRAG_INFO
  3215. * Bits 31:16
  3216. * Value: offset in QUAD-bytes of frag info table
  3217. */
  3218. /* header fields */
  3219. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3220. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3221. /* payload fields */
  3222. /* for systems using a 64-bit format for bus addresses */
  3223. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3224. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3225. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3226. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3227. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3228. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3229. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3230. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3231. /* for systems using a 32-bit format for bus addresses */
  3232. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3233. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3234. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3235. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3236. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3237. #define HTT_RX_RING_CFG_LEN_S 0
  3238. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3239. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3240. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3241. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3242. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3243. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3244. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3245. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3246. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3247. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3248. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3249. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3250. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3251. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3252. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3253. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3254. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3255. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3256. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3257. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3258. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3259. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3260. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3261. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3262. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3263. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3264. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3265. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3266. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3267. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3268. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3269. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3270. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3271. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3272. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3273. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3274. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3275. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3276. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3277. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3278. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3279. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3280. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3281. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3282. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3283. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3284. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3285. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3286. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3287. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3288. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3289. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3290. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3291. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3292. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3293. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3294. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3295. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3296. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3297. #if HTT_PADDR64
  3298. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3299. #else
  3300. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3301. #endif
  3302. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3303. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3304. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3305. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3306. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3307. do { \
  3308. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3309. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3310. } while (0)
  3311. /* degenerate case for 32-bit fields */
  3312. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3313. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3314. ((_var) = (_val))
  3315. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3316. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3317. ((_var) = (_val))
  3318. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3319. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3320. ((_var) = (_val))
  3321. /* degenerate case for 32-bit fields */
  3322. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3323. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3324. ((_var) = (_val))
  3325. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3326. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3327. ((_var) = (_val))
  3328. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3329. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3330. ((_var) = (_val))
  3331. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3332. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3333. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3334. do { \
  3335. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3336. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3337. } while (0)
  3338. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3339. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3340. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3341. do { \
  3342. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3343. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3344. } while (0)
  3345. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3346. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3347. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3348. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3349. do { \
  3350. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3351. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3352. } while (0)
  3353. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3354. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3355. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3356. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3357. do { \
  3358. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3359. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3360. } while (0)
  3361. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3362. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3363. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3364. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3365. do { \
  3366. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3367. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3368. } while (0)
  3369. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3370. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3371. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3372. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3373. do { \
  3374. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3375. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3376. } while (0)
  3377. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3378. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3379. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3380. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3381. do { \
  3382. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3383. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3384. } while (0)
  3385. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3386. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3387. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3388. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3391. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3392. } while (0)
  3393. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3394. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3395. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3396. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3397. do { \
  3398. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3399. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3400. } while (0)
  3401. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3402. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3403. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3404. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3405. do { \
  3406. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3407. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3408. } while (0)
  3409. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3410. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3411. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3412. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3413. do { \
  3414. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3415. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3416. } while (0)
  3417. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3418. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3419. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3420. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3421. do { \
  3422. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3423. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3424. } while (0)
  3425. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3426. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3427. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3428. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3429. do { \
  3430. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3431. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3432. } while (0)
  3433. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3434. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3435. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3436. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3437. do { \
  3438. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3439. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3440. } while (0)
  3441. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3442. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3443. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3444. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3447. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3448. } while (0)
  3449. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3450. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3451. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3452. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3455. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3456. } while (0)
  3457. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3458. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3459. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3460. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3463. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3464. } while (0)
  3465. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3466. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3467. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3468. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3469. do { \
  3470. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3471. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3472. } while (0)
  3473. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3474. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3475. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3476. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3479. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3480. } while (0)
  3481. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3482. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3483. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3484. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3487. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3488. } while (0)
  3489. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3490. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3491. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3492. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3495. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3496. } while (0)
  3497. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3498. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3499. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3500. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3503. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3504. } while (0)
  3505. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3506. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3507. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3508. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3511. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3512. } while (0)
  3513. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3514. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3515. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3516. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3519. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3520. } while (0)
  3521. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3522. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3523. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3524. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3527. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3528. } while (0)
  3529. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3530. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3531. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3532. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3535. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3536. } while (0)
  3537. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3538. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3539. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3540. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3543. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3544. } while (0)
  3545. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3546. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3547. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3548. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3551. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3552. } while (0)
  3553. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3554. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3555. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3556. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3559. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3560. } while (0)
  3561. /**
  3562. * @brief host -> target FW statistics retrieve
  3563. *
  3564. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3565. *
  3566. * @details
  3567. * The following field definitions describe the format of the HTT host
  3568. * to target FW stats retrieve message. The message specifies the type of
  3569. * stats host wants to retrieve.
  3570. *
  3571. * |31 24|23 16|15 8|7 0|
  3572. * |-----------------------------------------------------------|
  3573. * | stats types request bitmask | msg type |
  3574. * |-----------------------------------------------------------|
  3575. * | stats types reset bitmask | reserved |
  3576. * |-----------------------------------------------------------|
  3577. * | stats type | config value |
  3578. * |-----------------------------------------------------------|
  3579. * | cookie LSBs |
  3580. * |-----------------------------------------------------------|
  3581. * | cookie MSBs |
  3582. * |-----------------------------------------------------------|
  3583. * Header fields:
  3584. * - MSG_TYPE
  3585. * Bits 7:0
  3586. * Purpose: identifies this is a stats upload request message
  3587. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3588. * - UPLOAD_TYPES
  3589. * Bits 31:8
  3590. * Purpose: identifies which types of FW statistics to upload
  3591. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3592. * - RESET_TYPES
  3593. * Bits 31:8
  3594. * Purpose: identifies which types of FW statistics to reset
  3595. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3596. * - CFG_VAL
  3597. * Bits 23:0
  3598. * Purpose: give an opaque configuration value to the specified stats type
  3599. * Value: stats-type specific configuration value
  3600. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3601. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3602. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3603. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3604. * - CFG_STAT_TYPE
  3605. * Bits 31:24
  3606. * Purpose: specify which stats type (if any) the config value applies to
  3607. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3608. * a valid configuration specification
  3609. * - COOKIE_LSBS
  3610. * Bits 31:0
  3611. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3612. * message with its preceding host->target stats request message.
  3613. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3614. * - COOKIE_MSBS
  3615. * Bits 31:0
  3616. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3617. * message with its preceding host->target stats request message.
  3618. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3619. */
  3620. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3621. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3622. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3623. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3624. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3625. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3626. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3627. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3628. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3629. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3630. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3631. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3632. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3633. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3634. do { \
  3635. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3636. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3637. } while (0)
  3638. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3639. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3640. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3641. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3642. do { \
  3643. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3644. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3645. } while (0)
  3646. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3647. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3648. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3649. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3652. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3653. } while (0)
  3654. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3655. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3656. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3657. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3660. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3661. } while (0)
  3662. /**
  3663. * @brief host -> target HTT out-of-band sync request
  3664. *
  3665. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3666. *
  3667. * @details
  3668. * The HTT SYNC tells the target to suspend processing of subsequent
  3669. * HTT host-to-target messages until some other target agent locally
  3670. * informs the target HTT FW that the current sync counter is equal to
  3671. * or greater than (in a modulo sense) the sync counter specified in
  3672. * the SYNC message.
  3673. * This allows other host-target components to synchronize their operation
  3674. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3675. * security key has been downloaded to and activated by the target.
  3676. * In the absence of any explicit synchronization counter value
  3677. * specification, the target HTT FW will use zero as the default current
  3678. * sync value.
  3679. *
  3680. * |31 24|23 16|15 8|7 0|
  3681. * |-----------------------------------------------------------|
  3682. * | reserved | sync count | msg type |
  3683. * |-----------------------------------------------------------|
  3684. * Header fields:
  3685. * - MSG_TYPE
  3686. * Bits 7:0
  3687. * Purpose: identifies this as a sync message
  3688. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3689. * - SYNC_COUNT
  3690. * Bits 15:8
  3691. * Purpose: specifies what sync value the HTT FW will wait for from
  3692. * an out-of-band specification to resume its operation
  3693. * Value: in-band sync counter value to compare against the out-of-band
  3694. * counter spec.
  3695. * The HTT target FW will suspend its host->target message processing
  3696. * as long as
  3697. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3698. */
  3699. #define HTT_H2T_SYNC_MSG_SZ 4
  3700. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3701. #define HTT_H2T_SYNC_COUNT_S 8
  3702. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3703. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3704. HTT_H2T_SYNC_COUNT_S)
  3705. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3706. do { \
  3707. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3708. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3709. } while (0)
  3710. /**
  3711. * @brief host -> target HTT aggregation configuration
  3712. *
  3713. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3714. */
  3715. #define HTT_AGGR_CFG_MSG_SZ 4
  3716. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3717. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3718. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3719. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3720. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3721. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3722. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3723. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3724. do { \
  3725. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3726. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3727. } while (0)
  3728. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3729. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3730. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3731. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3732. do { \
  3733. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3734. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3735. } while (0)
  3736. /**
  3737. * @brief host -> target HTT configure max amsdu info per vdev
  3738. *
  3739. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3740. *
  3741. * @details
  3742. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3743. *
  3744. * |31 21|20 16|15 8|7 0|
  3745. * |-----------------------------------------------------------|
  3746. * | reserved | vdev id | max amsdu | msg type |
  3747. * |-----------------------------------------------------------|
  3748. * Header fields:
  3749. * - MSG_TYPE
  3750. * Bits 7:0
  3751. * Purpose: identifies this as a aggr cfg ex message
  3752. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3753. * - MAX_NUM_AMSDU_SUBFRM
  3754. * Bits 15:8
  3755. * Purpose: max MSDUs per A-MSDU
  3756. * - VDEV_ID
  3757. * Bits 20:16
  3758. * Purpose: ID of the vdev to which this limit is applied
  3759. */
  3760. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3761. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3762. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3763. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3764. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3765. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3766. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3767. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3768. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3771. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3772. } while (0)
  3773. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3774. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3775. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3776. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3779. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3780. } while (0)
  3781. /**
  3782. * @brief HTT WDI_IPA Config Message
  3783. *
  3784. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3785. *
  3786. * @details
  3787. * The HTT WDI_IPA config message is created/sent by host at driver
  3788. * init time. It contains information about data structures used on
  3789. * WDI_IPA TX and RX path.
  3790. * TX CE ring is used for pushing packet metadata from IPA uC
  3791. * to WLAN FW
  3792. * TX Completion ring is used for generating TX completions from
  3793. * WLAN FW to IPA uC
  3794. * RX Indication ring is used for indicating RX packets from FW
  3795. * to IPA uC
  3796. * RX Ring2 is used as either completion ring or as second
  3797. * indication ring. when Ring2 is used as completion ring, IPA uC
  3798. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3799. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3800. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3801. * indicated in RX Indication ring. Please see WDI_IPA specification
  3802. * for more details.
  3803. * |31 24|23 16|15 8|7 0|
  3804. * |----------------+----------------+----------------+----------------|
  3805. * | tx pkt pool size | Rsvd | msg_type |
  3806. * |-------------------------------------------------------------------|
  3807. * | tx comp ring base (bits 31:0) |
  3808. #if HTT_PADDR64
  3809. * | tx comp ring base (bits 63:32) |
  3810. #endif
  3811. * |-------------------------------------------------------------------|
  3812. * | tx comp ring size |
  3813. * |-------------------------------------------------------------------|
  3814. * | tx comp WR_IDX physical address (bits 31:0) |
  3815. #if HTT_PADDR64
  3816. * | tx comp WR_IDX physical address (bits 63:32) |
  3817. #endif
  3818. * |-------------------------------------------------------------------|
  3819. * | tx CE WR_IDX physical address (bits 31:0) |
  3820. #if HTT_PADDR64
  3821. * | tx CE WR_IDX physical address (bits 63:32) |
  3822. #endif
  3823. * |-------------------------------------------------------------------|
  3824. * | rx indication ring base (bits 31:0) |
  3825. #if HTT_PADDR64
  3826. * | rx indication ring base (bits 63:32) |
  3827. #endif
  3828. * |-------------------------------------------------------------------|
  3829. * | rx indication ring size |
  3830. * |-------------------------------------------------------------------|
  3831. * | rx ind RD_IDX physical address (bits 31:0) |
  3832. #if HTT_PADDR64
  3833. * | rx ind RD_IDX physical address (bits 63:32) |
  3834. #endif
  3835. * |-------------------------------------------------------------------|
  3836. * | rx ind WR_IDX physical address (bits 31:0) |
  3837. #if HTT_PADDR64
  3838. * | rx ind WR_IDX physical address (bits 63:32) |
  3839. #endif
  3840. * |-------------------------------------------------------------------|
  3841. * |-------------------------------------------------------------------|
  3842. * | rx ring2 base (bits 31:0) |
  3843. #if HTT_PADDR64
  3844. * | rx ring2 base (bits 63:32) |
  3845. #endif
  3846. * |-------------------------------------------------------------------|
  3847. * | rx ring2 size |
  3848. * |-------------------------------------------------------------------|
  3849. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3850. #if HTT_PADDR64
  3851. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3852. #endif
  3853. * |-------------------------------------------------------------------|
  3854. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3855. #if HTT_PADDR64
  3856. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3857. #endif
  3858. * |-------------------------------------------------------------------|
  3859. *
  3860. * Header fields:
  3861. * Header fields:
  3862. * - MSG_TYPE
  3863. * Bits 7:0
  3864. * Purpose: Identifies this as WDI_IPA config message
  3865. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3866. * - TX_PKT_POOL_SIZE
  3867. * Bits 15:0
  3868. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3869. * WDI_IPA TX path
  3870. * For systems using 32-bit format for bus addresses:
  3871. * - TX_COMP_RING_BASE_ADDR
  3872. * Bits 31:0
  3873. * Purpose: TX Completion Ring base address in DDR
  3874. * - TX_COMP_RING_SIZE
  3875. * Bits 31:0
  3876. * Purpose: TX Completion Ring size (must be power of 2)
  3877. * - TX_COMP_WR_IDX_ADDR
  3878. * Bits 31:0
  3879. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3880. * updates the Write Index for WDI_IPA TX completion ring
  3881. * - TX_CE_WR_IDX_ADDR
  3882. * Bits 31:0
  3883. * Purpose: DDR address where IPA uC
  3884. * updates the WR Index for TX CE ring
  3885. * (needed for fusion platforms)
  3886. * - RX_IND_RING_BASE_ADDR
  3887. * Bits 31:0
  3888. * Purpose: RX Indication Ring base address in DDR
  3889. * - RX_IND_RING_SIZE
  3890. * Bits 31:0
  3891. * Purpose: RX Indication Ring size
  3892. * - RX_IND_RD_IDX_ADDR
  3893. * Bits 31:0
  3894. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3895. * RX indication ring
  3896. * - RX_IND_WR_IDX_ADDR
  3897. * Bits 31:0
  3898. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3899. * updates the Write Index for WDI_IPA RX indication ring
  3900. * - RX_RING2_BASE_ADDR
  3901. * Bits 31:0
  3902. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3903. * - RX_RING2_SIZE
  3904. * Bits 31:0
  3905. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3906. * - RX_RING2_RD_IDX_ADDR
  3907. * Bits 31:0
  3908. * Purpose: If Second RX ring is Indication ring, DDR address where
  3909. * IPA uC updates the Read Index for Ring2.
  3910. * If Second RX ring is completion ring, this is NOT used
  3911. * - RX_RING2_WR_IDX_ADDR
  3912. * Bits 31:0
  3913. * Purpose: If Second RX ring is Indication ring, DDR address where
  3914. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3915. * If second RX ring is completion ring, DDR address where
  3916. * IPA uC updates the Write Index for Ring 2.
  3917. * For systems using 64-bit format for bus addresses:
  3918. * - TX_COMP_RING_BASE_ADDR_LO
  3919. * Bits 31:0
  3920. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3921. * - TX_COMP_RING_BASE_ADDR_HI
  3922. * Bits 31:0
  3923. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3924. * - TX_COMP_RING_SIZE
  3925. * Bits 31:0
  3926. * Purpose: TX Completion Ring size (must be power of 2)
  3927. * - TX_COMP_WR_IDX_ADDR_LO
  3928. * Bits 31:0
  3929. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3930. * Lower 4 bytes of DDR address where WIFI FW
  3931. * updates the Write Index for WDI_IPA TX completion ring
  3932. * - TX_COMP_WR_IDX_ADDR_HI
  3933. * Bits 31:0
  3934. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3935. * Higher 4 bytes of DDR address where WIFI FW
  3936. * updates the Write Index for WDI_IPA TX completion ring
  3937. * - TX_CE_WR_IDX_ADDR_LO
  3938. * Bits 31:0
  3939. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3940. * updates the WR Index for TX CE ring
  3941. * (needed for fusion platforms)
  3942. * - TX_CE_WR_IDX_ADDR_HI
  3943. * Bits 31:0
  3944. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3945. * updates the WR Index for TX CE ring
  3946. * (needed for fusion platforms)
  3947. * - RX_IND_RING_BASE_ADDR_LO
  3948. * Bits 31:0
  3949. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3950. * - RX_IND_RING_BASE_ADDR_HI
  3951. * Bits 31:0
  3952. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3953. * - RX_IND_RING_SIZE
  3954. * Bits 31:0
  3955. * Purpose: RX Indication Ring size
  3956. * - RX_IND_RD_IDX_ADDR_LO
  3957. * Bits 31:0
  3958. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3959. * for WDI_IPA RX indication ring
  3960. * - RX_IND_RD_IDX_ADDR_HI
  3961. * Bits 31:0
  3962. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3963. * for WDI_IPA RX indication ring
  3964. * - RX_IND_WR_IDX_ADDR_LO
  3965. * Bits 31:0
  3966. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3967. * Lower 4 bytes of DDR address where WIFI FW
  3968. * updates the Write Index for WDI_IPA RX indication ring
  3969. * - RX_IND_WR_IDX_ADDR_HI
  3970. * Bits 31:0
  3971. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3972. * Higher 4 bytes of DDR address where WIFI FW
  3973. * updates the Write Index for WDI_IPA RX indication ring
  3974. * - RX_RING2_BASE_ADDR_LO
  3975. * Bits 31:0
  3976. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3977. * - RX_RING2_BASE_ADDR_HI
  3978. * Bits 31:0
  3979. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3980. * - RX_RING2_SIZE
  3981. * Bits 31:0
  3982. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3983. * - RX_RING2_RD_IDX_ADDR_LO
  3984. * Bits 31:0
  3985. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3986. * DDR address where IPA uC updates the Read Index for Ring2.
  3987. * If Second RX ring is completion ring, this is NOT used
  3988. * - RX_RING2_RD_IDX_ADDR_HI
  3989. * Bits 31:0
  3990. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3991. * DDR address where IPA uC updates the Read Index for Ring2.
  3992. * If Second RX ring is completion ring, this is NOT used
  3993. * - RX_RING2_WR_IDX_ADDR_LO
  3994. * Bits 31:0
  3995. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3996. * DDR address where WIFI FW updates the Write Index
  3997. * for WDI_IPA RX ring2
  3998. * If second RX ring is completion ring, lower 4 bytes of
  3999. * DDR address where IPA uC updates the Write Index for Ring 2.
  4000. * - RX_RING2_WR_IDX_ADDR_HI
  4001. * Bits 31:0
  4002. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4003. * DDR address where WIFI FW updates the Write Index
  4004. * for WDI_IPA RX ring2
  4005. * If second RX ring is completion ring, higher 4 bytes of
  4006. * DDR address where IPA uC updates the Write Index for Ring 2.
  4007. */
  4008. #if HTT_PADDR64
  4009. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4010. #else
  4011. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4012. #endif
  4013. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4014. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4015. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4016. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4017. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4018. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4019. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4021. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4023. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4027. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4029. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4031. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4033. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4035. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4037. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4075. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4076. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4077. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4080. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4081. } while (0)
  4082. /* for systems using 32-bit format for bus addr */
  4083. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4084. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4085. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4086. do { \
  4087. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4088. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4089. } while (0)
  4090. /* for systems using 64-bit format for bus addr */
  4091. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4092. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4096. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4097. } while (0)
  4098. /* for systems using 64-bit format for bus addr */
  4099. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4100. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4101. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4104. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4105. } while (0)
  4106. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4107. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4109. do { \
  4110. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4111. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4112. } while (0)
  4113. /* for systems using 32-bit format for bus addr */
  4114. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4115. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4117. do { \
  4118. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4119. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4120. } while (0)
  4121. /* for systems using 64-bit format for bus addr */
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4123. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4125. do { \
  4126. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4127. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4128. } while (0)
  4129. /* for systems using 64-bit format for bus addr */
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4131. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4135. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4136. } while (0)
  4137. /* for systems using 32-bit format for bus addr */
  4138. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4139. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4140. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4143. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4144. } while (0)
  4145. /* for systems using 64-bit format for bus addr */
  4146. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4147. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4148. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4151. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4152. } while (0)
  4153. /* for systems using 64-bit format for bus addr */
  4154. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4155. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4156. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4159. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4160. } while (0)
  4161. /* for systems using 32-bit format for bus addr */
  4162. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4163. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4164. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4167. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4168. } while (0)
  4169. /* for systems using 64-bit format for bus addr */
  4170. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4172. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4176. } while (0)
  4177. /* for systems using 64-bit format for bus addr */
  4178. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4180. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4184. } while (0)
  4185. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4186. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4190. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4191. } while (0)
  4192. /* for systems using 32-bit format for bus addr */
  4193. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4194. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4198. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4199. } while (0)
  4200. /* for systems using 64-bit format for bus addr */
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4202. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4206. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4207. } while (0)
  4208. /* for systems using 64-bit format for bus addr */
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4210. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4214. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4215. } while (0)
  4216. /* for systems using 32-bit format for bus addr */
  4217. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4218. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4219. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4223. } while (0)
  4224. /* for systems using 64-bit format for bus addr */
  4225. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4226. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4227. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4231. } while (0)
  4232. /* for systems using 64-bit format for bus addr */
  4233. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4234. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4235. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4238. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4239. } while (0)
  4240. /* for systems using 32-bit format for bus addr */
  4241. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4242. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4243. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4246. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4247. } while (0)
  4248. /* for systems using 64-bit format for bus addr */
  4249. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4255. } while (0)
  4256. /* for systems using 64-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4259. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4263. } while (0)
  4264. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4265. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4269. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4270. } while (0)
  4271. /* for systems using 32-bit format for bus addr */
  4272. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4273. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4275. do { \
  4276. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4277. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4278. } while (0)
  4279. /* for systems using 64-bit format for bus addr */
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4281. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4283. do { \
  4284. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4285. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4286. } while (0)
  4287. /* for systems using 64-bit format for bus addr */
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4289. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4294. } while (0)
  4295. /* for systems using 32-bit format for bus addr */
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4297. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4301. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4302. } while (0)
  4303. /* for systems using 64-bit format for bus addr */
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4305. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4309. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4310. } while (0)
  4311. /* for systems using 64-bit format for bus addr */
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4313. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4317. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4318. } while (0)
  4319. /*
  4320. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4321. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4322. * addresses are stored in a XXX-bit field.
  4323. * This macro is used to define both htt_wdi_ipa_config32_t and
  4324. * htt_wdi_ipa_config64_t structs.
  4325. */
  4326. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4327. _paddr__tx_comp_ring_base_addr_, \
  4328. _paddr__tx_comp_wr_idx_addr_, \
  4329. _paddr__tx_ce_wr_idx_addr_, \
  4330. _paddr__rx_ind_ring_base_addr_, \
  4331. _paddr__rx_ind_rd_idx_addr_, \
  4332. _paddr__rx_ind_wr_idx_addr_, \
  4333. _paddr__rx_ring2_base_addr_,\
  4334. _paddr__rx_ring2_rd_idx_addr_,\
  4335. _paddr__rx_ring2_wr_idx_addr_) \
  4336. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4337. { \
  4338. /* DWORD 0: flags and meta-data */ \
  4339. A_UINT32 \
  4340. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4341. reserved: 8, \
  4342. tx_pkt_pool_size: 16;\
  4343. /* DWORD 1 */\
  4344. _paddr__tx_comp_ring_base_addr_;\
  4345. /* DWORD 2 (or 3)*/\
  4346. A_UINT32 tx_comp_ring_size;\
  4347. /* DWORD 3 (or 4)*/\
  4348. _paddr__tx_comp_wr_idx_addr_;\
  4349. /* DWORD 4 (or 6)*/\
  4350. _paddr__tx_ce_wr_idx_addr_;\
  4351. /* DWORD 5 (or 8)*/\
  4352. _paddr__rx_ind_ring_base_addr_;\
  4353. /* DWORD 6 (or 10)*/\
  4354. A_UINT32 rx_ind_ring_size;\
  4355. /* DWORD 7 (or 11)*/\
  4356. _paddr__rx_ind_rd_idx_addr_;\
  4357. /* DWORD 8 (or 13)*/\
  4358. _paddr__rx_ind_wr_idx_addr_;\
  4359. /* DWORD 9 (or 15)*/\
  4360. _paddr__rx_ring2_base_addr_;\
  4361. /* DWORD 10 (or 17) */\
  4362. A_UINT32 rx_ring2_size;\
  4363. /* DWORD 11 (or 18) */\
  4364. _paddr__rx_ring2_rd_idx_addr_;\
  4365. /* DWORD 12 (or 20) */\
  4366. _paddr__rx_ring2_wr_idx_addr_;\
  4367. } POSTPACK
  4368. /* define a htt_wdi_ipa_config32_t type */
  4369. 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));
  4370. /* define a htt_wdi_ipa_config64_t type */
  4371. 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));
  4372. #if HTT_PADDR64
  4373. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4374. #else
  4375. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4376. #endif
  4377. enum htt_wdi_ipa_op_code {
  4378. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4379. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4380. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4381. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4382. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4383. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4384. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4385. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4386. /* keep this last */
  4387. HTT_WDI_IPA_OPCODE_MAX
  4388. };
  4389. /**
  4390. * @brief HTT WDI_IPA Operation Request Message
  4391. *
  4392. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4393. *
  4394. * @details
  4395. * HTT WDI_IPA Operation Request message is sent by host
  4396. * to either suspend or resume WDI_IPA TX or RX path.
  4397. * |31 24|23 16|15 8|7 0|
  4398. * |----------------+----------------+----------------+----------------|
  4399. * | op_code | Rsvd | msg_type |
  4400. * |-------------------------------------------------------------------|
  4401. *
  4402. * Header fields:
  4403. * - MSG_TYPE
  4404. * Bits 7:0
  4405. * Purpose: Identifies this as WDI_IPA Operation Request message
  4406. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4407. * - OP_CODE
  4408. * Bits 31:16
  4409. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4410. * value: = enum htt_wdi_ipa_op_code
  4411. */
  4412. PREPACK struct htt_wdi_ipa_op_request_t
  4413. {
  4414. /* DWORD 0: flags and meta-data */
  4415. A_UINT32
  4416. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4417. reserved: 8,
  4418. op_code: 16;
  4419. } POSTPACK;
  4420. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4421. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4422. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4423. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4424. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4425. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4426. do { \
  4427. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4428. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4429. } while (0)
  4430. /*
  4431. * @brief host -> target HTT_MSI_SETUP message
  4432. *
  4433. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4434. *
  4435. * @details
  4436. * After target is booted up, host can send MSI setup message so that
  4437. * target sets up HW registers based on setup message.
  4438. *
  4439. * The message would appear as follows:
  4440. * |31 24|23 16|15|14 8|7 0|
  4441. * |---------------+-----------------+-----------------+-----------------|
  4442. * | reserved | msi_type | pdev_id | msg_type |
  4443. * |---------------------------------------------------------------------|
  4444. * | msi_addr_lo |
  4445. * |---------------------------------------------------------------------|
  4446. * | msi_addr_hi |
  4447. * |---------------------------------------------------------------------|
  4448. * | msi_data |
  4449. * |---------------------------------------------------------------------|
  4450. *
  4451. * The message is interpreted as follows:
  4452. * dword0 - b'0:7 - msg_type: This will be set to
  4453. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4454. * b'8:15 - pdev_id:
  4455. * 0 (for rings at SOC/UMAC level),
  4456. * 1/2/3 mac id (for rings at LMAC level)
  4457. * b'16:23 - msi_type: identify which msi registers need to be setup
  4458. * more details can be got from enum htt_msi_setup_type
  4459. * b'24:31 - reserved
  4460. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4461. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4462. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4463. */
  4464. PREPACK struct htt_msi_setup_t {
  4465. A_UINT32 msg_type: 8,
  4466. pdev_id: 8,
  4467. msi_type: 8,
  4468. reserved: 8;
  4469. A_UINT32 msi_addr_lo;
  4470. A_UINT32 msi_addr_hi;
  4471. A_UINT32 msi_data;
  4472. } POSTPACK;
  4473. enum htt_msi_setup_type {
  4474. HTT_PPDU_END_MSI_SETUP_TYPE,
  4475. /* Insert new types here*/
  4476. };
  4477. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4478. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4479. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4480. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4481. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4482. HTT_MSI_SETUP_PDEV_ID_S)
  4483. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4484. do { \
  4485. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4486. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4487. } while (0)
  4488. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4489. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4490. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4491. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4492. HTT_MSI_SETUP_MSI_TYPE_S)
  4493. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4494. do { \
  4495. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4496. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4497. } while (0)
  4498. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4499. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4500. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4501. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4502. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4503. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4504. do { \
  4505. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4506. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4507. } while (0)
  4508. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4509. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4510. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4511. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4512. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4513. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4514. do { \
  4515. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4516. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4517. } while (0)
  4518. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4519. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4520. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4521. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4522. HTT_MSI_SETUP_MSI_DATA_S)
  4523. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4524. do { \
  4525. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4526. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4527. } while (0)
  4528. /*
  4529. * @brief host -> target HTT_SRING_SETUP message
  4530. *
  4531. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4532. *
  4533. * @details
  4534. * After target is booted up, Host can send SRING setup message for
  4535. * each host facing LMAC SRING. Target setups up HW registers based
  4536. * on setup message and confirms back to Host if response_required is set.
  4537. * Host should wait for confirmation message before sending new SRING
  4538. * setup message
  4539. *
  4540. * The message would appear as follows:
  4541. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4542. * |--------------- +-----------------+-----------------+-----------------|
  4543. * | ring_type | ring_id | pdev_id | msg_type |
  4544. * |----------------------------------------------------------------------|
  4545. * | ring_base_addr_lo |
  4546. * |----------------------------------------------------------------------|
  4547. * | ring_base_addr_hi |
  4548. * |----------------------------------------------------------------------|
  4549. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4550. * |----------------------------------------------------------------------|
  4551. * | ring_head_offset32_remote_addr_lo |
  4552. * |----------------------------------------------------------------------|
  4553. * | ring_head_offset32_remote_addr_hi |
  4554. * |----------------------------------------------------------------------|
  4555. * | ring_tail_offset32_remote_addr_lo |
  4556. * |----------------------------------------------------------------------|
  4557. * | ring_tail_offset32_remote_addr_hi |
  4558. * |----------------------------------------------------------------------|
  4559. * | ring_msi_addr_lo |
  4560. * |----------------------------------------------------------------------|
  4561. * | ring_msi_addr_hi |
  4562. * |----------------------------------------------------------------------|
  4563. * | ring_msi_data |
  4564. * |----------------------------------------------------------------------|
  4565. * | intr_timer_th |IM| intr_batch_counter_th |
  4566. * |----------------------------------------------------------------------|
  4567. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4568. * |----------------------------------------------------------------------|
  4569. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4570. * |----------------------------------------------------------------------|
  4571. * Where
  4572. * IM = sw_intr_mode
  4573. * RR = response_required
  4574. * PTCF = prefetch_timer_cfg
  4575. * IP = IPA drop flag
  4576. *
  4577. * The message is interpreted as follows:
  4578. * dword0 - b'0:7 - msg_type: This will be set to
  4579. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4580. * b'8:15 - pdev_id:
  4581. * 0 (for rings at SOC/UMAC level),
  4582. * 1/2/3 mac id (for rings at LMAC level)
  4583. * b'16:23 - ring_id: identify which ring is to setup,
  4584. * more details can be got from enum htt_srng_ring_id
  4585. * b'24:31 - ring_type: identify type of host rings,
  4586. * more details can be got from enum htt_srng_ring_type
  4587. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4588. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4589. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4590. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4591. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4592. * SW_TO_HW_RING.
  4593. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4594. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4595. * Lower 32 bits of memory address of the remote variable
  4596. * storing the 4-byte word offset that identifies the head
  4597. * element within the ring.
  4598. * (The head offset variable has type A_UINT32.)
  4599. * Valid for HW_TO_SW and SW_TO_SW rings.
  4600. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4601. * Upper 32 bits of memory address of the remote variable
  4602. * storing the 4-byte word offset that identifies the head
  4603. * element within the ring.
  4604. * (The head offset variable has type A_UINT32.)
  4605. * Valid for HW_TO_SW and SW_TO_SW rings.
  4606. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4607. * Lower 32 bits of memory address of the remote variable
  4608. * storing the 4-byte word offset that identifies the tail
  4609. * element within the ring.
  4610. * (The tail offset variable has type A_UINT32.)
  4611. * Valid for HW_TO_SW and SW_TO_SW rings.
  4612. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4613. * Upper 32 bits of memory address of the remote variable
  4614. * storing the 4-byte word offset that identifies the tail
  4615. * element within the ring.
  4616. * (The tail offset variable has type A_UINT32.)
  4617. * Valid for HW_TO_SW and SW_TO_SW rings.
  4618. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4619. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4620. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4621. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4622. * dword10 - b'0:31 - ring_msi_data: MSI data
  4623. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4624. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4625. * dword11 - b'0:14 - intr_batch_counter_th:
  4626. * batch counter threshold is in units of 4-byte words.
  4627. * HW internally maintains and increments batch count.
  4628. * (see SRING spec for detail description).
  4629. * When batch count reaches threshold value, an interrupt
  4630. * is generated by HW.
  4631. * b'15 - sw_intr_mode:
  4632. * This configuration shall be static.
  4633. * Only programmed at power up.
  4634. * 0: generate pulse style sw interrupts
  4635. * 1: generate level style sw interrupts
  4636. * b'16:31 - intr_timer_th:
  4637. * The timer init value when timer is idle or is
  4638. * initialized to start downcounting.
  4639. * In 8us units (to cover a range of 0 to 524 ms)
  4640. * dword12 - b'0:15 - intr_low_threshold:
  4641. * Used only by Consumer ring to generate ring_sw_int_p.
  4642. * Ring entries low threshold water mark, that is used
  4643. * in combination with the interrupt timer as well as
  4644. * the the clearing of the level interrupt.
  4645. * b'16:18 - prefetch_timer_cfg:
  4646. * Used only by Consumer ring to set timer mode to
  4647. * support Application prefetch handling.
  4648. * The external tail offset/pointer will be updated
  4649. * at following intervals:
  4650. * 3'b000: (Prefetch feature disabled; used only for debug)
  4651. * 3'b001: 1 usec
  4652. * 3'b010: 4 usec
  4653. * 3'b011: 8 usec (default)
  4654. * 3'b100: 16 usec
  4655. * Others: Reserverd
  4656. * b'19 - response_required:
  4657. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4658. * b'20 - ipa_drop_flag:
  4659. Indicates that host will config ipa drop threshold percentage
  4660. * b'21:31 - reserved: reserved for future use
  4661. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4662. * b'8:15 - ipa drop high threshold percentage:
  4663. * b'16:31 - Reserved
  4664. */
  4665. PREPACK struct htt_sring_setup_t {
  4666. A_UINT32 msg_type: 8,
  4667. pdev_id: 8,
  4668. ring_id: 8,
  4669. ring_type: 8;
  4670. A_UINT32 ring_base_addr_lo;
  4671. A_UINT32 ring_base_addr_hi;
  4672. A_UINT32 ring_size: 16,
  4673. ring_entry_size: 8,
  4674. ring_misc_cfg_flag: 8;
  4675. A_UINT32 ring_head_offset32_remote_addr_lo;
  4676. A_UINT32 ring_head_offset32_remote_addr_hi;
  4677. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4678. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4679. A_UINT32 ring_msi_addr_lo;
  4680. A_UINT32 ring_msi_addr_hi;
  4681. A_UINT32 ring_msi_data;
  4682. A_UINT32 intr_batch_counter_th: 15,
  4683. sw_intr_mode: 1,
  4684. intr_timer_th: 16;
  4685. A_UINT32 intr_low_threshold: 16,
  4686. prefetch_timer_cfg: 3,
  4687. response_required: 1,
  4688. ipa_drop_flag: 1,
  4689. reserved1: 11;
  4690. A_UINT32 ipa_drop_low_threshold: 8,
  4691. ipa_drop_high_threshold: 8,
  4692. reserved: 16;
  4693. } POSTPACK;
  4694. enum htt_srng_ring_type {
  4695. HTT_HW_TO_SW_RING = 0,
  4696. HTT_SW_TO_HW_RING,
  4697. HTT_SW_TO_SW_RING,
  4698. /* Insert new ring types above this line */
  4699. };
  4700. enum htt_srng_ring_id {
  4701. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4702. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4703. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4704. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4705. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4706. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4707. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4708. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4709. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4710. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4711. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4712. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4713. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4714. /* Add Other SRING which can't be directly configured by host software above this line */
  4715. };
  4716. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4717. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4718. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4719. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4720. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4721. HTT_SRING_SETUP_PDEV_ID_S)
  4722. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4723. do { \
  4724. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4725. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4726. } while (0)
  4727. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4728. #define HTT_SRING_SETUP_RING_ID_S 16
  4729. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4730. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4731. HTT_SRING_SETUP_RING_ID_S)
  4732. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4733. do { \
  4734. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4735. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4736. } while (0)
  4737. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4738. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4739. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4740. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4741. HTT_SRING_SETUP_RING_TYPE_S)
  4742. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4743. do { \
  4744. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4745. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4746. } while (0)
  4747. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4748. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4749. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4750. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4751. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4752. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4753. do { \
  4754. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4755. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4756. } while (0)
  4757. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4758. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4759. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4760. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4761. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4762. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4765. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4766. } while (0)
  4767. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4768. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4769. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4770. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4771. HTT_SRING_SETUP_RING_SIZE_S)
  4772. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4775. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4776. } while (0)
  4777. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4778. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4779. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4780. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4781. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4782. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4783. do { \
  4784. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4785. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4786. } while (0)
  4787. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4788. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4789. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4790. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4791. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4792. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4795. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4796. } while (0)
  4797. /* This control bit is applicable to only Producer, which updates Ring ID field
  4798. * of each descriptor before pushing into the ring.
  4799. * 0: updates ring_id(default)
  4800. * 1: ring_id updating disabled */
  4801. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4802. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4803. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4804. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4805. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4806. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4809. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4810. } while (0)
  4811. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4812. * of each descriptor before pushing into the ring.
  4813. * 0: updates Loopcnt(default)
  4814. * 1: Loopcnt updating disabled */
  4815. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4816. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4818. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4819. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4820. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4821. do { \
  4822. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4823. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4824. } while (0)
  4825. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4826. * into security_id port of GXI/AXI. */
  4827. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4828. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4830. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4831. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4833. do { \
  4834. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4835. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4836. } while (0)
  4837. /* During MSI write operation, SRNG drives value of this register bit into
  4838. * swap bit of GXI/AXI. */
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4840. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4842. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4843. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4845. do { \
  4846. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4847. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4848. } while (0)
  4849. /* During Pointer write operation, SRNG drives value of this register bit into
  4850. * swap bit of GXI/AXI. */
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4854. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4855. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4857. do { \
  4858. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4859. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4860. } while (0)
  4861. /* During any data or TLV write operation, SRNG drives value of this register
  4862. * bit into swap bit of GXI/AXI. */
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4864. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4866. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4867. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4871. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4872. } while (0)
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4875. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4876. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4877. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4878. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4879. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4880. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4881. do { \
  4882. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4883. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4884. } while (0)
  4885. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4886. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4887. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4888. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4889. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4890. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4891. do { \
  4892. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4893. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4894. } while (0)
  4895. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4896. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4897. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4898. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4899. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4900. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4901. do { \
  4902. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4903. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4904. } while (0)
  4905. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4906. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4907. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4908. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4909. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4910. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4911. do { \
  4912. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4913. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4914. } while (0)
  4915. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4916. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4917. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4918. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4919. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4920. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4921. do { \
  4922. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4923. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4924. } while (0)
  4925. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4926. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4927. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4928. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4929. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4930. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4931. do { \
  4932. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4933. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4934. } while (0)
  4935. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4936. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4937. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4938. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4939. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4940. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4941. do { \
  4942. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4943. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4944. } while (0)
  4945. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4946. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4947. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4948. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4949. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4950. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4951. do { \
  4952. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4953. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4954. } while (0)
  4955. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4956. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4957. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4958. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4959. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4960. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4961. do { \
  4962. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4963. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4964. } while (0)
  4965. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4966. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4967. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4968. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4969. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4970. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4971. do { \
  4972. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4973. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4974. } while (0)
  4975. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4976. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4977. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4978. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4979. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4980. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4981. do { \
  4982. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4983. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4984. } while (0)
  4985. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4986. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4987. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4988. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4989. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4990. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4991. do { \
  4992. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4993. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4994. } while (0)
  4995. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4996. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4997. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4998. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4999. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5000. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5001. do { \
  5002. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5003. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5004. } while (0)
  5005. /**
  5006. * @brief host -> target RX ring selection config message
  5007. *
  5008. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5009. *
  5010. * @details
  5011. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5012. * configure RXDMA rings.
  5013. * The configuration is per ring based and includes both packet subtypes
  5014. * and PPDU/MPDU TLVs.
  5015. *
  5016. * The message would appear as follows:
  5017. *
  5018. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5019. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5020. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5021. * |-------------------------------------------------------------------|
  5022. * | rsvd2 | ring_buffer_size |
  5023. * |-------------------------------------------------------------------|
  5024. * | packet_type_enable_flags_0 |
  5025. * |-------------------------------------------------------------------|
  5026. * | packet_type_enable_flags_1 |
  5027. * |-------------------------------------------------------------------|
  5028. * | packet_type_enable_flags_2 |
  5029. * |-------------------------------------------------------------------|
  5030. * | packet_type_enable_flags_3 |
  5031. * |-------------------------------------------------------------------|
  5032. * | tlv_filter_in_flags |
  5033. * |-------------------------------------------------------------------|
  5034. * | rx_header_offset | rx_packet_offset |
  5035. * |-------------------------------------------------------------------|
  5036. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5037. * |-------------------------------------------------------------------|
  5038. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5039. * |-------------------------------------------------------------------|
  5040. * | rsvd3 | rx_attention_offset |
  5041. * |-------------------------------------------------------------------|
  5042. * | rsvd4 | mo| fp| rx_drop_threshold |
  5043. * | |ndp|ndp| |
  5044. * |-------------------------------------------------------------------|
  5045. * Where:
  5046. * PS = pkt_swap
  5047. * SS = status_swap
  5048. * OV = rx_offsets_valid
  5049. * DT = drop_thresh_valid
  5050. * The message is interpreted as follows:
  5051. * dword0 - b'0:7 - msg_type: This will be set to
  5052. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5053. * b'8:15 - pdev_id:
  5054. * 0 (for rings at SOC/UMAC level),
  5055. * 1/2/3 mac id (for rings at LMAC level)
  5056. * b'16:23 - ring_id : Identify the ring to configure.
  5057. * More details can be got from enum htt_srng_ring_id
  5058. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5059. * BUF_RING_CFG_0 defs within HW .h files,
  5060. * e.g. wmac_top_reg_seq_hwioreg.h
  5061. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5062. * BUF_RING_CFG_0 defs within HW .h files,
  5063. * e.g. wmac_top_reg_seq_hwioreg.h
  5064. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5065. * configuration fields are valid
  5066. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5067. * rx_drop_threshold field is valid
  5068. * b'28 - rx_mon_global_en: Enable/Disable global register
  5069. 8 configuration in Rx monitor module.
  5070. * b'29:31 - rsvd1: reserved for future use
  5071. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5072. * in byte units.
  5073. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5074. * b'16:18 - config_length_mgmt (MGMT):
  5075. * Represents the length of mpdu bytes for mgmt pkt.
  5076. * valid values:
  5077. * 001 - 64bytes
  5078. * 010 - 128bytes
  5079. * 100 - 256bytes
  5080. * 111 - Full mpdu bytes
  5081. * b'19:21 - config_length_ctrl (CTRL):
  5082. * Represents the length of mpdu bytes for ctrl pkt.
  5083. * valid values:
  5084. * 001 - 64bytes
  5085. * 010 - 128bytes
  5086. * 100 - 256bytes
  5087. * 111 - Full mpdu bytes
  5088. * b'22:24 - config_length_data (DATA):
  5089. * Represents the length of mpdu bytes for data pkt.
  5090. * valid values:
  5091. * 001 - 64bytes
  5092. * 010 - 128bytes
  5093. * 100 - 256bytes
  5094. * 111 - Full mpdu bytes
  5095. * b'25:26 - rx_hdr_len:
  5096. * Specifies the number of bytes of recvd packet to copy
  5097. * into the rx_hdr tlv.
  5098. * supported values for now by host:
  5099. * 01 - 64bytes
  5100. * 10 - 128bytes
  5101. * 11 - 256bytes
  5102. * default - 128 bytes
  5103. * b'27:31 - rsvd2: Reserved for future use
  5104. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5105. * Enable MGMT packet from 0b0000 to 0b1001
  5106. * bits from low to high: FP, MD, MO - 3 bits
  5107. * FP: Filter_Pass
  5108. * MD: Monitor_Direct
  5109. * MO: Monitor_Other
  5110. * 10 mgmt subtypes * 3 bits -> 30 bits
  5111. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5112. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5113. * Enable MGMT packet from 0b1010 to 0b1111
  5114. * bits from low to high: FP, MD, MO - 3 bits
  5115. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5116. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5117. * Enable CTRL packet from 0b0000 to 0b1001
  5118. * bits from low to high: FP, MD, MO - 3 bits
  5119. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5120. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5121. * Enable CTRL packet from 0b1010 to 0b1111,
  5122. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5123. * bits from low to high: FP, MD, MO - 3 bits
  5124. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5125. * dword6 - b'0:31 - tlv_filter_in_flags:
  5126. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5127. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5128. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5129. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5130. * A value of 0 will be considered as ignore this config.
  5131. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5132. * e.g. wmac_top_reg_seq_hwioreg.h
  5133. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5134. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5135. * A value of 0 will be considered as ignore this config.
  5136. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5137. * e.g. wmac_top_reg_seq_hwioreg.h
  5138. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5139. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5140. * A value of 0 will be considered as ignore this config.
  5141. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5142. * e.g. wmac_top_reg_seq_hwioreg.h
  5143. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5144. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5145. * A value of 0 will be considered as ignore this config.
  5146. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5147. * e.g. wmac_top_reg_seq_hwioreg.h
  5148. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5149. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5150. * A value of 0 will be considered as ignore this config.
  5151. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5152. * e.g. wmac_top_reg_seq_hwioreg.h
  5153. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5154. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5155. * A value of 0 will be considered as ignore this config.
  5156. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5157. * e.g. wmac_top_reg_seq_hwioreg.h
  5158. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5159. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5160. * A value of 0 will be considered as ignore this config.
  5161. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5162. * e.g. wmac_top_reg_seq_hwioreg.h
  5163. * - b'16:31 - rsvd3 for future use
  5164. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5165. * to source rings. Consumer drops packets if the available
  5166. * words in the ring falls below the configured threshold
  5167. * value.
  5168. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5169. * by host. 1 -> subscribed
  5170. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5171. * by host. 1 -> subscribed
  5172. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5173. * subscribed by host. 1 -> subscribed
  5174. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5175. * selection for the FP PHY ERR status tlv.
  5176. * 0 - wbm2rxdma_buf_source_ring
  5177. * 1 - fw2rxdma_buf_source_ring
  5178. * 2 - sw2rxdma_buf_source_ring
  5179. * 3 - no_buffer_ring
  5180. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5181. * selection for the FP PHY ERR status tlv.
  5182. * 0 - rxdma_release_ring
  5183. * 1 - rxdma2fw_ring
  5184. * 2 - rxdma2sw_ring
  5185. * 3 - rxdma2reo_ring
  5186. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5187. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5188. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5189. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5190. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5191. * 0: MSDU level logging
  5192. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5193. * 0: MSDU level logging
  5194. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5195. * 0: MSDU level logging
  5196. * - b'23 - word_mask_compaction: enable/disable word mask for
  5197. * mpdu/msdu start/end tlvs
  5198. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5199. * manager override
  5200. * - b'25:28 - rbm_override_val: return buffer manager override value
  5201. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5202. * which have to be posted to host from phy.
  5203. * Corresponding to errors defined in
  5204. * phyrx_abort_request_reason enums 0 to 31.
  5205. * Refer to RXPCU register definition header files for the
  5206. * phyrx_abort_request_reason enum definition.
  5207. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5208. * errors which have to be posted to host from phy.
  5209. * Corresponding to errors defined in
  5210. * phyrx_abort_request_reason enums 32 to 63.
  5211. * Refer to RXPCU register definition header files for the
  5212. * phyrx_abort_request_reason enum definition.
  5213. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5214. * applicable if word mask enabled
  5215. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5216. * applicable if word mask enabled
  5217. * - b'19:31 - rsvd7
  5218. * dword15- b'0:16 - rx_msdu_end_word_mask
  5219. * - b'17:31 - rsvd5
  5220. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5221. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5222. * buffer
  5223. * 1: RX_PKT TLV logging at specified offset for the
  5224. * subsequent buffer
  5225. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5226. */
  5227. PREPACK struct htt_rx_ring_selection_cfg_t {
  5228. A_UINT32 msg_type: 8,
  5229. pdev_id: 8,
  5230. ring_id: 8,
  5231. status_swap: 1,
  5232. pkt_swap: 1,
  5233. rx_offsets_valid: 1,
  5234. drop_thresh_valid: 1,
  5235. rx_mon_global_en: 1,
  5236. rsvd1: 3;
  5237. A_UINT32 ring_buffer_size: 16,
  5238. config_length_mgmt:3,
  5239. config_length_ctrl:3,
  5240. config_length_data:3,
  5241. rx_hdr_len: 2,
  5242. rsvd2: 5;
  5243. A_UINT32 packet_type_enable_flags_0;
  5244. A_UINT32 packet_type_enable_flags_1;
  5245. A_UINT32 packet_type_enable_flags_2;
  5246. A_UINT32 packet_type_enable_flags_3;
  5247. A_UINT32 tlv_filter_in_flags;
  5248. A_UINT32 rx_packet_offset: 16,
  5249. rx_header_offset: 16;
  5250. A_UINT32 rx_mpdu_end_offset: 16,
  5251. rx_mpdu_start_offset: 16;
  5252. A_UINT32 rx_msdu_end_offset: 16,
  5253. rx_msdu_start_offset: 16;
  5254. A_UINT32 rx_attn_offset: 16,
  5255. rsvd3: 16;
  5256. A_UINT32 rx_drop_threshold: 10,
  5257. fp_ndp: 1,
  5258. mo_ndp: 1,
  5259. fp_phy_err: 1,
  5260. fp_phy_err_buf_src: 2,
  5261. fp_phy_err_buf_dest: 2,
  5262. pkt_type_enable_msdu_or_mpdu_logging:3,
  5263. dma_mpdu_mgmt: 1,
  5264. dma_mpdu_ctrl: 1,
  5265. dma_mpdu_data: 1,
  5266. word_mask_compaction_enable:1,
  5267. rbm_override_enable: 1,
  5268. rbm_override_val: 4,
  5269. rsvd4: 3;
  5270. A_UINT32 phy_err_mask;
  5271. A_UINT32 phy_err_mask_cont;
  5272. A_UINT32 rx_mpdu_start_word_mask:16,
  5273. rx_mpdu_end_word_mask: 3,
  5274. rsvd7: 13;
  5275. A_UINT32 rx_msdu_end_word_mask: 17,
  5276. rsvd5: 15;
  5277. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5278. rx_pkt_tlv_offset: 15,
  5279. rsvd6: 16;
  5280. } POSTPACK;
  5281. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5282. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5283. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5284. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5285. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5286. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5287. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5288. do { \
  5289. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5290. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5291. } while (0)
  5292. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5293. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5294. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5295. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5296. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5297. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5298. do { \
  5299. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5300. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5301. } while (0)
  5302. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5303. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5304. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5305. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5306. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5307. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5308. do { \
  5309. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5310. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5311. } while (0)
  5312. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5313. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5314. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5315. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5316. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5317. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5318. do { \
  5319. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5320. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5321. } while (0)
  5322. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5323. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5324. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5325. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5326. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5327. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5328. do { \
  5329. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5330. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5331. } while (0)
  5332. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5333. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5334. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5335. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5336. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5337. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5338. do { \
  5339. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5340. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5341. } while (0)
  5342. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5343. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5344. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5345. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5346. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5347. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5348. do { \
  5349. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5350. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5351. } while (0)
  5352. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5353. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5354. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5355. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5356. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5357. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5358. do { \
  5359. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5360. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5361. } while (0)
  5362. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5363. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5364. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5365. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5366. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5367. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5368. do { \
  5369. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5370. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5371. } while (0)
  5372. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5373. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5374. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5375. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5376. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5377. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5378. do { \
  5379. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5380. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5381. } while (0)
  5382. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5383. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5384. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5385. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5386. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5387. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5388. do { \
  5389. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5390. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5391. } while (0)
  5392. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5393. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5394. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5395. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5396. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5397. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5398. do { \
  5399. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5400. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5401. } while(0)
  5402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5405. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5406. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5408. do { \
  5409. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5410. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5411. } while (0)
  5412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5415. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5416. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5418. do { \
  5419. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5420. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5421. } while (0)
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5425. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5426. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5428. do { \
  5429. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5430. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5431. } while (0)
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5435. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5436. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5438. do { \
  5439. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5440. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5441. } while (0)
  5442. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5443. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5444. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5445. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5446. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5447. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5448. do { \
  5449. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5450. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5451. } while (0)
  5452. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5453. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5454. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5455. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5456. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5457. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5458. do { \
  5459. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5460. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5461. } while (0)
  5462. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5463. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5464. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5465. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5466. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5467. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5468. do { \
  5469. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5470. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5471. } while (0)
  5472. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5474. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5475. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5476. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5478. do { \
  5479. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5480. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5481. } while (0)
  5482. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5484. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5485. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5486. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5487. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5488. do { \
  5489. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5490. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5491. } while (0)
  5492. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5493. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5494. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5495. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5496. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5497. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5498. do { \
  5499. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5500. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5501. } while (0)
  5502. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5504. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5505. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5506. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5507. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5508. do { \
  5509. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5510. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5511. } while (0)
  5512. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5514. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5515. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5516. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5517. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5518. do { \
  5519. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5520. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5521. } while (0)
  5522. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5525. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5526. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5528. do { \
  5529. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5530. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5531. } while (0)
  5532. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5533. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5534. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5535. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5536. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5537. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5538. do { \
  5539. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5540. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5541. } while (0)
  5542. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5543. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5544. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5545. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5546. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5547. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5548. do { \
  5549. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5550. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5551. } while (0)
  5552. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5553. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5554. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5555. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5556. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5557. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5558. do { \
  5559. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5560. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5561. } while (0)
  5562. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5563. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5564. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5565. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5566. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5567. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5568. do { \
  5569. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5570. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5571. } while (0)
  5572. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5573. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5574. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5575. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5576. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5577. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5578. do { \
  5579. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5580. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5581. } while (0)
  5582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5585. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5586. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5588. do { \
  5589. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5590. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5591. } while (0)
  5592. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5593. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5594. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5595. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5596. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5597. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5598. do { \
  5599. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5600. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5601. } while (0)
  5602. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5603. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5604. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5605. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5606. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5607. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5608. do { \
  5609. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5610. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5611. } while (0)
  5612. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5613. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5614. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5615. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5616. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5617. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5618. do { \
  5619. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5620. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5621. } while (0)
  5622. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5623. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5624. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5625. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5626. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5627. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5628. do { \
  5629. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5630. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5631. } while (0)
  5632. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5633. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5634. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5635. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5636. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5637. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5638. do { \
  5639. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5640. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5641. } while (0)
  5642. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5643. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5644. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5645. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5646. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5647. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5648. do { \
  5649. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5650. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5651. } while (0)
  5652. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5653. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5654. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5655. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5656. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5657. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5658. do { \
  5659. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5660. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5661. } while (0)
  5662. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5663. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5664. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5665. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5666. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5667. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5668. do { \
  5669. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5670. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5671. } while (0)
  5672. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5673. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5674. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5675. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5676. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5677. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5678. do { \
  5679. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5680. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5681. } while (0)
  5682. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5683. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5684. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5685. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5686. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5687. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5688. do { \
  5689. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5690. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5691. } while (0)
  5692. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5693. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5694. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5695. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5696. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5697. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5698. do { \
  5699. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5700. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5701. } while (0)
  5702. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5703. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5704. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5705. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5706. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5707. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5708. do { \
  5709. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5710. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5711. } while (0)
  5712. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5713. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5714. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5715. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5716. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5717. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5718. do { \
  5719. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5720. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5721. } while (0)
  5722. /*
  5723. * Subtype based MGMT frames enable bits.
  5724. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5725. */
  5726. /* association request */
  5727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5733. /* association response */
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5740. /* Reassociation request */
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5747. /* Reassociation response */
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5754. /* Probe request */
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5761. /* Probe response */
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5768. /* Timing Advertisement */
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5775. /* Reserved */
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5782. /* Beacon */
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5789. /* ATIM */
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5796. /* Disassociation */
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5803. /* Authentication */
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5810. /* Deauthentication */
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5817. /* Action */
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5824. /* Action No Ack */
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5831. /* Reserved */
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5838. /*
  5839. * Subtype based CTRL frames enable bits.
  5840. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5841. */
  5842. /* Reserved */
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5849. /* Reserved */
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5856. /* Reserved */
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5863. /* Reserved */
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5870. /* Reserved */
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5877. /* Reserved */
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5884. /* Reserved */
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5891. /* Control Wrapper */
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5898. /* Block Ack Request */
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5905. /* Block Ack*/
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5912. /* PS-POLL */
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5919. /* RTS */
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5926. /* CTS */
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5933. /* ACK */
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5940. /* CF-END */
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5947. /* CF-END + CF-ACK */
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5954. /* Multicast data */
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5961. /* Unicast data */
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5968. /* NULL data */
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5976. do { \
  5977. HTT_CHECK_SET_VAL(httsym, value); \
  5978. (word) |= (value) << httsym##_S; \
  5979. } while (0)
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5981. (((word) & httsym##_M) >> httsym##_S)
  5982. #define htt_rx_ring_pkt_enable_subtype_set( \
  5983. word, flag, mode, type, subtype, val) \
  5984. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5985. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5986. #define htt_rx_ring_pkt_enable_subtype_get( \
  5987. word, flag, mode, type, subtype) \
  5988. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5989. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5990. /* Definition to filter in TLVs */
  5991. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5992. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5993. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5994. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6019. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6020. do { \
  6021. HTT_CHECK_SET_VAL(httsym, enable); \
  6022. (word) |= (enable) << httsym##_S; \
  6023. } while (0)
  6024. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6025. (((word) & httsym##_M) >> httsym##_S)
  6026. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6027. HTT_RX_RING_TLV_ENABLE_SET( \
  6028. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6029. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6030. HTT_RX_RING_TLV_ENABLE_GET( \
  6031. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6032. /**
  6033. * @brief host -> target TX monitor config message
  6034. *
  6035. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6036. *
  6037. * @details
  6038. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6039. * configure RXDMA rings.
  6040. * The configuration is per ring based and includes both packet types
  6041. * and PPDU/MPDU TLVs.
  6042. *
  6043. * The message would appear as follows:
  6044. *
  6045. * |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|
  6046. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6047. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6048. * |-----------+--------+--------+-----+------------------------------------|
  6049. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6050. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6051. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6052. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6053. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6054. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6055. * |------------------------------------------------------------------------|
  6056. * | tlv_filter_mask_in0 |
  6057. * |------------------------------------------------------------------------|
  6058. * | tlv_filter_mask_in1 |
  6059. * |------------------------------------------------------------------------|
  6060. * | tlv_filter_mask_in2 |
  6061. * |------------------------------------------------------------------------|
  6062. * | tlv_filter_mask_in3 |
  6063. * |-----------------+-----------------+---------------------+--------------|
  6064. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6065. * |------------------------------------------------------------------------|
  6066. * | pcu_ppdu_setup_word_mask |
  6067. * |--------------------+--+--+--+-----+---------------------+--------------|
  6068. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6069. * |------------------------------------------------------------------------|
  6070. *
  6071. * Where:
  6072. * PS = pkt_swap
  6073. * SS = status_swap
  6074. * The message is interpreted as follows:
  6075. * dword0 - b'0:7 - msg_type: This will be set to
  6076. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6077. * b'8:15 - pdev_id:
  6078. * 0 (for rings at SOC level),
  6079. * 1/2/3 mac id (for rings at LMAC level)
  6080. * b'16:23 - ring_id : Identify the ring to configure.
  6081. * More details can be got from enum htt_srng_ring_id
  6082. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6083. * BUF_RING_CFG_0 defs within HW .h files,
  6084. * e.g. wmac_top_reg_seq_hwioreg.h
  6085. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6086. * BUF_RING_CFG_0 defs within HW .h files,
  6087. * e.g. wmac_top_reg_seq_hwioreg.h
  6088. * b'26 - tx_mon_global_en: Enable/Disable global register
  6089. * configuration in Tx monitor module.
  6090. * b'27:31 - rsvd1: reserved for future use
  6091. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6092. * in byte units.
  6093. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6094. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6095. * 64, 128, 256.
  6096. * If all 3 bits are set config length is > 256.
  6097. * if val is '0', then ignore this field.
  6098. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6099. * 64, 128, 256.
  6100. * If all 3 bits are set config length is > 256.
  6101. * if val is '0', then ignore this field.
  6102. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6103. * 64, 128, 256.
  6104. * If all 3 bits are set config length is > 256.
  6105. * If val is '0', then ignore this field.
  6106. * - b'25:31 - rsvd2: Reserved for future use
  6107. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6108. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6109. * If packet_type_enable_flags is '1' for MGMT type,
  6110. * monitor will ignore this bit and allow this TLV.
  6111. * If packet_type_enable_flags is '0' for MGMT type,
  6112. * monitor will use this bit to enable/disable logging
  6113. * of this TLV.
  6114. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6115. * If packet_type_enable_flags is '1' for CTRL type,
  6116. * monitor will ignore this bit and allow this TLV.
  6117. * If packet_type_enable_flags is '0' for CTRL type,
  6118. * monitor will use this bit to enable/disable logging
  6119. * of this TLV.
  6120. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6121. * If packet_type_enable_flags is '1' for DATA type,
  6122. * monitor will ignore this bit and allow this TLV.
  6123. * If packet_type_enable_flags is '0' for DATA type,
  6124. * monitor will use this bit to enable/disable logging
  6125. * of this TLV.
  6126. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6127. * If packet_type_enable_flags is '1' for MGMT type,
  6128. * monitor will ignore this bit and allow this TLV.
  6129. * If packet_type_enable_flags is '0' for MGMT type,
  6130. * monitor will use this bit to enable/disable logging
  6131. * of this TLV.
  6132. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6133. * If packet_type_enable_flags is '1' for CTRL type,
  6134. * monitor will ignore this bit and allow this TLV.
  6135. * If packet_type_enable_flags is '0' for CTRL type,
  6136. * monitor will use this bit to enable/disable logging
  6137. * of this TLV.
  6138. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6139. * If packet_type_enable_flags is '1' for DATA type,
  6140. * monitor will ignore this bit and allow this TLV.
  6141. * If packet_type_enable_flags is '0' for DATA type,
  6142. * monitor will use this bit to enable/disable logging
  6143. * of this TLV.
  6144. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6145. * If packet_type_enable_flags is '1' for MGMT type,
  6146. * monitor will ignore this bit and allow this TLV.
  6147. * If packet_type_enable_flags is '0' for MGMT type,
  6148. * monitor will use this bit to enable/disable logging
  6149. * of this TLV.
  6150. * If filter_in_TX_MPDU_START = 1 it is recommended
  6151. * to set this bit.
  6152. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6153. * If packet_type_enable_flags is '1' for CTRL type,
  6154. * monitor will ignore this bit and allow this TLV.
  6155. * If packet_type_enable_flags is '0' for CTRL type,
  6156. * monitor will use this bit to enable/disable logging
  6157. * of this TLV.
  6158. * If filter_in_TX_MPDU_START = 1 it is recommended
  6159. * to set this bit.
  6160. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  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. * If filter_in_TX_MPDU_START = 1 it is recommended
  6167. * to set this bit.
  6168. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6169. * If packet_type_enable_flags is '1' for MGMT type,
  6170. * monitor will ignore this bit and allow this TLV.
  6171. * If packet_type_enable_flags is '0' for MGMT type,
  6172. * monitor will use this bit to enable/disable logging
  6173. * of this TLV.
  6174. * If filter_in_TX_MSDU_START = 1 it is recommended
  6175. * to set this bit.
  6176. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6177. * If packet_type_enable_flags is '1' for CTRL type,
  6178. * monitor will ignore this bit and allow this TLV.
  6179. * If packet_type_enable_flags is '0' for CTRL type,
  6180. * monitor will use this bit to enable/disable logging
  6181. * of this TLV.
  6182. * If filter_in_TX_MSDU_START = 1 it is recommended
  6183. * to set this bit.
  6184. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6185. * If packet_type_enable_flags is '1' for DATA type,
  6186. * monitor will ignore this bit and allow this TLV.
  6187. * If packet_type_enable_flags is '0' for DATA type,
  6188. * monitor will use this bit to enable/disable logging
  6189. * of this TLV.
  6190. * If filter_in_TX_MSDU_START = 1 it is recommended
  6191. * to set this bit.
  6192. * b'15:31 - rsvd3: Reserved for future use
  6193. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6194. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6195. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6196. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6197. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6198. * - b'8:15 - tx_peer_entry_word_mask:
  6199. * - b'16:23 - tx_queue_ext_word_mask:
  6200. * - b'24:31 - tx_msdu_start_word_mask:
  6201. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6202. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6203. * - b'8:15 - rxpcu_user_setup_word_mask:
  6204. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6205. * MGMT, CTRL, DATA
  6206. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6207. * 0 -> MSDU level logging is enabled
  6208. * (valid only if bit is set in
  6209. * pkt_type_enable_msdu_or_mpdu_logging)
  6210. * 1 -> MPDU level logging is enabled
  6211. * (valid only if bit is set in
  6212. * pkt_type_enable_msdu_or_mpdu_logging)
  6213. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6214. * 0 -> MSDU level logging is enabled
  6215. * (valid only if bit is set in
  6216. * pkt_type_enable_msdu_or_mpdu_logging)
  6217. * 1 -> MPDU level logging is enabled
  6218. * (valid only if bit is set in
  6219. * pkt_type_enable_msdu_or_mpdu_logging)
  6220. * - b'21 - dma_mpdu_data(D) : For DATA
  6221. * 0 -> MSDU level logging is enabled
  6222. * (valid only if bit is set in
  6223. * pkt_type_enable_msdu_or_mpdu_logging)
  6224. * 1 -> MPDU level logging is enabled
  6225. * (valid only if bit is set in
  6226. * pkt_type_enable_msdu_or_mpdu_logging)
  6227. * - b'22:31 - rsvd4 for future use
  6228. */
  6229. PREPACK struct htt_tx_monitor_cfg_t {
  6230. A_UINT32 msg_type: 8,
  6231. pdev_id: 8,
  6232. ring_id: 8,
  6233. status_swap: 1,
  6234. pkt_swap: 1,
  6235. tx_mon_global_en: 1,
  6236. rsvd1: 5;
  6237. A_UINT32 ring_buffer_size: 16,
  6238. config_length_mgmt: 3,
  6239. config_length_ctrl: 3,
  6240. config_length_data: 3,
  6241. rsvd2: 7;
  6242. A_UINT32 pkt_type_enable_flags: 3,
  6243. filter_in_tx_mpdu_start_mgmt: 1,
  6244. filter_in_tx_mpdu_start_ctrl: 1,
  6245. filter_in_tx_mpdu_start_data: 1,
  6246. filter_in_tx_msdu_start_mgmt: 1,
  6247. filter_in_tx_msdu_start_ctrl: 1,
  6248. filter_in_tx_msdu_start_data: 1,
  6249. filter_in_tx_mpdu_end_mgmt: 1,
  6250. filter_in_tx_mpdu_end_ctrl: 1,
  6251. filter_in_tx_mpdu_end_data: 1,
  6252. filter_in_tx_msdu_end_mgmt: 1,
  6253. filter_in_tx_msdu_end_ctrl: 1,
  6254. filter_in_tx_msdu_end_data: 1,
  6255. rsvd3: 17;
  6256. A_UINT32 tlv_filter_mask_in0;
  6257. A_UINT32 tlv_filter_mask_in1;
  6258. A_UINT32 tlv_filter_mask_in2;
  6259. A_UINT32 tlv_filter_mask_in3;
  6260. A_UINT32 tx_fes_setup_word_mask: 8,
  6261. tx_peer_entry_word_mask: 8,
  6262. tx_queue_ext_word_mask: 8,
  6263. tx_msdu_start_word_mask: 8;
  6264. A_UINT32 pcu_ppdu_setup_word_mask;
  6265. A_UINT32 tx_mpdu_start_word_mask: 8,
  6266. rxpcu_user_setup_word_mask: 8,
  6267. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6268. dma_mpdu_mgmt: 1,
  6269. dma_mpdu_ctrl: 1,
  6270. dma_mpdu_data: 1,
  6271. rsvd4: 10;
  6272. } POSTPACK;
  6273. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6274. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6275. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6276. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6277. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6278. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6279. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6280. do { \
  6281. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6282. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6283. } while (0)
  6284. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6285. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6286. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6287. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6288. HTT_TX_MONITOR_CFG_RING_ID_S)
  6289. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6290. do { \
  6291. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6292. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6293. } while (0)
  6294. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6295. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6296. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6297. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6298. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6299. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6300. do { \
  6301. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6302. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6303. } while (0)
  6304. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6305. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6306. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6307. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6308. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6309. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6310. do { \
  6311. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6312. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6313. } while (0)
  6314. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6315. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6316. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6317. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6318. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6319. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6320. do { \
  6321. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6322. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6323. } while (0)
  6324. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6325. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6326. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6327. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6328. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6329. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6330. do { \
  6331. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6332. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6333. } while (0)
  6334. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6335. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6336. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6337. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6338. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6339. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6340. do { \
  6341. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6342. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6343. } while (0)
  6344. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6345. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6346. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6347. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6348. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6349. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6350. do { \
  6351. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6352. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6353. } while (0)
  6354. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6355. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6356. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6357. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6358. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6359. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6360. do { \
  6361. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6362. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6363. } while (0)
  6364. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6365. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6366. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6367. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6368. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6369. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6370. do { \
  6371. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6372. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6373. } while (0)
  6374. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6375. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6376. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6377. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6378. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6379. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6380. do { \
  6381. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6382. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6383. } while (0)
  6384. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6385. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6386. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6387. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6388. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6389. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6390. do { \
  6391. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6392. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6393. } while (0)
  6394. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6396. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6397. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6398. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6399. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6400. do { \
  6401. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6402. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6403. } while (0)
  6404. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6407. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6408. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6409. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6410. do { \
  6411. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6412. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6413. } while (0)
  6414. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6417. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6418. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6419. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6420. do { \
  6421. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6422. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6423. } while (0)
  6424. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6426. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6427. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6428. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6429. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6430. do { \
  6431. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6432. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6433. } while (0)
  6434. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6437. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6438. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6439. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6440. do { \
  6441. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6442. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6443. } while (0)
  6444. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6447. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6448. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6449. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6450. do { \
  6451. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6452. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6453. } while (0)
  6454. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6456. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6457. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6458. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6459. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6460. do { \
  6461. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6462. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6463. } while (0)
  6464. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6466. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6467. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6468. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6469. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6470. do { \
  6471. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6472. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6473. } while (0)
  6474. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6476. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6477. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6478. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6479. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6480. do { \
  6481. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6482. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6483. } while (0)
  6484. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6486. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6487. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6488. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6489. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6490. do { \
  6491. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6492. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6493. } while (0)
  6494. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6495. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6496. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6497. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6498. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6499. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6500. do { \
  6501. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6502. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6503. } while (0)
  6504. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6505. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6506. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6507. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6508. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6509. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6510. do { \
  6511. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6512. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6513. } while (0)
  6514. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6515. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6516. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6517. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6518. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6519. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6520. do { \
  6521. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6522. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6523. } while (0)
  6524. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6525. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6526. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6527. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6528. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6529. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6532. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6533. } while (0)
  6534. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6535. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6536. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6537. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6538. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6539. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6540. do { \
  6541. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6542. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6543. } while (0)
  6544. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6545. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6546. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6547. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6548. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6549. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6550. do { \
  6551. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6552. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6553. } while (0)
  6554. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6555. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6556. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6557. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6558. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6559. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6560. do { \
  6561. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6562. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6563. } while (0)
  6564. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6565. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6566. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6567. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6568. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6569. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6570. do { \
  6571. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6572. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6573. } while (0)
  6574. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6575. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6576. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6577. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6578. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6579. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6580. do { \
  6581. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6582. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6583. } while (0)
  6584. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6585. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6586. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6587. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6588. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6589. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6590. do { \
  6591. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6592. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6593. } while (0)
  6594. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6595. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6596. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6597. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6598. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6599. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6600. do { \
  6601. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6602. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6603. } while (0)
  6604. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6605. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6606. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6607. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6608. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6609. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6610. do { \
  6611. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6612. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6613. } while (0)
  6614. /*
  6615. * pkt_type_enable_flags
  6616. */
  6617. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6618. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6619. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6620. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6623. /*
  6624. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6625. */
  6626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6633. do { \
  6634. HTT_CHECK_SET_VAL(httsym, value); \
  6635. (word) |= (value) << httsym##_S; \
  6636. } while (0)
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6638. (((word) & httsym##_M) >> httsym##_S)
  6639. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6640. * type -> MGMT, CTRL, DATA*/
  6641. #define htt_tx_ring_pkt_type_set( \
  6642. word, mode, type, val) \
  6643. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6644. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6645. #define htt_tx_ring_pkt_type_get( \
  6646. word, mode, type) \
  6647. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6648. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6649. /* Definition to filter in TLVs */
  6650. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6651. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6652. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6714. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6715. do { \
  6716. HTT_CHECK_SET_VAL(httsym, enable); \
  6717. (word) |= (enable) << httsym##_S; \
  6718. } while (0)
  6719. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6720. (((word) & httsym##_M) >> httsym##_S)
  6721. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6722. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6723. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6724. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6725. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6726. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6791. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6792. do { \
  6793. HTT_CHECK_SET_VAL(httsym, enable); \
  6794. (word) |= (enable) << httsym##_S; \
  6795. } while (0)
  6796. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6797. (((word) & httsym##_M) >> httsym##_S)
  6798. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6799. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6800. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6801. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6802. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6803. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6868. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6869. do { \
  6870. HTT_CHECK_SET_VAL(httsym, enable); \
  6871. (word) |= (enable) << httsym##_S; \
  6872. } while (0)
  6873. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6874. (((word) & httsym##_M) >> httsym##_S)
  6875. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6876. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6877. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6878. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6879. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6880. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6925. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6926. do { \
  6927. HTT_CHECK_SET_VAL(httsym, enable); \
  6928. (word) |= (enable) << httsym##_S; \
  6929. } while (0)
  6930. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6931. (((word) & httsym##_M) >> httsym##_S)
  6932. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6933. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6934. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6935. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6936. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6937. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6938. /**
  6939. * @brief host --> target Receive Flow Steering configuration message definition
  6940. *
  6941. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6942. *
  6943. * host --> target Receive Flow Steering configuration message definition.
  6944. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6945. * The reason for this is we want RFS to be configured and ready before MAC
  6946. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6947. *
  6948. * |31 24|23 16|15 9|8|7 0|
  6949. * |----------------+----------------+----------------+----------------|
  6950. * | reserved |E| msg type |
  6951. * |-------------------------------------------------------------------|
  6952. * Where E = RFS enable flag
  6953. *
  6954. * The RFS_CONFIG message consists of a single 4-byte word.
  6955. *
  6956. * Header fields:
  6957. * - MSG_TYPE
  6958. * Bits 7:0
  6959. * Purpose: identifies this as a RFS config msg
  6960. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6961. * - RFS_CONFIG
  6962. * Bit 8
  6963. * Purpose: Tells target whether to enable (1) or disable (0)
  6964. * flow steering feature when sending rx indication messages to host
  6965. */
  6966. #define HTT_H2T_RFS_CONFIG_M 0x100
  6967. #define HTT_H2T_RFS_CONFIG_S 8
  6968. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6969. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6970. HTT_H2T_RFS_CONFIG_S)
  6971. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6972. do { \
  6973. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6974. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6975. } while (0)
  6976. #define HTT_RFS_CFG_REQ_BYTES 4
  6977. /**
  6978. * @brief host -> target FW extended statistics request
  6979. *
  6980. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6981. *
  6982. * @details
  6983. * The following field definitions describe the format of the HTT host
  6984. * to target FW extended stats retrieve message.
  6985. * The message specifies the type of stats the host wants to retrieve.
  6986. *
  6987. * |31 24|23 16|15 8|7 0|
  6988. * |-----------------------------------------------------------|
  6989. * | reserved | stats type | pdev_mask | msg type |
  6990. * |-----------------------------------------------------------|
  6991. * | config param [0] |
  6992. * |-----------------------------------------------------------|
  6993. * | config param [1] |
  6994. * |-----------------------------------------------------------|
  6995. * | config param [2] |
  6996. * |-----------------------------------------------------------|
  6997. * | config param [3] |
  6998. * |-----------------------------------------------------------|
  6999. * | reserved |
  7000. * |-----------------------------------------------------------|
  7001. * | cookie LSBs |
  7002. * |-----------------------------------------------------------|
  7003. * | cookie MSBs |
  7004. * |-----------------------------------------------------------|
  7005. * Header fields:
  7006. * - MSG_TYPE
  7007. * Bits 7:0
  7008. * Purpose: identifies this is a extended stats upload request message
  7009. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7010. * - PDEV_MASK
  7011. * Bits 8:15
  7012. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7013. * Value: This is a overloaded field, refer to usage and interpretation of
  7014. * PDEV in interface document.
  7015. * Bit 8 : Reserved for SOC stats
  7016. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7017. * Indicates MACID_MASK in DBS
  7018. * - STATS_TYPE
  7019. * Bits 23:16
  7020. * Purpose: identifies which FW statistics to upload
  7021. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7022. * - Reserved
  7023. * Bits 31:24
  7024. * - CONFIG_PARAM [0]
  7025. * Bits 31:0
  7026. * Purpose: give an opaque configuration value to the specified stats type
  7027. * Value: stats-type specific configuration value
  7028. * Refer to htt_stats.h for interpretation for each stats sub_type
  7029. * - CONFIG_PARAM [1]
  7030. * Bits 31:0
  7031. * Purpose: give an opaque configuration value to the specified stats type
  7032. * Value: stats-type specific configuration value
  7033. * Refer to htt_stats.h for interpretation for each stats sub_type
  7034. * - CONFIG_PARAM [2]
  7035. * Bits 31:0
  7036. * Purpose: give an opaque configuration value to the specified stats type
  7037. * Value: stats-type specific configuration value
  7038. * Refer to htt_stats.h for interpretation for each stats sub_type
  7039. * - CONFIG_PARAM [3]
  7040. * Bits 31:0
  7041. * Purpose: give an opaque configuration value to the specified stats type
  7042. * Value: stats-type specific configuration value
  7043. * Refer to htt_stats.h for interpretation for each stats sub_type
  7044. * - Reserved [31:0] for future use.
  7045. * - COOKIE_LSBS
  7046. * Bits 31:0
  7047. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7048. * message with its preceding host->target stats request message.
  7049. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7050. * - COOKIE_MSBS
  7051. * Bits 31:0
  7052. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7053. * message with its preceding host->target stats request message.
  7054. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7055. */
  7056. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7057. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7058. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7059. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7060. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7061. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7062. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7063. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7064. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7065. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7066. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7067. do { \
  7068. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7069. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7070. } while (0)
  7071. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7072. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7073. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7074. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7075. do { \
  7076. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7077. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7078. } while (0)
  7079. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7080. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7081. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7082. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7083. do { \
  7084. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7085. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7086. } while (0)
  7087. /**
  7088. * @brief host -> target FW streaming statistics request
  7089. *
  7090. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7091. *
  7092. * @details
  7093. * The following field definitions describe the format of the HTT host
  7094. * to target message that requests the target to start or stop producing
  7095. * ongoing stats of the specified type.
  7096. *
  7097. * |31|30 |23 16|15 8|7 0|
  7098. * |-----------------------------------------------------------|
  7099. * |EN| reserved | stats type | reserved | msg type |
  7100. * |-----------------------------------------------------------|
  7101. * | config param [0] |
  7102. * |-----------------------------------------------------------|
  7103. * | config param [1] |
  7104. * |-----------------------------------------------------------|
  7105. * | config param [2] |
  7106. * |-----------------------------------------------------------|
  7107. * | config param [3] |
  7108. * |-----------------------------------------------------------|
  7109. * Where:
  7110. * - EN is an enable/disable flag
  7111. * Header fields:
  7112. * - MSG_TYPE
  7113. * Bits 7:0
  7114. * Purpose: identifies this is a streaming stats upload request message
  7115. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7116. * - STATS_TYPE
  7117. * Bits 23:16
  7118. * Purpose: identifies which FW statistics to upload
  7119. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7120. * Only the htt_dbg_ext_stats_type values identified as streaming
  7121. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7122. * - ENABLE
  7123. * Bit 31
  7124. * Purpose: enable/disable the target's ongoing stats of the specified type
  7125. * Value:
  7126. * 0 - disable ongoing production of the specified stats type
  7127. * 1 - enable ongoing production of the specified stats type
  7128. * - CONFIG_PARAM [0]
  7129. * Bits 31:0
  7130. * Purpose: give an opaque configuration value to the specified stats type
  7131. * Value: stats-type specific configuration value
  7132. * Refer to htt_stats.h for interpretation for each stats sub_type
  7133. * - CONFIG_PARAM [1]
  7134. * Bits 31:0
  7135. * Purpose: give an opaque configuration value to the specified stats type
  7136. * Value: stats-type specific configuration value
  7137. * Refer to htt_stats.h for interpretation for each stats sub_type
  7138. * - CONFIG_PARAM [2]
  7139. * Bits 31:0
  7140. * Purpose: give an opaque configuration value to the specified stats type
  7141. * Value: stats-type specific configuration value
  7142. * Refer to htt_stats.h for interpretation for each stats sub_type
  7143. * - CONFIG_PARAM [3]
  7144. * Bits 31:0
  7145. * Purpose: give an opaque configuration value to the specified stats type
  7146. * Value: stats-type specific configuration value
  7147. * Refer to htt_stats.h for interpretation for each stats sub_type
  7148. */
  7149. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7150. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7151. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7152. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7153. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7154. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7155. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7156. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7157. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7158. do { \
  7159. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7160. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7161. } while (0)
  7162. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7163. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7164. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7165. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7166. do { \
  7167. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7168. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7169. } while (0)
  7170. /**
  7171. * @brief host -> target FW PPDU_STATS request message
  7172. *
  7173. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7174. *
  7175. * @details
  7176. * The following field definitions describe the format of the HTT host
  7177. * to target FW for PPDU_STATS_CFG msg.
  7178. * The message allows the host to configure the PPDU_STATS_IND messages
  7179. * produced by the target.
  7180. *
  7181. * |31 24|23 16|15 8|7 0|
  7182. * |-----------------------------------------------------------|
  7183. * | REQ bit mask | pdev_mask | msg type |
  7184. * |-----------------------------------------------------------|
  7185. * Header fields:
  7186. * - MSG_TYPE
  7187. * Bits 7:0
  7188. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7189. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7190. * - PDEV_MASK
  7191. * Bits 8:15
  7192. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7193. * Value: This is a overloaded field, refer to usage and interpretation of
  7194. * PDEV in interface document.
  7195. * Bit 8 : Reserved for SOC stats
  7196. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7197. * Indicates MACID_MASK in DBS
  7198. * - REQ_TLV_BIT_MASK
  7199. * Bits 16:31
  7200. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7201. * needs to be included in the target's PPDU_STATS_IND messages.
  7202. * Value: refer htt_ppdu_stats_tlv_tag_t
  7203. *
  7204. */
  7205. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7206. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7207. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7208. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7209. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7210. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7211. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7212. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7213. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7214. do { \
  7215. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7216. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7217. } while (0)
  7218. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7219. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7220. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7221. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7222. do { \
  7223. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7224. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7225. } while (0)
  7226. /**
  7227. * @brief Host-->target HTT RX FSE setup message
  7228. *
  7229. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7230. *
  7231. * @details
  7232. * Through this message, the host will provide details of the flow tables
  7233. * in host DDR along with hash keys.
  7234. * This message can be sent per SOC or per PDEV, which is differentiated
  7235. * by pdev id values.
  7236. * The host will allocate flow search table and sends table size,
  7237. * physical DMA address of flow table, and hash keys to firmware to
  7238. * program into the RXOLE FSE HW block.
  7239. *
  7240. * The following field definitions describe the format of the RX FSE setup
  7241. * message sent from the host to target
  7242. *
  7243. * Header fields:
  7244. * dword0 - b'7:0 - msg_type: This will be set to
  7245. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7246. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7247. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7248. * pdev's LMAC ring.
  7249. * b'31:16 - reserved : Reserved for future use
  7250. * dword1 - b'19:0 - number of records: This field indicates the number of
  7251. * entries in the flow table. For example: 8k number of
  7252. * records is equivalent to
  7253. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7254. * b'27:20 - max search: This field specifies the skid length to FSE
  7255. * parser HW module whenever match is not found at the
  7256. * exact index pointed by hash.
  7257. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7258. * Refer htt_ip_da_sa_prefix below for more details.
  7259. * b'31:30 - reserved: Reserved for future use
  7260. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7261. * table allocated by host in DDR
  7262. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7263. * table allocated by host in DDR
  7264. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7265. * entry hashing
  7266. *
  7267. *
  7268. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7269. * |---------------------------------------------------------------|
  7270. * | reserved | pdev_id | MSG_TYPE |
  7271. * |---------------------------------------------------------------|
  7272. * |resvd|IPDSA| max_search | Number of records |
  7273. * |---------------------------------------------------------------|
  7274. * | base address lo |
  7275. * |---------------------------------------------------------------|
  7276. * | base address high |
  7277. * |---------------------------------------------------------------|
  7278. * | toeplitz key 31_0 |
  7279. * |---------------------------------------------------------------|
  7280. * | toeplitz key 63_32 |
  7281. * |---------------------------------------------------------------|
  7282. * | toeplitz key 95_64 |
  7283. * |---------------------------------------------------------------|
  7284. * | toeplitz key 127_96 |
  7285. * |---------------------------------------------------------------|
  7286. * | toeplitz key 159_128 |
  7287. * |---------------------------------------------------------------|
  7288. * | toeplitz key 191_160 |
  7289. * |---------------------------------------------------------------|
  7290. * | toeplitz key 223_192 |
  7291. * |---------------------------------------------------------------|
  7292. * | toeplitz key 255_224 |
  7293. * |---------------------------------------------------------------|
  7294. * | toeplitz key 287_256 |
  7295. * |---------------------------------------------------------------|
  7296. * | reserved | toeplitz key 314_288(26:0 bits) |
  7297. * |---------------------------------------------------------------|
  7298. * where:
  7299. * IPDSA = ip_da_sa
  7300. */
  7301. /**
  7302. * @brief: htt_ip_da_sa_prefix
  7303. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7304. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7305. * documentation per RFC3849
  7306. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7307. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7308. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7309. */
  7310. enum htt_ip_da_sa_prefix {
  7311. HTT_RX_IPV6_20010db8,
  7312. HTT_RX_IPV4_MAPPED_IPV6,
  7313. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7314. HTT_RX_IPV6_64FF9B,
  7315. };
  7316. /**
  7317. * @brief Host-->target HTT RX FISA configure and enable
  7318. *
  7319. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7320. *
  7321. * @details
  7322. * The host will send this command down to configure and enable the FISA
  7323. * operational params.
  7324. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7325. * register.
  7326. * Should configure both the MACs.
  7327. *
  7328. * dword0 - b'7:0 - msg_type:
  7329. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7330. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7331. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7332. * pdev's LMAC ring.
  7333. * b'31:16 - reserved : Reserved for future use
  7334. *
  7335. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7336. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7337. * packets. 1 flow search will be skipped
  7338. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7339. * tcp,udp packets
  7340. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7341. * calculation
  7342. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7343. * calculation
  7344. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7345. * calculation
  7346. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7347. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7348. * length
  7349. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7350. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7351. * length
  7352. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7353. * num jump
  7354. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7355. * num jump
  7356. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7357. * data type switch has happend for MPDU Sequence num jump
  7358. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7359. * for MPDU Sequence num jump
  7360. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7361. * for decrypt errors
  7362. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7363. * while aggregating a msdu
  7364. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7365. * The aggregation is done until (number of MSDUs aggregated
  7366. * < LIMIT + 1)
  7367. * b'31:18 - Reserved
  7368. *
  7369. * fisa_control_value - 32bit value FW can write to register
  7370. *
  7371. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7372. * Threshold value for FISA timeout (units are microseconds).
  7373. * When the global timestamp exceeds this threshold, FISA
  7374. * aggregation will be restarted.
  7375. * A value of 0 means timeout is disabled.
  7376. * Compare the threshold register with timestamp field in
  7377. * flow entry to generate timeout for the flow.
  7378. *
  7379. * |31 18 |17 16|15 8|7 0|
  7380. * |-------------------------------------------------------------|
  7381. * | reserved | pdev_mask | msg type |
  7382. * |-------------------------------------------------------------|
  7383. * | reserved | FISA_CTRL |
  7384. * |-------------------------------------------------------------|
  7385. * | FISA_TIMEOUT_THRESH |
  7386. * |-------------------------------------------------------------|
  7387. */
  7388. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7389. A_UINT32 msg_type:8,
  7390. pdev_id:8,
  7391. reserved0:16;
  7392. /**
  7393. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7394. * [17:0]
  7395. */
  7396. union {
  7397. /*
  7398. * fisa_control_bits structure is deprecated.
  7399. * Please use fisa_control_bits_v2 going forward.
  7400. */
  7401. struct {
  7402. A_UINT32 fisa_enable: 1,
  7403. ipsec_skip_search: 1,
  7404. nontcp_skip_search: 1,
  7405. add_ipv4_fixed_hdr_len: 1,
  7406. add_ipv6_fixed_hdr_len: 1,
  7407. add_tcp_fixed_hdr_len: 1,
  7408. add_udp_hdr_len: 1,
  7409. chksum_cum_ip_len_en: 1,
  7410. disable_tid_check: 1,
  7411. disable_ta_check: 1,
  7412. disable_qos_check: 1,
  7413. disable_raw_check: 1,
  7414. disable_decrypt_err_check: 1,
  7415. disable_msdu_drop_check: 1,
  7416. fisa_aggr_limit: 4,
  7417. reserved: 14;
  7418. } fisa_control_bits;
  7419. struct {
  7420. A_UINT32 fisa_enable: 1,
  7421. fisa_aggr_limit: 4,
  7422. reserved: 27;
  7423. } fisa_control_bits_v2;
  7424. A_UINT32 fisa_control_value;
  7425. } u_fisa_control;
  7426. /**
  7427. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7428. * timeout threshold for aggregation. Unit in usec.
  7429. * [31:0]
  7430. */
  7431. A_UINT32 fisa_timeout_threshold;
  7432. } POSTPACK;
  7433. /* DWord 0: pdev-ID */
  7434. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7435. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7436. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7437. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7438. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7439. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7442. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7443. } while (0)
  7444. /* Dword 1: fisa_control_value fisa config */
  7445. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7446. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7447. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7448. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7449. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7450. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7451. do { \
  7452. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7453. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7454. } while (0)
  7455. /* Dword 1: fisa_control_value ipsec_skip_search */
  7456. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7457. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7458. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7459. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7460. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7461. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7462. do { \
  7463. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7464. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7465. } while (0)
  7466. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7467. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7468. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7469. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7470. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7471. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7472. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7473. do { \
  7474. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7475. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7476. } while (0)
  7477. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7478. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7479. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7480. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7481. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7482. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7483. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7484. do { \
  7485. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7486. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7487. } while (0)
  7488. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7489. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7490. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7491. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7492. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7493. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7494. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7497. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7498. } while (0)
  7499. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7500. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7501. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7502. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7503. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7504. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7505. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7508. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7509. } while (0)
  7510. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7511. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7512. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7513. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7514. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7515. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7516. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7517. do { \
  7518. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7519. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7520. } while (0)
  7521. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7522. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7523. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7524. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7525. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7526. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7527. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7528. do { \
  7529. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7530. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7531. } while (0)
  7532. /* Dword 1: fisa_control_value disable_tid_check */
  7533. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7534. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7535. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7536. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7537. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7538. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7539. do { \
  7540. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7541. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7542. } while (0)
  7543. /* Dword 1: fisa_control_value disable_ta_check */
  7544. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7545. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7546. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7547. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7548. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7549. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7550. do { \
  7551. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7552. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7553. } while (0)
  7554. /* Dword 1: fisa_control_value disable_qos_check */
  7555. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7556. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7557. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7558. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7559. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7560. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7561. do { \
  7562. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7563. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7564. } while (0)
  7565. /* Dword 1: fisa_control_value disable_raw_check */
  7566. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7567. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7568. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7569. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7570. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7571. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7572. do { \
  7573. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7574. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7575. } while (0)
  7576. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7577. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7578. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7579. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7580. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7581. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7582. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7583. do { \
  7584. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7585. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7586. } while (0)
  7587. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7588. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7589. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7590. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7591. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7592. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7593. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7594. do { \
  7595. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7596. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7597. } while (0)
  7598. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7599. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7600. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7601. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7602. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7603. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7604. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7605. do { \
  7606. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7607. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7608. } while (0)
  7609. /* Dword 1: fisa_control_value fisa config */
  7610. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7611. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7612. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7613. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7614. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7615. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7616. do { \
  7617. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7618. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7619. } while (0)
  7620. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7621. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7622. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7623. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7624. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7625. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7626. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7627. do { \
  7628. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7629. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7630. } while (0)
  7631. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7632. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7633. pdev_id:8,
  7634. reserved0:16;
  7635. A_UINT32 num_records:20,
  7636. max_search:8,
  7637. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7638. reserved1:2;
  7639. A_UINT32 base_addr_lo;
  7640. A_UINT32 base_addr_hi;
  7641. A_UINT32 toeplitz31_0;
  7642. A_UINT32 toeplitz63_32;
  7643. A_UINT32 toeplitz95_64;
  7644. A_UINT32 toeplitz127_96;
  7645. A_UINT32 toeplitz159_128;
  7646. A_UINT32 toeplitz191_160;
  7647. A_UINT32 toeplitz223_192;
  7648. A_UINT32 toeplitz255_224;
  7649. A_UINT32 toeplitz287_256;
  7650. A_UINT32 toeplitz314_288:27,
  7651. reserved2:5;
  7652. } POSTPACK;
  7653. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7654. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7655. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7656. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7657. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7658. /* DWORD 0: Pdev ID */
  7659. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7660. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7661. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7662. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7663. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7664. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7665. do { \
  7666. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7667. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7668. } while (0)
  7669. /* DWORD 1:num of records */
  7670. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7671. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7672. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7673. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7674. HTT_RX_FSE_SETUP_NUM_REC_S)
  7675. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7676. do { \
  7677. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7678. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7679. } while (0)
  7680. /* DWORD 1:max_search */
  7681. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7682. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7683. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7684. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7685. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7686. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7687. do { \
  7688. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7689. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7690. } while (0)
  7691. /* DWORD 1:ip_da_sa prefix */
  7692. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7693. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7694. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7695. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7696. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7697. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7698. do { \
  7699. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7700. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7701. } while (0)
  7702. /* DWORD 2: Base Address LO */
  7703. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7704. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7705. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7706. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7707. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7708. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7709. do { \
  7710. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7711. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7712. } while (0)
  7713. /* DWORD 3: Base Address High */
  7714. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7715. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7716. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7717. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7718. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7719. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7722. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7723. } while (0)
  7724. /* DWORD 4-12: Hash Value */
  7725. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7726. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7727. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7728. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7729. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7730. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7731. do { \
  7732. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7733. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7734. } while (0)
  7735. /* DWORD 13: Hash Value 314:288 bits */
  7736. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7737. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7738. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7739. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7740. do { \
  7741. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7742. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7743. } while (0)
  7744. /**
  7745. * @brief Host-->target HTT RX FSE operation message
  7746. *
  7747. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7748. *
  7749. * @details
  7750. * The host will send this Flow Search Engine (FSE) operation message for
  7751. * every flow add/delete operation.
  7752. * The FSE operation includes FSE full cache invalidation or individual entry
  7753. * invalidation.
  7754. * This message can be sent per SOC or per PDEV which is differentiated
  7755. * by pdev id values.
  7756. *
  7757. * |31 16|15 8|7 1|0|
  7758. * |-------------------------------------------------------------|
  7759. * | reserved | pdev_id | MSG_TYPE |
  7760. * |-------------------------------------------------------------|
  7761. * | reserved | operation |I|
  7762. * |-------------------------------------------------------------|
  7763. * | ip_src_addr_31_0 |
  7764. * |-------------------------------------------------------------|
  7765. * | ip_src_addr_63_32 |
  7766. * |-------------------------------------------------------------|
  7767. * | ip_src_addr_95_64 |
  7768. * |-------------------------------------------------------------|
  7769. * | ip_src_addr_127_96 |
  7770. * |-------------------------------------------------------------|
  7771. * | ip_dst_addr_31_0 |
  7772. * |-------------------------------------------------------------|
  7773. * | ip_dst_addr_63_32 |
  7774. * |-------------------------------------------------------------|
  7775. * | ip_dst_addr_95_64 |
  7776. * |-------------------------------------------------------------|
  7777. * | ip_dst_addr_127_96 |
  7778. * |-------------------------------------------------------------|
  7779. * | l4_dst_port | l4_src_port |
  7780. * | (32-bit SPI incase of IPsec) |
  7781. * |-------------------------------------------------------------|
  7782. * | reserved | l4_proto |
  7783. * |-------------------------------------------------------------|
  7784. *
  7785. * where I is 1-bit ipsec_valid.
  7786. *
  7787. * The following field definitions describe the format of the RX FSE operation
  7788. * message sent from the host to target for every add/delete flow entry to flow
  7789. * table.
  7790. *
  7791. * Header fields:
  7792. * dword0 - b'7:0 - msg_type: This will be set to
  7793. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7794. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7795. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7796. * specified pdev's LMAC ring.
  7797. * b'31:16 - reserved : Reserved for future use
  7798. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7799. * (Internet Protocol Security).
  7800. * IPsec describes the framework for providing security at
  7801. * IP layer. IPsec is defined for both versions of IP:
  7802. * IPV4 and IPV6.
  7803. * Please refer to htt_rx_flow_proto enumeration below for
  7804. * more info.
  7805. * ipsec_valid = 1 for IPSEC packets
  7806. * ipsec_valid = 0 for IP Packets
  7807. * b'7:1 - operation: This indicates types of FSE operation.
  7808. * Refer to htt_rx_fse_operation enumeration:
  7809. * 0 - No Cache Invalidation required
  7810. * 1 - Cache invalidate only one entry given by IP
  7811. * src/dest address at DWORD[2:9]
  7812. * 2 - Complete FSE Cache Invalidation
  7813. * 3 - FSE Disable
  7814. * 4 - FSE Enable
  7815. * b'31:8 - reserved: Reserved for future use
  7816. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7817. * for per flow addition/deletion
  7818. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7819. * and the subsequent 3 A_UINT32 will be padding bytes.
  7820. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7821. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7822. * from 0 to 65535 but only 0 to 1023 are designated as
  7823. * well-known ports. Refer to [RFC1700] for more details.
  7824. * This field is valid only if
  7825. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7826. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7827. * range from 0 to 65535 but only 0 to 1023 are designated
  7828. * as well-known ports. Refer to [RFC1700] for more details.
  7829. * This field is valid only if
  7830. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7831. * - SPI (31:0): Security Parameters Index is an
  7832. * identification tag added to the header while using IPsec
  7833. * for tunneling the IP traffici.
  7834. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7835. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7836. * Assigned Internet Protocol Numbers.
  7837. * l4_proto numbers for standard protocol like UDP/TCP
  7838. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7839. * l4_proto = 17 for UDP etc.
  7840. * b'31:8 - reserved: Reserved for future use.
  7841. *
  7842. */
  7843. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7844. A_UINT32 msg_type:8,
  7845. pdev_id:8,
  7846. reserved0:16;
  7847. A_UINT32 ipsec_valid:1,
  7848. operation:7,
  7849. reserved1:24;
  7850. A_UINT32 ip_src_addr_31_0;
  7851. A_UINT32 ip_src_addr_63_32;
  7852. A_UINT32 ip_src_addr_95_64;
  7853. A_UINT32 ip_src_addr_127_96;
  7854. A_UINT32 ip_dest_addr_31_0;
  7855. A_UINT32 ip_dest_addr_63_32;
  7856. A_UINT32 ip_dest_addr_95_64;
  7857. A_UINT32 ip_dest_addr_127_96;
  7858. union {
  7859. A_UINT32 spi;
  7860. struct {
  7861. A_UINT32 l4_src_port:16,
  7862. l4_dest_port:16;
  7863. } ip;
  7864. } u;
  7865. A_UINT32 l4_proto:8,
  7866. reserved:24;
  7867. } POSTPACK;
  7868. /**
  7869. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7870. *
  7871. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7872. *
  7873. * @details
  7874. * The host will send this Full monitor mode register configuration message.
  7875. * This message can be sent per SOC or per PDEV which is differentiated
  7876. * by pdev id values.
  7877. *
  7878. * |31 16|15 11|10 8|7 3|2|1|0|
  7879. * |-------------------------------------------------------------|
  7880. * | reserved | pdev_id | MSG_TYPE |
  7881. * |-------------------------------------------------------------|
  7882. * | reserved |Release Ring |N|Z|E|
  7883. * |-------------------------------------------------------------|
  7884. *
  7885. * where E is 1-bit full monitor mode enable/disable.
  7886. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7887. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7888. *
  7889. * The following field definitions describe the format of the full monitor
  7890. * mode configuration message sent from the host to target for each pdev.
  7891. *
  7892. * Header fields:
  7893. * dword0 - b'7:0 - msg_type: This will be set to
  7894. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7895. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7896. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7897. * specified pdev's LMAC ring.
  7898. * b'31:16 - reserved : Reserved for future use.
  7899. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7900. * monitor mode rxdma register is to be enabled or disabled.
  7901. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7902. * additional descriptors at ppdu end for zero mpdus
  7903. * enabled or disabled.
  7904. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7905. * additional descriptors at ppdu end for non zero mpdus
  7906. * enabled or disabled.
  7907. * b'10:3 - release_ring: This indicates the destination ring
  7908. * selection for the descriptor at the end of PPDU
  7909. * 0 - REO ring select
  7910. * 1 - FW ring select
  7911. * 2 - SW ring select
  7912. * 3 - Release ring select
  7913. * Refer to htt_rx_full_mon_release_ring.
  7914. * b'31:11 - reserved for future use
  7915. */
  7916. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7917. A_UINT32 msg_type:8,
  7918. pdev_id:8,
  7919. reserved0:16;
  7920. A_UINT32 full_monitor_mode_enable:1,
  7921. addnl_descs_zero_mpdus_end:1,
  7922. addnl_descs_non_zero_mpdus_end:1,
  7923. release_ring:8,
  7924. reserved1:21;
  7925. } POSTPACK;
  7926. /**
  7927. * Enumeration for full monitor mode destination ring select
  7928. * 0 - REO destination ring select
  7929. * 1 - FW destination ring select
  7930. * 2 - SW destination ring select
  7931. * 3 - Release destination ring select
  7932. */
  7933. enum htt_rx_full_mon_release_ring {
  7934. HTT_RX_MON_RING_REO,
  7935. HTT_RX_MON_RING_FW,
  7936. HTT_RX_MON_RING_SW,
  7937. HTT_RX_MON_RING_RELEASE,
  7938. };
  7939. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7940. /* DWORD 0: Pdev ID */
  7941. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7942. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7943. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7944. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7945. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7946. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7947. do { \
  7948. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7949. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7950. } while (0)
  7951. /* DWORD 1:ENABLE */
  7952. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7953. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7954. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7955. do { \
  7956. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7957. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7958. } while (0)
  7959. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7960. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7961. /* DWORD 1:ZERO_MPDU */
  7962. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7963. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7964. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7965. do { \
  7966. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7967. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7968. } while (0)
  7969. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7970. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7971. /* DWORD 1:NON_ZERO_MPDU */
  7972. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7973. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7974. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7975. do { \
  7976. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7977. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7978. } while (0)
  7979. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7980. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7981. /* DWORD 1:RELEASE_RINGS */
  7982. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7983. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7984. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7985. do { \
  7986. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7987. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7988. } while (0)
  7989. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7990. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7991. /**
  7992. * Enumeration for IP Protocol or IPSEC Protocol
  7993. * IPsec describes the framework for providing security at IP layer.
  7994. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7995. */
  7996. enum htt_rx_flow_proto {
  7997. HTT_RX_FLOW_IP_PROTO,
  7998. HTT_RX_FLOW_IPSEC_PROTO,
  7999. };
  8000. /**
  8001. * Enumeration for FSE Cache Invalidation
  8002. * 0 - No Cache Invalidation required
  8003. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8004. * 2 - Complete FSE Cache Invalidation
  8005. * 3 - FSE Disable
  8006. * 4 - FSE Enable
  8007. */
  8008. enum htt_rx_fse_operation {
  8009. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8010. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8011. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8012. HTT_RX_FSE_DISABLE,
  8013. HTT_RX_FSE_ENABLE,
  8014. };
  8015. /* DWORD 0: Pdev ID */
  8016. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8017. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8018. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8019. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8020. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8021. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8024. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8025. } while (0)
  8026. /* DWORD 1:IP PROTO or IPSEC */
  8027. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8028. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8029. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8030. do { \
  8031. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8032. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8033. } while (0)
  8034. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8035. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8036. /* DWORD 1:FSE Operation */
  8037. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8038. #define HTT_RX_FSE_OPERATION_S 1
  8039. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8040. do { \
  8041. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8042. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8043. } while (0)
  8044. #define HTT_RX_FSE_OPERATION_GET(word) \
  8045. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8046. /* DWORD 2-9:IP Address */
  8047. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8048. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8049. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8050. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8051. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8052. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8053. do { \
  8054. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8055. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8056. } while (0)
  8057. /* DWORD 10:Source Port Number */
  8058. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8059. #define HTT_RX_FSE_SOURCEPORT_S 0
  8060. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8061. do { \
  8062. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8063. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8064. } while (0)
  8065. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8066. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8067. /* DWORD 11:Destination Port Number */
  8068. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8069. #define HTT_RX_FSE_DESTPORT_S 16
  8070. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8071. do { \
  8072. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8073. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8074. } while (0)
  8075. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8076. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8077. /* DWORD 10-11:SPI (In case of IPSEC) */
  8078. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8079. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8080. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8081. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8082. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8083. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8084. do { \
  8085. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8086. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8087. } while (0)
  8088. /* DWORD 12:L4 PROTO */
  8089. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8090. #define HTT_RX_FSE_L4_PROTO_S 0
  8091. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8092. do { \
  8093. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8094. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8095. } while (0)
  8096. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8097. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8098. /**
  8099. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8100. *
  8101. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8102. *
  8103. * |31 24|23 |15 8|7 2|1|0|
  8104. * |----------------+----------------+----------------+----------------|
  8105. * | reserved | pdev_id | msg_type |
  8106. * |---------------------------------+----------------+----------------|
  8107. * | reserved |E|F|
  8108. * |---------------------------------+----------------+----------------|
  8109. * Where E = Configure the target to provide the 3-tuple hash value in
  8110. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8111. * F = Configure the target to provide the 3-tuple hash value in
  8112. * flow_id_toeplitz field of rx_msdu_start tlv
  8113. *
  8114. * The following field definitions describe the format of the 3 tuple hash value
  8115. * message sent from the host to target as part of initialization sequence.
  8116. *
  8117. * Header fields:
  8118. * dword0 - b'7:0 - msg_type: This will be set to
  8119. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8120. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8121. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8122. * specified pdev's LMAC ring.
  8123. * b'31:16 - reserved : Reserved for future use
  8124. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8125. * b'1 - toeplitz_hash_2_or_4_field_enable
  8126. * b'31:2 - reserved : Reserved for future use
  8127. * ---------+------+----------------------------------------------------------
  8128. * bit1 | bit0 | Functionality
  8129. * ---------+------+----------------------------------------------------------
  8130. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8131. * | | in flow_id_toeplitz field
  8132. * ---------+------+----------------------------------------------------------
  8133. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8134. * | | in toeplitz_hash_2_or_4 field
  8135. * ---------+------+----------------------------------------------------------
  8136. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8137. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8138. * ---------+------+----------------------------------------------------------
  8139. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8140. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8141. * | | toeplitz_hash_2_or_4 field
  8142. *----------------------------------------------------------------------------
  8143. */
  8144. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8145. A_UINT32 msg_type :8,
  8146. pdev_id :8,
  8147. reserved0 :16;
  8148. A_UINT32 flow_id_toeplitz_field_enable :1,
  8149. toeplitz_hash_2_or_4_field_enable :1,
  8150. reserved1 :30;
  8151. } POSTPACK;
  8152. /* DWORD0 : pdev_id configuration Macros */
  8153. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8154. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8155. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8156. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8157. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8158. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8159. do { \
  8160. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8161. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8162. } while (0)
  8163. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8164. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8165. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8166. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8167. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8168. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8169. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8170. do { \
  8171. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8172. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8173. } while (0)
  8174. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8175. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8176. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8177. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8178. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8179. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8180. do { \
  8181. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8182. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8183. } while (0)
  8184. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8185. /**
  8186. * @brief host --> target Host PA Address Size
  8187. *
  8188. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8189. *
  8190. * @details
  8191. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8192. * provide the physical start address and size of each of the memory
  8193. * areas within host DDR that the target FW may need to access.
  8194. *
  8195. * For example, the host can use this message to allow the target FW
  8196. * to set up access to the host's pools of TQM link descriptors.
  8197. * The message would appear as follows:
  8198. *
  8199. * |31 24|23 16|15 8|7 0|
  8200. * |----------------+----------------+----------------+----------------|
  8201. * | reserved | num_entries | msg_type |
  8202. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8203. * | mem area 0 size |
  8204. * |----------------+----------------+----------------+----------------|
  8205. * | mem area 0 physical_address_lo |
  8206. * |----------------+----------------+----------------+----------------|
  8207. * | mem area 0 physical_address_hi |
  8208. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8209. * | mem area 1 size |
  8210. * |----------------+----------------+----------------+----------------|
  8211. * | mem area 1 physical_address_lo |
  8212. * |----------------+----------------+----------------+----------------|
  8213. * | mem area 1 physical_address_hi |
  8214. * |----------------+----------------+----------------+----------------|
  8215. * ...
  8216. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8217. * | mem area N size |
  8218. * |----------------+----------------+----------------+----------------|
  8219. * | mem area N physical_address_lo |
  8220. * |----------------+----------------+----------------+----------------|
  8221. * | mem area N physical_address_hi |
  8222. * |----------------+----------------+----------------+----------------|
  8223. *
  8224. * The message is interpreted as follows:
  8225. * dword0 - b'0:7 - msg_type: This will be set to
  8226. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8227. * b'8:15 - number_entries: Indicated the number of host memory
  8228. * areas specified within the remainder of the message
  8229. * b'16:31 - reserved.
  8230. * dword1 - b'0:31 - memory area 0 size in bytes
  8231. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8232. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8233. * and similar for memory area 1 through memory area N.
  8234. */
  8235. PREPACK struct htt_h2t_host_paddr_size {
  8236. A_UINT32 msg_type: 8,
  8237. num_entries: 8,
  8238. reserved: 16;
  8239. } POSTPACK;
  8240. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8241. A_UINT32 size;
  8242. A_UINT32 physical_address_lo;
  8243. A_UINT32 physical_address_hi;
  8244. } POSTPACK;
  8245. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8246. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8247. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8248. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8249. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8250. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8251. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8254. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8255. } while (0)
  8256. /**
  8257. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8258. *
  8259. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8260. *
  8261. * @details
  8262. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8263. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8264. *
  8265. * The message would appear as follows:
  8266. *
  8267. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8268. * |---------------------------------+---+---+----------+-+-----------|
  8269. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8270. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8271. *
  8272. *
  8273. * The message is interpreted as follows:
  8274. * dword0 - b'0:7 - msg_type: This will be set to
  8275. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8276. * b'8 - override bit to drive MSDUs to PPE ring
  8277. * b'9:13 - REO destination ring indication
  8278. * b'14 - Multi buffer msdu override enable bit
  8279. * b'15 - Intra BSS override
  8280. * b'16 - Decap raw override
  8281. * b'17 - Decap Native wifi override
  8282. * b'18 - IP frag override
  8283. * b'19:31 - reserved
  8284. */
  8285. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8286. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8287. override: 1,
  8288. reo_destination_indication: 5,
  8289. multi_buffer_msdu_override_en: 1,
  8290. intra_bss_override: 1,
  8291. decap_raw_override: 1,
  8292. decap_nwifi_override: 1,
  8293. ip_frag_override: 1,
  8294. reserved: 13;
  8295. } POSTPACK;
  8296. /* DWORD 0: Override */
  8297. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8298. #define HTT_PPE_CFG_OVERRIDE_S 8
  8299. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8300. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8301. HTT_PPE_CFG_OVERRIDE_S)
  8302. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8303. do { \
  8304. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8305. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8306. } while (0)
  8307. /* DWORD 0: REO Destination Indication*/
  8308. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8309. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8310. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8311. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8312. HTT_PPE_CFG_REO_DEST_IND_S)
  8313. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8314. do { \
  8315. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8316. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8317. } while (0)
  8318. /* DWORD 0: Multi buffer MSDU override */
  8319. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8320. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8321. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8322. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8323. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8324. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8325. do { \
  8326. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8327. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8328. } while (0)
  8329. /* DWORD 0: Intra BSS override */
  8330. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8331. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8332. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8333. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8334. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8335. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8336. do { \
  8337. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8338. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8339. } while (0)
  8340. /* DWORD 0: Decap RAW override */
  8341. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8342. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8343. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8344. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8345. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8346. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8347. do { \
  8348. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8349. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8350. } while (0)
  8351. /* DWORD 0: Decap NWIFI override */
  8352. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8353. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8354. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8355. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8356. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8357. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8358. do { \
  8359. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8360. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8361. } while (0)
  8362. /* DWORD 0: IP frag override */
  8363. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8364. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8365. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8366. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8367. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8368. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8369. do { \
  8370. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8371. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8372. } while (0)
  8373. /*
  8374. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8375. *
  8376. * @details
  8377. * The following field definitions describe the format of the HTT host
  8378. * to target FW VDEV TX RX stats retrieve message.
  8379. * The message specifies the type of stats the host wants to retrieve.
  8380. *
  8381. * |31 27|26 25|24 17|16|15 8|7 0|
  8382. * |-----------------------------------------------------------|
  8383. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8384. * |-----------------------------------------------------------|
  8385. * | vdev_id lower bitmask |
  8386. * |-----------------------------------------------------------|
  8387. * | vdev_id upper bitmask |
  8388. * |-----------------------------------------------------------|
  8389. * Header fields:
  8390. * Where:
  8391. * dword0 - b'7:0 - msg_type: This will be set to
  8392. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8393. * b'15:8 - pdev id
  8394. * b'16(E) - Enable/Disable the vdev HW stats
  8395. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8396. * b'25:26(R) - Reset stats bits
  8397. * 0: don't reset stats
  8398. * 1: reset stats once
  8399. * 2: reset stats at the start of each periodic interval
  8400. * b'27:31 - reserved for future use
  8401. * dword1 - b'0:31 - vdev_id lower bitmask
  8402. * dword2 - b'0:31 - vdev_id upper bitmask
  8403. */
  8404. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8405. A_UINT32 msg_type :8,
  8406. pdev_id :8,
  8407. enable :1,
  8408. periodic_interval :8,
  8409. reset_stats_bits :2,
  8410. reserved0 :5;
  8411. A_UINT32 vdev_id_lower_bitmask;
  8412. A_UINT32 vdev_id_upper_bitmask;
  8413. } POSTPACK;
  8414. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8415. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8416. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8417. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8418. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8419. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8420. do { \
  8421. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8422. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8423. } while (0)
  8424. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8425. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8426. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8427. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8428. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8429. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8430. do { \
  8431. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8432. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8433. } while (0)
  8434. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8435. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8436. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8437. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8438. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8439. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8442. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8443. } while (0)
  8444. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8445. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8446. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8447. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8448. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8449. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8450. do { \
  8451. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8452. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8453. } while (0)
  8454. /*
  8455. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8456. *
  8457. * @details
  8458. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8459. * the default MSDU queues for one of the TIDs within the specified peer
  8460. * to the specified service class.
  8461. * The TID is indirectly specified - each service class is associated
  8462. * with a TID. All default MSDU queues for this peer-TID will be
  8463. * linked to the service class in question.
  8464. *
  8465. * |31 16|15 8|7 0|
  8466. * |------------------------------+--------------+--------------|
  8467. * | peer ID | svc class ID | msg type |
  8468. * |------------------------------------------------------------|
  8469. * Header fields:
  8470. * dword0 - b'7:0 - msg_type: This will be set to
  8471. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8472. * b'15:8 - service class ID
  8473. * b'31:16 - peer ID
  8474. */
  8475. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8476. A_UINT32 msg_type :8,
  8477. svc_class_id :8,
  8478. peer_id :16;
  8479. } POSTPACK;
  8480. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8481. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8482. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8483. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8484. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8485. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8486. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8489. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8490. } while (0)
  8491. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8492. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8493. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8494. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8495. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8496. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8497. do { \
  8498. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8499. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8500. } while (0)
  8501. /*
  8502. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8503. *
  8504. * @details
  8505. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8506. * remove the linkage of the specified peer-TID's MSDU queues to
  8507. * service classes.
  8508. *
  8509. * |31 16|15 8|7 0|
  8510. * |------------------------------+--------------+--------------|
  8511. * | peer ID | svc class ID | msg type |
  8512. * |------------------------------------------------------------|
  8513. * Header fields:
  8514. * dword0 - b'7:0 - msg_type: This will be set to
  8515. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8516. * b'15:8 - service class ID
  8517. * b'31:16 - peer ID
  8518. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8519. * value for peer ID indicates that the target should
  8520. * apply the UNMAP_REQ to all peers.
  8521. */
  8522. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8523. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8524. A_UINT32 msg_type :8,
  8525. svc_class_id :8,
  8526. peer_id :16;
  8527. } POSTPACK;
  8528. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8529. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8530. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8531. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8532. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8533. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8534. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8535. do { \
  8536. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8537. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8538. } while (0)
  8539. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8540. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8541. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8542. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8543. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8544. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8545. do { \
  8546. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8547. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8548. } while (0)
  8549. /*
  8550. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8551. *
  8552. * @details
  8553. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8554. * request the target to report what service class the default MSDU queues
  8555. * of the specified TIDs within the peer are linked to.
  8556. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8557. * to report what service class (if any) the default MSDU queues for
  8558. * each of the specified TIDs are linked to.
  8559. *
  8560. * |31 16|15 8|7 1| 0|
  8561. * |------------------------------+--------------+--------------|
  8562. * | peer ID | TID mask | msg type |
  8563. * |------------------------------------------------------------|
  8564. * | reserved |ETO|
  8565. * |------------------------------------------------------------|
  8566. * Header fields:
  8567. * dword0 - b'7:0 - msg_type: This will be set to
  8568. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8569. * b'15:8 - TID mask
  8570. * b'31:16 - peer ID
  8571. * dword1 - b'0 - "Existing Tids Only" flag
  8572. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8573. * message generated by this REQ will only show the
  8574. * mapping for TIDs that actually exist in the target's
  8575. * peer object.
  8576. * Any TIDs that are covered by a MAP_REQ but which
  8577. * do not actually exist will be shown as being
  8578. * unmapped (i.e. svc class ID 0xff).
  8579. * If this flag is cleared, the MAP_REPORT_CONF message
  8580. * will consider not only the mapping of TIDs currently
  8581. * existing in the peer, but also the mapping that will
  8582. * be applied for any TID objects created within this
  8583. * peer in the future.
  8584. * b'31:1 - reserved for future use
  8585. */
  8586. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8587. A_UINT32 msg_type :8,
  8588. tid_mask :8,
  8589. peer_id :16;
  8590. A_UINT32 existing_tids_only:1,
  8591. reserved :31;
  8592. } POSTPACK;
  8593. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8594. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8595. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8596. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8597. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8598. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8599. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8600. do { \
  8601. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8602. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8603. } while (0)
  8604. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8605. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8606. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8607. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8608. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8609. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8610. do { \
  8611. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8612. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8613. } while (0)
  8614. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8615. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8616. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8617. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8618. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8619. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8620. do { \
  8621. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8622. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8623. } while (0)
  8624. /*=== target -> host messages ===============================================*/
  8625. enum htt_t2h_msg_type {
  8626. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8627. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8628. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8629. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8630. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8631. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8632. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8633. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8634. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8635. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8636. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8637. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8638. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8639. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8640. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8641. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8642. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8643. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8644. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8645. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8646. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8647. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8648. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8649. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8650. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8651. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8652. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8653. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8654. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8655. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8656. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8657. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8658. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8659. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8660. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8661. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8662. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8663. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8664. /* TX_OFFLOAD_DELIVER_IND:
  8665. * Forward the target's locally-generated packets to the host,
  8666. * to provide to the monitor mode interface.
  8667. */
  8668. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8669. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8670. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8671. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8672. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8673. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8674. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8675. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8676. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8677. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8678. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8679. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8680. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8681. HTT_T2H_MSG_TYPE_TEST,
  8682. /* keep this last */
  8683. HTT_T2H_NUM_MSGS
  8684. };
  8685. /*
  8686. * HTT target to host message type -
  8687. * stored in bits 7:0 of the first word of the message
  8688. */
  8689. #define HTT_T2H_MSG_TYPE_M 0xff
  8690. #define HTT_T2H_MSG_TYPE_S 0
  8691. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8692. do { \
  8693. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8694. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8695. } while (0)
  8696. #define HTT_T2H_MSG_TYPE_GET(word) \
  8697. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8698. /**
  8699. * @brief target -> host version number confirmation message definition
  8700. *
  8701. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8702. *
  8703. * |31 24|23 16|15 8|7 0|
  8704. * |----------------+----------------+----------------+----------------|
  8705. * | reserved | major number | minor number | msg type |
  8706. * |-------------------------------------------------------------------|
  8707. * : option request TLV (optional) |
  8708. * :...................................................................:
  8709. *
  8710. * The VER_CONF message may consist of a single 4-byte word, or may be
  8711. * extended with TLVs that specify HTT options selected by the target.
  8712. * The following option TLVs may be appended to the VER_CONF message:
  8713. * - LL_BUS_ADDR_SIZE
  8714. * - HL_SUPPRESS_TX_COMPL_IND
  8715. * - MAX_TX_QUEUE_GROUPS
  8716. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8717. * may be appended to the VER_CONF message (but only one TLV of each type).
  8718. *
  8719. * Header fields:
  8720. * - MSG_TYPE
  8721. * Bits 7:0
  8722. * Purpose: identifies this as a version number confirmation message
  8723. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8724. * - VER_MINOR
  8725. * Bits 15:8
  8726. * Purpose: Specify the minor number of the HTT message library version
  8727. * in use by the target firmware.
  8728. * The minor number specifies the specific revision within a range
  8729. * of fundamentally compatible HTT message definition revisions.
  8730. * Compatible revisions involve adding new messages or perhaps
  8731. * adding new fields to existing messages, in a backwards-compatible
  8732. * manner.
  8733. * Incompatible revisions involve changing the message type values,
  8734. * or redefining existing messages.
  8735. * Value: minor number
  8736. * - VER_MAJOR
  8737. * Bits 15:8
  8738. * Purpose: Specify the major number of the HTT message library version
  8739. * in use by the target firmware.
  8740. * The major number specifies the family of minor revisions that are
  8741. * fundamentally compatible with each other, but not with prior or
  8742. * later families.
  8743. * Value: major number
  8744. */
  8745. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8746. #define HTT_VER_CONF_MINOR_S 8
  8747. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8748. #define HTT_VER_CONF_MAJOR_S 16
  8749. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8750. do { \
  8751. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8752. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8753. } while (0)
  8754. #define HTT_VER_CONF_MINOR_GET(word) \
  8755. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8756. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8757. do { \
  8758. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8759. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8760. } while (0)
  8761. #define HTT_VER_CONF_MAJOR_GET(word) \
  8762. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8763. #define HTT_VER_CONF_BYTES 4
  8764. /**
  8765. * @brief - target -> host HTT Rx In order indication message
  8766. *
  8767. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8768. *
  8769. * @details
  8770. *
  8771. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8772. * |----------------+-------------------+---------------------+---------------|
  8773. * | peer ID | P| F| O| ext TID | msg type |
  8774. * |--------------------------------------------------------------------------|
  8775. * | MSDU count | Reserved | vdev id |
  8776. * |--------------------------------------------------------------------------|
  8777. * | MSDU 0 bus address (bits 31:0) |
  8778. #if HTT_PADDR64
  8779. * | MSDU 0 bus address (bits 63:32) |
  8780. #endif
  8781. * |--------------------------------------------------------------------------|
  8782. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8783. * |--------------------------------------------------------------------------|
  8784. * | MSDU 1 bus address (bits 31:0) |
  8785. #if HTT_PADDR64
  8786. * | MSDU 1 bus address (bits 63:32) |
  8787. #endif
  8788. * |--------------------------------------------------------------------------|
  8789. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8790. * |--------------------------------------------------------------------------|
  8791. */
  8792. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8793. *
  8794. * @details
  8795. * bits
  8796. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8797. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8798. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8799. * | | frag | | | | fail |chksum fail|
  8800. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8801. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8802. */
  8803. struct htt_rx_in_ord_paddr_ind_hdr_t
  8804. {
  8805. A_UINT32 /* word 0 */
  8806. msg_type: 8,
  8807. ext_tid: 5,
  8808. offload: 1,
  8809. frag: 1,
  8810. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8811. peer_id: 16;
  8812. A_UINT32 /* word 1 */
  8813. vap_id: 8,
  8814. /* NOTE:
  8815. * This reserved_1 field is not truly reserved - certain targets use
  8816. * this field internally to store debug information, and do not zero
  8817. * out the contents of the field before uploading the message to the
  8818. * host. Thus, any host-target communication supported by this field
  8819. * is limited to using values that are never used by the debug
  8820. * information stored by certain targets in the reserved_1 field.
  8821. * In particular, the targets in question don't use the value 0x3
  8822. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8823. * so this previously-unused value within these bits is available to
  8824. * use as the host / target PKT_CAPTURE_MODE flag.
  8825. */
  8826. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8827. /* if pkt_capture_mode == 0x3, host should
  8828. * send rx frames to monitor mode interface
  8829. */
  8830. msdu_cnt: 16;
  8831. };
  8832. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8833. {
  8834. A_UINT32 dma_addr;
  8835. A_UINT32
  8836. length: 16,
  8837. fw_desc: 8,
  8838. msdu_info:8;
  8839. };
  8840. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8841. {
  8842. A_UINT32 dma_addr_lo;
  8843. A_UINT32 dma_addr_hi;
  8844. A_UINT32
  8845. length: 16,
  8846. fw_desc: 8,
  8847. msdu_info:8;
  8848. };
  8849. #if HTT_PADDR64
  8850. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8851. #else
  8852. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8853. #endif
  8854. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8855. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8856. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8857. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8858. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8859. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8860. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8861. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8862. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8863. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8864. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8865. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8866. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8867. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8868. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8869. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8870. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8871. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8872. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8873. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8874. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8875. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8876. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8877. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8878. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8879. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8880. /* for systems using 64-bit format for bus addresses */
  8881. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8882. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8883. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8884. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8885. /* for systems using 32-bit format for bus addresses */
  8886. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8887. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8888. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8889. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8890. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8891. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8892. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8893. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8894. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8895. do { \
  8896. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8897. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8898. } while (0)
  8899. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8900. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8901. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8902. do { \
  8903. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8904. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8905. } while (0)
  8906. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8907. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8908. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8909. do { \
  8910. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8911. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8912. } while (0)
  8913. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8914. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8915. /*
  8916. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8917. * deliver the rx frames to the monitor mode interface.
  8918. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8919. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8920. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8921. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8922. */
  8923. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8924. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8925. do { \
  8926. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8927. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8928. } while (0)
  8929. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8930. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8931. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8932. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8933. do { \
  8934. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8935. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8936. } while (0)
  8937. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8938. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8939. /* for systems using 64-bit format for bus addresses */
  8940. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8941. do { \
  8942. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8943. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8944. } while (0)
  8945. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8946. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8947. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8948. do { \
  8949. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8950. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8951. } while (0)
  8952. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8953. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8954. /* for systems using 32-bit format for bus addresses */
  8955. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8956. do { \
  8957. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8958. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8959. } while (0)
  8960. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8961. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8962. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8963. do { \
  8964. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8965. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8966. } while (0)
  8967. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8968. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8969. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8970. do { \
  8971. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8972. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8973. } while (0)
  8974. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8975. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8976. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8977. do { \
  8978. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8979. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8980. } while (0)
  8981. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8982. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8983. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8986. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8987. } while (0)
  8988. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8989. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8990. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8991. do { \
  8992. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8993. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8994. } while (0)
  8995. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8996. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8997. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8998. do { \
  8999. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9000. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9001. } while (0)
  9002. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9003. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9004. /* definitions used within target -> host rx indication message */
  9005. PREPACK struct htt_rx_ind_hdr_prefix_t
  9006. {
  9007. A_UINT32 /* word 0 */
  9008. msg_type: 8,
  9009. ext_tid: 5,
  9010. release_valid: 1,
  9011. flush_valid: 1,
  9012. reserved0: 1,
  9013. peer_id: 16;
  9014. A_UINT32 /* word 1 */
  9015. flush_start_seq_num: 6,
  9016. flush_end_seq_num: 6,
  9017. release_start_seq_num: 6,
  9018. release_end_seq_num: 6,
  9019. num_mpdu_ranges: 8;
  9020. } POSTPACK;
  9021. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9022. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9023. #define HTT_TGT_RSSI_INVALID 0x80
  9024. PREPACK struct htt_rx_ppdu_desc_t
  9025. {
  9026. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9027. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9028. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9029. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9030. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9031. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9032. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9033. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9034. A_UINT32 /* word 0 */
  9035. rssi_cmb: 8,
  9036. timestamp_submicrosec: 8,
  9037. phy_err_code: 8,
  9038. phy_err: 1,
  9039. legacy_rate: 4,
  9040. legacy_rate_sel: 1,
  9041. end_valid: 1,
  9042. start_valid: 1;
  9043. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9044. union {
  9045. A_UINT32 /* word 1 */
  9046. rssi0_pri20: 8,
  9047. rssi0_ext20: 8,
  9048. rssi0_ext40: 8,
  9049. rssi0_ext80: 8;
  9050. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9051. } u0;
  9052. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9053. union {
  9054. A_UINT32 /* word 2 */
  9055. rssi1_pri20: 8,
  9056. rssi1_ext20: 8,
  9057. rssi1_ext40: 8,
  9058. rssi1_ext80: 8;
  9059. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9060. } u1;
  9061. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9062. union {
  9063. A_UINT32 /* word 3 */
  9064. rssi2_pri20: 8,
  9065. rssi2_ext20: 8,
  9066. rssi2_ext40: 8,
  9067. rssi2_ext80: 8;
  9068. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9069. } u2;
  9070. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9071. union {
  9072. A_UINT32 /* word 4 */
  9073. rssi3_pri20: 8,
  9074. rssi3_ext20: 8,
  9075. rssi3_ext40: 8,
  9076. rssi3_ext80: 8;
  9077. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9078. } u3;
  9079. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9080. A_UINT32 tsf32; /* word 5 */
  9081. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9082. A_UINT32 timestamp_microsec; /* word 6 */
  9083. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9084. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9085. A_UINT32 /* word 7 */
  9086. vht_sig_a1: 24,
  9087. preamble_type: 8;
  9088. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9089. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9090. A_UINT32 /* word 8 */
  9091. vht_sig_a2: 24,
  9092. /* sa_ant_matrix
  9093. * For cases where a single rx chain has options to be connected to
  9094. * different rx antennas, show which rx antennas were in use during
  9095. * receipt of a given PPDU.
  9096. * This sa_ant_matrix provides a bitmask of the antennas used while
  9097. * receiving this frame.
  9098. */
  9099. sa_ant_matrix: 8;
  9100. } POSTPACK;
  9101. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9102. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9103. PREPACK struct htt_rx_ind_hdr_suffix_t
  9104. {
  9105. A_UINT32 /* word 0 */
  9106. fw_rx_desc_bytes: 16,
  9107. reserved0: 16;
  9108. } POSTPACK;
  9109. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9110. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9111. PREPACK struct htt_rx_ind_hdr_t
  9112. {
  9113. struct htt_rx_ind_hdr_prefix_t prefix;
  9114. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9115. struct htt_rx_ind_hdr_suffix_t suffix;
  9116. } POSTPACK;
  9117. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9118. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9119. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9120. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9121. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9122. /*
  9123. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9124. * the offset into the HTT rx indication message at which the
  9125. * FW rx PPDU descriptor resides
  9126. */
  9127. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9128. /*
  9129. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9130. * the offset into the HTT rx indication message at which the
  9131. * header suffix (FW rx MSDU byte count) resides
  9132. */
  9133. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9134. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9135. /*
  9136. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9137. * the offset into the HTT rx indication message at which the per-MSDU
  9138. * information starts
  9139. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9140. * per-MSDU information portion of the message. The per-MSDU info itself
  9141. * starts at byte 12.
  9142. */
  9143. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9144. /**
  9145. * @brief target -> host rx indication message definition
  9146. *
  9147. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9148. *
  9149. * @details
  9150. * The following field definitions describe the format of the rx indication
  9151. * message sent from the target to the host.
  9152. * The message consists of three major sections:
  9153. * 1. a fixed-length header
  9154. * 2. a variable-length list of firmware rx MSDU descriptors
  9155. * 3. one or more 4-octet MPDU range information elements
  9156. * The fixed length header itself has two sub-sections
  9157. * 1. the message meta-information, including identification of the
  9158. * sender and type of the received data, and a 4-octet flush/release IE
  9159. * 2. the firmware rx PPDU descriptor
  9160. *
  9161. * The format of the message is depicted below.
  9162. * in this depiction, the following abbreviations are used for information
  9163. * elements within the message:
  9164. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9165. * elements associated with the PPDU start are valid.
  9166. * Specifically, the following fields are valid only if SV is set:
  9167. * RSSI (all variants), L, legacy rate, preamble type, service,
  9168. * VHT-SIG-A
  9169. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9170. * elements associated with the PPDU end are valid.
  9171. * Specifically, the following fields are valid only if EV is set:
  9172. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9173. * - L - Legacy rate selector - if legacy rates are used, this flag
  9174. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9175. * (L == 0) PHY.
  9176. * - P - PHY error flag - boolean indication of whether the rx frame had
  9177. * a PHY error
  9178. *
  9179. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9180. * |----------------+-------------------+---------------------+---------------|
  9181. * | peer ID | |RV|FV| ext TID | msg type |
  9182. * |--------------------------------------------------------------------------|
  9183. * | num | release | release | flush | flush |
  9184. * | MPDU | end | start | end | start |
  9185. * | ranges | seq num | seq num | seq num | seq num |
  9186. * |==========================================================================|
  9187. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9188. * |V|V| | rate | | | timestamp | RSSI |
  9189. * |--------------------------------------------------------------------------|
  9190. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9191. * |--------------------------------------------------------------------------|
  9192. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9193. * |--------------------------------------------------------------------------|
  9194. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9195. * |--------------------------------------------------------------------------|
  9196. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9197. * |--------------------------------------------------------------------------|
  9198. * | TSF LSBs |
  9199. * |--------------------------------------------------------------------------|
  9200. * | microsec timestamp |
  9201. * |--------------------------------------------------------------------------|
  9202. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9203. * |--------------------------------------------------------------------------|
  9204. * | service | HT-SIG / VHT-SIG-A2 |
  9205. * |==========================================================================|
  9206. * | reserved | FW rx desc bytes |
  9207. * |--------------------------------------------------------------------------|
  9208. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9209. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9210. * |--------------------------------------------------------------------------|
  9211. * : : :
  9212. * |--------------------------------------------------------------------------|
  9213. * | alignment | MSDU Rx |
  9214. * | padding | desc Bn |
  9215. * |--------------------------------------------------------------------------|
  9216. * | reserved | MPDU range status | MPDU count |
  9217. * |--------------------------------------------------------------------------|
  9218. * : reserved : MPDU range status : MPDU count :
  9219. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9220. *
  9221. * Header fields:
  9222. * - MSG_TYPE
  9223. * Bits 7:0
  9224. * Purpose: identifies this as an rx indication message
  9225. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9226. * - EXT_TID
  9227. * Bits 12:8
  9228. * Purpose: identify the traffic ID of the rx data, including
  9229. * special "extended" TID values for multicast, broadcast, and
  9230. * non-QoS data frames
  9231. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9232. * - FLUSH_VALID (FV)
  9233. * Bit 13
  9234. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9235. * is valid
  9236. * Value:
  9237. * 1 -> flush IE is valid and needs to be processed
  9238. * 0 -> flush IE is not valid and should be ignored
  9239. * - REL_VALID (RV)
  9240. * Bit 13
  9241. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9242. * is valid
  9243. * Value:
  9244. * 1 -> release IE is valid and needs to be processed
  9245. * 0 -> release IE is not valid and should be ignored
  9246. * - PEER_ID
  9247. * Bits 31:16
  9248. * Purpose: Identify, by ID, which peer sent the rx data
  9249. * Value: ID of the peer who sent the rx data
  9250. * - FLUSH_SEQ_NUM_START
  9251. * Bits 5:0
  9252. * Purpose: Indicate the start of a series of MPDUs to flush
  9253. * Not all MPDUs within this series are necessarily valid - the host
  9254. * must check each sequence number within this range to see if the
  9255. * corresponding MPDU is actually present.
  9256. * This field is only valid if the FV bit is set.
  9257. * Value:
  9258. * The sequence number for the first MPDUs to check to flush.
  9259. * The sequence number is masked by 0x3f.
  9260. * - FLUSH_SEQ_NUM_END
  9261. * Bits 11:6
  9262. * Purpose: Indicate the end of a series of MPDUs to flush
  9263. * Value:
  9264. * The sequence number one larger than the sequence number of the
  9265. * last MPDU to check to flush.
  9266. * The sequence number is masked by 0x3f.
  9267. * Not all MPDUs within this series are necessarily valid - the host
  9268. * must check each sequence number within this range to see if the
  9269. * corresponding MPDU is actually present.
  9270. * This field is only valid if the FV bit is set.
  9271. * - REL_SEQ_NUM_START
  9272. * Bits 17:12
  9273. * Purpose: Indicate the start of a series of MPDUs to release.
  9274. * All MPDUs within this series are present and valid - the host
  9275. * need not check each sequence number within this range to see if
  9276. * the corresponding MPDU is actually present.
  9277. * This field is only valid if the RV bit is set.
  9278. * Value:
  9279. * The sequence number for the first MPDUs to check to release.
  9280. * The sequence number is masked by 0x3f.
  9281. * - REL_SEQ_NUM_END
  9282. * Bits 23:18
  9283. * Purpose: Indicate the end of a series of MPDUs to release.
  9284. * Value:
  9285. * The sequence number one larger than the sequence number of the
  9286. * last MPDU to check to release.
  9287. * The sequence number is masked by 0x3f.
  9288. * All MPDUs within this series are present and valid - the host
  9289. * need not check each sequence number within this range to see if
  9290. * the corresponding MPDU is actually present.
  9291. * This field is only valid if the RV bit is set.
  9292. * - NUM_MPDU_RANGES
  9293. * Bits 31:24
  9294. * Purpose: Indicate how many ranges of MPDUs are present.
  9295. * Each MPDU range consists of a series of contiguous MPDUs within the
  9296. * rx frame sequence which all have the same MPDU status.
  9297. * Value: 1-63 (typically a small number, like 1-3)
  9298. *
  9299. * Rx PPDU descriptor fields:
  9300. * - RSSI_CMB
  9301. * Bits 7:0
  9302. * Purpose: Combined RSSI from all active rx chains, across the active
  9303. * bandwidth.
  9304. * Value: RSSI dB units w.r.t. noise floor
  9305. * - TIMESTAMP_SUBMICROSEC
  9306. * Bits 15:8
  9307. * Purpose: high-resolution timestamp
  9308. * Value:
  9309. * Sub-microsecond time of PPDU reception.
  9310. * This timestamp ranges from [0,MAC clock MHz).
  9311. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9312. * to form a high-resolution, large range rx timestamp.
  9313. * - PHY_ERR_CODE
  9314. * Bits 23:16
  9315. * Purpose:
  9316. * If the rx frame processing resulted in a PHY error, indicate what
  9317. * type of rx PHY error occurred.
  9318. * Value:
  9319. * This field is valid if the "P" (PHY_ERR) flag is set.
  9320. * TBD: document/specify the values for this field
  9321. * - PHY_ERR
  9322. * Bit 24
  9323. * Purpose: indicate whether the rx PPDU had a PHY error
  9324. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9325. * - LEGACY_RATE
  9326. * Bits 28:25
  9327. * Purpose:
  9328. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9329. * specify which rate was used.
  9330. * Value:
  9331. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9332. * flag.
  9333. * If LEGACY_RATE_SEL is 0:
  9334. * 0x8: OFDM 48 Mbps
  9335. * 0x9: OFDM 24 Mbps
  9336. * 0xA: OFDM 12 Mbps
  9337. * 0xB: OFDM 6 Mbps
  9338. * 0xC: OFDM 54 Mbps
  9339. * 0xD: OFDM 36 Mbps
  9340. * 0xE: OFDM 18 Mbps
  9341. * 0xF: OFDM 9 Mbps
  9342. * If LEGACY_RATE_SEL is 1:
  9343. * 0x8: CCK 11 Mbps long preamble
  9344. * 0x9: CCK 5.5 Mbps long preamble
  9345. * 0xA: CCK 2 Mbps long preamble
  9346. * 0xB: CCK 1 Mbps long preamble
  9347. * 0xC: CCK 11 Mbps short preamble
  9348. * 0xD: CCK 5.5 Mbps short preamble
  9349. * 0xE: CCK 2 Mbps short preamble
  9350. * - LEGACY_RATE_SEL
  9351. * Bit 29
  9352. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9353. * Value:
  9354. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9355. * used a legacy rate.
  9356. * 0 -> OFDM, 1 -> CCK
  9357. * - END_VALID
  9358. * Bit 30
  9359. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9360. * the start of the PPDU are valid. Specifically, the following
  9361. * fields are only valid if END_VALID is set:
  9362. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9363. * TIMESTAMP_SUBMICROSEC
  9364. * Value:
  9365. * 0 -> rx PPDU desc end fields are not valid
  9366. * 1 -> rx PPDU desc end fields are valid
  9367. * - START_VALID
  9368. * Bit 31
  9369. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9370. * the end of the PPDU are valid. Specifically, the following
  9371. * fields are only valid if START_VALID is set:
  9372. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9373. * VHT-SIG-A
  9374. * Value:
  9375. * 0 -> rx PPDU desc start fields are not valid
  9376. * 1 -> rx PPDU desc start fields are valid
  9377. * - RSSI0_PRI20
  9378. * Bits 7:0
  9379. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9380. * Value: RSSI dB units w.r.t. noise floor
  9381. *
  9382. * - RSSI0_EXT20
  9383. * Bits 7:0
  9384. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9385. * (if the rx bandwidth was >= 40 MHz)
  9386. * Value: RSSI dB units w.r.t. noise floor
  9387. * - RSSI0_EXT40
  9388. * Bits 7:0
  9389. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9390. * (if the rx bandwidth was >= 80 MHz)
  9391. * Value: RSSI dB units w.r.t. noise floor
  9392. * - RSSI0_EXT80
  9393. * Bits 7:0
  9394. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9395. * (if the rx bandwidth was >= 160 MHz)
  9396. * Value: RSSI dB units w.r.t. noise floor
  9397. *
  9398. * - RSSI1_PRI20
  9399. * Bits 7:0
  9400. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9401. * Value: RSSI dB units w.r.t. noise floor
  9402. * - RSSI1_EXT20
  9403. * Bits 7:0
  9404. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9405. * (if the rx bandwidth was >= 40 MHz)
  9406. * Value: RSSI dB units w.r.t. noise floor
  9407. * - RSSI1_EXT40
  9408. * Bits 7:0
  9409. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9410. * (if the rx bandwidth was >= 80 MHz)
  9411. * Value: RSSI dB units w.r.t. noise floor
  9412. * - RSSI1_EXT80
  9413. * Bits 7:0
  9414. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9415. * (if the rx bandwidth was >= 160 MHz)
  9416. * Value: RSSI dB units w.r.t. noise floor
  9417. *
  9418. * - RSSI2_PRI20
  9419. * Bits 7:0
  9420. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9421. * Value: RSSI dB units w.r.t. noise floor
  9422. * - RSSI2_EXT20
  9423. * Bits 7:0
  9424. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9425. * (if the rx bandwidth was >= 40 MHz)
  9426. * Value: RSSI dB units w.r.t. noise floor
  9427. * - RSSI2_EXT40
  9428. * Bits 7:0
  9429. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9430. * (if the rx bandwidth was >= 80 MHz)
  9431. * Value: RSSI dB units w.r.t. noise floor
  9432. * - RSSI2_EXT80
  9433. * Bits 7:0
  9434. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9435. * (if the rx bandwidth was >= 160 MHz)
  9436. * Value: RSSI dB units w.r.t. noise floor
  9437. *
  9438. * - RSSI3_PRI20
  9439. * Bits 7:0
  9440. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9441. * Value: RSSI dB units w.r.t. noise floor
  9442. * - RSSI3_EXT20
  9443. * Bits 7:0
  9444. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9445. * (if the rx bandwidth was >= 40 MHz)
  9446. * Value: RSSI dB units w.r.t. noise floor
  9447. * - RSSI3_EXT40
  9448. * Bits 7:0
  9449. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9450. * (if the rx bandwidth was >= 80 MHz)
  9451. * Value: RSSI dB units w.r.t. noise floor
  9452. * - RSSI3_EXT80
  9453. * Bits 7:0
  9454. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9455. * (if the rx bandwidth was >= 160 MHz)
  9456. * Value: RSSI dB units w.r.t. noise floor
  9457. *
  9458. * - TSF32
  9459. * Bits 31:0
  9460. * Purpose: specify the time the rx PPDU was received, in TSF units
  9461. * Value: 32 LSBs of the TSF
  9462. * - TIMESTAMP_MICROSEC
  9463. * Bits 31:0
  9464. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9465. * Value: PPDU rx time, in microseconds
  9466. * - VHT_SIG_A1
  9467. * Bits 23:0
  9468. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9469. * from the rx PPDU
  9470. * Value:
  9471. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9472. * VHT-SIG-A1 data.
  9473. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9474. * first 24 bits of the HT-SIG data.
  9475. * Otherwise, this field is invalid.
  9476. * Refer to the the 802.11 protocol for the definition of the
  9477. * HT-SIG and VHT-SIG-A1 fields
  9478. * - VHT_SIG_A2
  9479. * Bits 23:0
  9480. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9481. * from the rx PPDU
  9482. * Value:
  9483. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9484. * VHT-SIG-A2 data.
  9485. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9486. * last 24 bits of the HT-SIG data.
  9487. * Otherwise, this field is invalid.
  9488. * Refer to the the 802.11 protocol for the definition of the
  9489. * HT-SIG and VHT-SIG-A2 fields
  9490. * - PREAMBLE_TYPE
  9491. * Bits 31:24
  9492. * Purpose: indicate the PHY format of the received burst
  9493. * Value:
  9494. * 0x4: Legacy (OFDM/CCK)
  9495. * 0x8: HT
  9496. * 0x9: HT with TxBF
  9497. * 0xC: VHT
  9498. * 0xD: VHT with TxBF
  9499. * - SERVICE
  9500. * Bits 31:24
  9501. * Purpose: TBD
  9502. * Value: TBD
  9503. *
  9504. * Rx MSDU descriptor fields:
  9505. * - FW_RX_DESC_BYTES
  9506. * Bits 15:0
  9507. * Purpose: Indicate how many bytes in the Rx indication are used for
  9508. * FW Rx descriptors
  9509. *
  9510. * Payload fields:
  9511. * - MPDU_COUNT
  9512. * Bits 7:0
  9513. * Purpose: Indicate how many sequential MPDUs share the same status.
  9514. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9515. * - MPDU_STATUS
  9516. * Bits 15:8
  9517. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9518. * received successfully.
  9519. * Value:
  9520. * 0x1: success
  9521. * 0x2: FCS error
  9522. * 0x3: duplicate error
  9523. * 0x4: replay error
  9524. * 0x5: invalid peer
  9525. */
  9526. /* header fields */
  9527. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9528. #define HTT_RX_IND_EXT_TID_S 8
  9529. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9530. #define HTT_RX_IND_FLUSH_VALID_S 13
  9531. #define HTT_RX_IND_REL_VALID_M 0x4000
  9532. #define HTT_RX_IND_REL_VALID_S 14
  9533. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9534. #define HTT_RX_IND_PEER_ID_S 16
  9535. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9536. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9537. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9538. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9539. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9540. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9541. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9542. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9543. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9544. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9545. /* rx PPDU descriptor fields */
  9546. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9547. #define HTT_RX_IND_RSSI_CMB_S 0
  9548. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9549. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9550. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9551. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9552. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9553. #define HTT_RX_IND_PHY_ERR_S 24
  9554. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9555. #define HTT_RX_IND_LEGACY_RATE_S 25
  9556. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9557. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9558. #define HTT_RX_IND_END_VALID_M 0x40000000
  9559. #define HTT_RX_IND_END_VALID_S 30
  9560. #define HTT_RX_IND_START_VALID_M 0x80000000
  9561. #define HTT_RX_IND_START_VALID_S 31
  9562. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9563. #define HTT_RX_IND_RSSI_PRI20_S 0
  9564. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9565. #define HTT_RX_IND_RSSI_EXT20_S 8
  9566. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9567. #define HTT_RX_IND_RSSI_EXT40_S 16
  9568. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9569. #define HTT_RX_IND_RSSI_EXT80_S 24
  9570. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9571. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9572. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9573. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9574. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9575. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9576. #define HTT_RX_IND_SERVICE_M 0xff000000
  9577. #define HTT_RX_IND_SERVICE_S 24
  9578. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9579. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9580. /* rx MSDU descriptor fields */
  9581. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9582. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9583. /* payload fields */
  9584. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9585. #define HTT_RX_IND_MPDU_COUNT_S 0
  9586. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9587. #define HTT_RX_IND_MPDU_STATUS_S 8
  9588. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9589. do { \
  9590. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9591. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9592. } while (0)
  9593. #define HTT_RX_IND_EXT_TID_GET(word) \
  9594. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9595. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9596. do { \
  9597. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9598. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9599. } while (0)
  9600. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9601. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9602. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9603. do { \
  9604. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9605. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9606. } while (0)
  9607. #define HTT_RX_IND_REL_VALID_GET(word) \
  9608. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9609. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9610. do { \
  9611. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9612. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9613. } while (0)
  9614. #define HTT_RX_IND_PEER_ID_GET(word) \
  9615. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9616. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9617. do { \
  9618. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9619. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9620. } while (0)
  9621. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9622. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9623. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9624. do { \
  9625. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9626. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9627. } while (0)
  9628. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9629. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9630. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9631. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9632. do { \
  9633. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9634. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9635. } while (0)
  9636. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9637. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9638. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9639. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9640. do { \
  9641. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9642. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9643. } while (0)
  9644. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9645. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9646. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9647. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9648. do { \
  9649. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9650. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9651. } while (0)
  9652. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9653. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9654. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9655. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9656. do { \
  9657. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9658. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9659. } while (0)
  9660. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9661. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9662. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9663. /* FW rx PPDU descriptor fields */
  9664. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9665. do { \
  9666. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9667. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9668. } while (0)
  9669. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9670. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9671. HTT_RX_IND_RSSI_CMB_S)
  9672. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9673. do { \
  9674. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9675. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9676. } while (0)
  9677. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9678. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9679. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9680. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9681. do { \
  9682. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9683. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9684. } while (0)
  9685. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9686. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9687. HTT_RX_IND_PHY_ERR_CODE_S)
  9688. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9689. do { \
  9690. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9691. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9692. } while (0)
  9693. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9694. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9695. HTT_RX_IND_PHY_ERR_S)
  9696. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9697. do { \
  9698. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9699. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9700. } while (0)
  9701. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9702. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9703. HTT_RX_IND_LEGACY_RATE_S)
  9704. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9705. do { \
  9706. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9707. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9708. } while (0)
  9709. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9710. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9711. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9712. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9713. do { \
  9714. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9715. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9716. } while (0)
  9717. #define HTT_RX_IND_END_VALID_GET(word) \
  9718. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9719. HTT_RX_IND_END_VALID_S)
  9720. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9721. do { \
  9722. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9723. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9724. } while (0)
  9725. #define HTT_RX_IND_START_VALID_GET(word) \
  9726. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9727. HTT_RX_IND_START_VALID_S)
  9728. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9729. do { \
  9730. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9731. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9732. } while (0)
  9733. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9734. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9735. HTT_RX_IND_RSSI_PRI20_S)
  9736. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9737. do { \
  9738. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9739. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9740. } while (0)
  9741. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9742. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9743. HTT_RX_IND_RSSI_EXT20_S)
  9744. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9745. do { \
  9746. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9747. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9748. } while (0)
  9749. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9750. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9751. HTT_RX_IND_RSSI_EXT40_S)
  9752. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9753. do { \
  9754. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9755. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9756. } while (0)
  9757. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9758. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9759. HTT_RX_IND_RSSI_EXT80_S)
  9760. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9761. do { \
  9762. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9763. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9764. } while (0)
  9765. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9766. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9767. HTT_RX_IND_VHT_SIG_A1_S)
  9768. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9769. do { \
  9770. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9771. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9772. } while (0)
  9773. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9774. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9775. HTT_RX_IND_VHT_SIG_A2_S)
  9776. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9777. do { \
  9778. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9779. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9780. } while (0)
  9781. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9782. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9783. HTT_RX_IND_PREAMBLE_TYPE_S)
  9784. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9785. do { \
  9786. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9787. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9788. } while (0)
  9789. #define HTT_RX_IND_SERVICE_GET(word) \
  9790. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9791. HTT_RX_IND_SERVICE_S)
  9792. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9793. do { \
  9794. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9795. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9796. } while (0)
  9797. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9798. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9799. HTT_RX_IND_SA_ANT_MATRIX_S)
  9800. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9801. do { \
  9802. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9803. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9804. } while (0)
  9805. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9806. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9807. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9808. do { \
  9809. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9810. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9811. } while (0)
  9812. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9813. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9814. #define HTT_RX_IND_HL_BYTES \
  9815. (HTT_RX_IND_HDR_BYTES + \
  9816. 4 /* single FW rx MSDU descriptor */ + \
  9817. 4 /* single MPDU range information element */)
  9818. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9819. /* Could we use one macro entry? */
  9820. #define HTT_WORD_SET(word, field, value) \
  9821. do { \
  9822. HTT_CHECK_SET_VAL(field, value); \
  9823. (word) |= ((value) << field ## _S); \
  9824. } while (0)
  9825. #define HTT_WORD_GET(word, field) \
  9826. (((word) & field ## _M) >> field ## _S)
  9827. PREPACK struct hl_htt_rx_ind_base {
  9828. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9829. } POSTPACK;
  9830. /*
  9831. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9832. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9833. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9834. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9835. * htt_rx_ind_hl_rx_desc_t.
  9836. */
  9837. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9838. struct htt_rx_ind_hl_rx_desc_t {
  9839. A_UINT8 ver;
  9840. A_UINT8 len;
  9841. struct {
  9842. A_UINT8
  9843. first_msdu: 1,
  9844. last_msdu: 1,
  9845. c3_failed: 1,
  9846. c4_failed: 1,
  9847. ipv6: 1,
  9848. tcp: 1,
  9849. udp: 1,
  9850. reserved: 1;
  9851. } flags;
  9852. /* NOTE: no reserved space - don't append any new fields here */
  9853. };
  9854. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9855. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9856. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9857. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9858. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9859. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9860. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9861. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9862. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9863. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9864. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9865. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9866. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9867. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9868. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9869. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9870. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9871. /* This structure is used in HL, the basic descriptor information
  9872. * used by host. the structure is translated by FW from HW desc
  9873. * or generated by FW. But in HL monitor mode, the host would use
  9874. * the same structure with LL.
  9875. */
  9876. PREPACK struct hl_htt_rx_desc_base {
  9877. A_UINT32
  9878. seq_num:12,
  9879. encrypted:1,
  9880. chan_info_present:1,
  9881. resv0:2,
  9882. mcast_bcast:1,
  9883. fragment:1,
  9884. key_id_oct:8,
  9885. resv1:6;
  9886. A_UINT32
  9887. pn_31_0;
  9888. union {
  9889. struct {
  9890. A_UINT16 pn_47_32;
  9891. A_UINT16 pn_63_48;
  9892. } pn16;
  9893. A_UINT32 pn_63_32;
  9894. } u0;
  9895. A_UINT32
  9896. pn_95_64;
  9897. A_UINT32
  9898. pn_127_96;
  9899. } POSTPACK;
  9900. /*
  9901. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9902. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9903. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9904. * Please see htt_chan_change_t for description of the fields.
  9905. */
  9906. PREPACK struct htt_chan_info_t
  9907. {
  9908. A_UINT32 primary_chan_center_freq_mhz: 16,
  9909. contig_chan1_center_freq_mhz: 16;
  9910. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9911. phy_mode: 8,
  9912. reserved: 8;
  9913. } POSTPACK;
  9914. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9915. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9916. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9917. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9918. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9919. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9920. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9921. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9922. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9923. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9924. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9925. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9926. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9927. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9928. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9929. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9930. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9931. /* Channel information */
  9932. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9933. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9934. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9935. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9936. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9937. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9938. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9939. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9940. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9941. do { \
  9942. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9943. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9944. } while (0)
  9945. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9946. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9947. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9948. do { \
  9949. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9950. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9951. } while (0)
  9952. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9953. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9954. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9955. do { \
  9956. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9957. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9958. } while (0)
  9959. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9960. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9961. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9962. do { \
  9963. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9964. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9965. } while (0)
  9966. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9967. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9968. /*
  9969. * @brief target -> host message definition for FW offloaded pkts
  9970. *
  9971. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9972. *
  9973. * @details
  9974. * The following field definitions describe the format of the firmware
  9975. * offload deliver message sent from the target to the host.
  9976. *
  9977. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9978. *
  9979. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9980. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9981. * | reserved_1 | msg type |
  9982. * |--------------------------------------------------------------------------|
  9983. * | phy_timestamp_l32 |
  9984. * |--------------------------------------------------------------------------|
  9985. * | WORD2 (see below) |
  9986. * |--------------------------------------------------------------------------|
  9987. * | seqno | framectrl |
  9988. * |--------------------------------------------------------------------------|
  9989. * | reserved_3 | vdev_id | tid_num|
  9990. * |--------------------------------------------------------------------------|
  9991. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9992. * |--------------------------------------------------------------------------|
  9993. *
  9994. * where:
  9995. * STAT = status
  9996. * F = format (802.3 vs. 802.11)
  9997. *
  9998. * definition for word 2
  9999. *
  10000. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10001. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10002. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10003. * |--------------------------------------------------------------------------|
  10004. *
  10005. * where:
  10006. * PR = preamble
  10007. * BF = beamformed
  10008. */
  10009. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10010. {
  10011. A_UINT32 /* word 0 */
  10012. msg_type:8, /* [ 7: 0] */
  10013. reserved_1:24; /* [31: 8] */
  10014. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10015. A_UINT32 /* word 2 */
  10016. /* preamble:
  10017. * 0-OFDM,
  10018. * 1-CCk,
  10019. * 2-HT,
  10020. * 3-VHT
  10021. */
  10022. preamble: 2, /* [1:0] */
  10023. /* mcs:
  10024. * In case of HT preamble interpret
  10025. * MCS along with NSS.
  10026. * Valid values for HT are 0 to 7.
  10027. * HT mcs 0 with NSS 2 is mcs 8.
  10028. * Valid values for VHT are 0 to 9.
  10029. */
  10030. mcs: 4, /* [5:2] */
  10031. /* rate:
  10032. * This is applicable only for
  10033. * CCK and OFDM preamble type
  10034. * rate 0: OFDM 48 Mbps,
  10035. * 1: OFDM 24 Mbps,
  10036. * 2: OFDM 12 Mbps
  10037. * 3: OFDM 6 Mbps
  10038. * 4: OFDM 54 Mbps
  10039. * 5: OFDM 36 Mbps
  10040. * 6: OFDM 18 Mbps
  10041. * 7: OFDM 9 Mbps
  10042. * rate 0: CCK 11 Mbps Long
  10043. * 1: CCK 5.5 Mbps Long
  10044. * 2: CCK 2 Mbps Long
  10045. * 3: CCK 1 Mbps Long
  10046. * 4: CCK 11 Mbps Short
  10047. * 5: CCK 5.5 Mbps Short
  10048. * 6: CCK 2 Mbps Short
  10049. */
  10050. rate : 3, /* [ 8: 6] */
  10051. rssi : 8, /* [16: 9] units=dBm */
  10052. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10053. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10054. stbc : 1, /* [22] */
  10055. sgi : 1, /* [23] */
  10056. ldpc : 1, /* [24] */
  10057. beamformed: 1, /* [25] */
  10058. reserved_2: 6; /* [31:26] */
  10059. A_UINT32 /* word 3 */
  10060. framectrl:16, /* [15: 0] */
  10061. seqno:16; /* [31:16] */
  10062. A_UINT32 /* word 4 */
  10063. tid_num:5, /* [ 4: 0] actual TID number */
  10064. vdev_id:8, /* [12: 5] */
  10065. reserved_3:19; /* [31:13] */
  10066. A_UINT32 /* word 5 */
  10067. /* status:
  10068. * 0: tx_ok
  10069. * 1: retry
  10070. * 2: drop
  10071. * 3: filtered
  10072. * 4: abort
  10073. * 5: tid delete
  10074. * 6: sw abort
  10075. * 7: dropped by peer migration
  10076. */
  10077. status:3, /* [2:0] */
  10078. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10079. tx_mpdu_bytes:16, /* [19:4] */
  10080. /* Indicates retry count of offloaded/local generated Data tx frames */
  10081. tx_retry_cnt:6, /* [25:20] */
  10082. reserved_4:6; /* [31:26] */
  10083. } POSTPACK;
  10084. /* FW offload deliver ind message header fields */
  10085. /* DWORD one */
  10086. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10087. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10088. /* DWORD two */
  10089. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10090. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10091. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10092. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10093. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10094. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10095. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10096. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10097. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10098. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10099. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10100. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10101. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10102. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10103. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10104. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10105. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10106. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10107. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10108. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10109. /* DWORD three*/
  10110. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10111. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10112. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10113. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10114. /* DWORD four */
  10115. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10116. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10117. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10118. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10119. /* DWORD five */
  10120. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10121. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10122. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10123. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10124. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10125. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10126. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10127. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10128. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10129. do { \
  10130. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10131. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10132. } while (0)
  10133. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10134. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10135. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10136. do { \
  10137. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10138. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10139. } while (0)
  10140. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10141. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10142. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10143. do { \
  10144. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10145. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10146. } while (0)
  10147. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10148. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10149. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10150. do { \
  10151. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10152. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10153. } while (0)
  10154. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10155. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10156. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10157. do { \
  10158. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10159. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10160. } while (0)
  10161. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10162. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10163. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10164. do { \
  10165. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10166. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10167. } while (0)
  10168. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10169. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10170. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10171. do { \
  10172. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10173. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10174. } while (0)
  10175. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10176. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10177. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10178. do { \
  10179. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10180. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10181. } while (0)
  10182. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10183. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10184. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10185. do { \
  10186. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10187. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10188. } while (0)
  10189. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10190. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10191. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10192. do { \
  10193. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10194. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10195. } while (0)
  10196. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10197. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10198. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10199. do { \
  10200. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10201. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10202. } while (0)
  10203. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10204. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10205. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10206. do { \
  10207. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10208. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10209. } while (0)
  10210. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10211. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10212. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10213. do { \
  10214. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10215. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10216. } while (0)
  10217. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10218. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10219. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10220. do { \
  10221. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10222. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10223. } while (0)
  10224. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10225. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10226. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10227. do { \
  10228. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10229. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10230. } while (0)
  10231. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10232. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10233. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10234. do { \
  10235. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10236. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10237. } while (0)
  10238. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10239. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10240. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10241. do { \
  10242. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10243. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10244. } while (0)
  10245. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10246. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10247. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10248. do { \
  10249. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10250. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10251. } while (0)
  10252. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10253. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10254. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10255. do { \
  10256. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10257. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10258. } while (0)
  10259. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10260. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10261. /*
  10262. * @brief target -> host rx reorder flush message definition
  10263. *
  10264. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10265. *
  10266. * @details
  10267. * The following field definitions describe the format of the rx flush
  10268. * message sent from the target to the host.
  10269. * The message consists of a 4-octet header, followed by one or more
  10270. * 4-octet payload information elements.
  10271. *
  10272. * |31 24|23 8|7 0|
  10273. * |--------------------------------------------------------------|
  10274. * | TID | peer ID | msg type |
  10275. * |--------------------------------------------------------------|
  10276. * | seq num end | seq num start | MPDU status | reserved |
  10277. * |--------------------------------------------------------------|
  10278. * First DWORD:
  10279. * - MSG_TYPE
  10280. * Bits 7:0
  10281. * Purpose: identifies this as an rx flush message
  10282. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10283. * - PEER_ID
  10284. * Bits 23:8 (only bits 18:8 actually used)
  10285. * Purpose: identify which peer's rx data is being flushed
  10286. * Value: (rx) peer ID
  10287. * - TID
  10288. * Bits 31:24 (only bits 27:24 actually used)
  10289. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10290. * Value: traffic identifier
  10291. * Second DWORD:
  10292. * - MPDU_STATUS
  10293. * Bits 15:8
  10294. * Purpose:
  10295. * Indicate whether the flushed MPDUs should be discarded or processed.
  10296. * Value:
  10297. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10298. * stages of rx processing
  10299. * other: discard the MPDUs
  10300. * It is anticipated that flush messages will always have
  10301. * MPDU status == 1, but the status flag is included for
  10302. * flexibility.
  10303. * - SEQ_NUM_START
  10304. * Bits 23:16
  10305. * Purpose:
  10306. * Indicate the start of a series of consecutive MPDUs being flushed.
  10307. * Not all MPDUs within this range are necessarily valid - the host
  10308. * must check each sequence number within this range to see if the
  10309. * corresponding MPDU is actually present.
  10310. * Value:
  10311. * The sequence number for the first MPDU in the sequence.
  10312. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10313. * - SEQ_NUM_END
  10314. * Bits 30:24
  10315. * Purpose:
  10316. * Indicate the end of a series of consecutive MPDUs being flushed.
  10317. * Value:
  10318. * The sequence number one larger than the sequence number of the
  10319. * last MPDU being flushed.
  10320. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10321. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10322. * are to be released for further rx processing.
  10323. * Not all MPDUs within this range are necessarily valid - the host
  10324. * must check each sequence number within this range to see if the
  10325. * corresponding MPDU is actually present.
  10326. */
  10327. /* first DWORD */
  10328. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10329. #define HTT_RX_FLUSH_PEER_ID_S 8
  10330. #define HTT_RX_FLUSH_TID_M 0xff000000
  10331. #define HTT_RX_FLUSH_TID_S 24
  10332. /* second DWORD */
  10333. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10334. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10335. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10336. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10337. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10338. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10339. #define HTT_RX_FLUSH_BYTES 8
  10340. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10341. do { \
  10342. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10343. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10344. } while (0)
  10345. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10346. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10347. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10348. do { \
  10349. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10350. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10351. } while (0)
  10352. #define HTT_RX_FLUSH_TID_GET(word) \
  10353. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10354. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10355. do { \
  10356. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10357. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10358. } while (0)
  10359. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10360. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10361. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10362. do { \
  10363. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10364. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10365. } while (0)
  10366. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10367. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10368. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10369. do { \
  10370. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10371. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10372. } while (0)
  10373. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10374. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10375. /*
  10376. * @brief target -> host rx pn check indication message
  10377. *
  10378. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10379. *
  10380. * @details
  10381. * The following field definitions describe the format of the Rx PN check
  10382. * indication message sent from the target to the host.
  10383. * The message consists of a 4-octet header, followed by the start and
  10384. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10385. * IE is one octet containing the sequence number that failed the PN
  10386. * check.
  10387. *
  10388. * |31 24|23 8|7 0|
  10389. * |--------------------------------------------------------------|
  10390. * | TID | peer ID | msg type |
  10391. * |--------------------------------------------------------------|
  10392. * | Reserved | PN IE count | seq num end | seq num start|
  10393. * |--------------------------------------------------------------|
  10394. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10395. * |--------------------------------------------------------------|
  10396. * First DWORD:
  10397. * - MSG_TYPE
  10398. * Bits 7:0
  10399. * Purpose: Identifies this as an rx pn check indication message
  10400. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10401. * - PEER_ID
  10402. * Bits 23:8 (only bits 18:8 actually used)
  10403. * Purpose: identify which peer
  10404. * Value: (rx) peer ID
  10405. * - TID
  10406. * Bits 31:24 (only bits 27:24 actually used)
  10407. * Purpose: identify traffic identifier
  10408. * Value: traffic identifier
  10409. * Second DWORD:
  10410. * - SEQ_NUM_START
  10411. * Bits 7:0
  10412. * Purpose:
  10413. * Indicates the starting sequence number of the MPDU in this
  10414. * series of MPDUs that went though PN check.
  10415. * Value:
  10416. * The sequence number for the first MPDU in the sequence.
  10417. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10418. * - SEQ_NUM_END
  10419. * Bits 15:8
  10420. * Purpose:
  10421. * Indicates the ending sequence number of the MPDU in this
  10422. * series of MPDUs that went though PN check.
  10423. * Value:
  10424. * The sequence number one larger then the sequence number of the last
  10425. * MPDU being flushed.
  10426. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10427. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10428. * for invalid PN numbers and are ready to be released for further processing.
  10429. * Not all MPDUs within this range are necessarily valid - the host
  10430. * must check each sequence number within this range to see if the
  10431. * corresponding MPDU is actually present.
  10432. * - PN_IE_COUNT
  10433. * Bits 23:16
  10434. * Purpose:
  10435. * Used to determine the variable number of PN information elements in this
  10436. * message
  10437. *
  10438. * PN information elements:
  10439. * - PN_IE_x-
  10440. * Purpose:
  10441. * Each PN information element contains the sequence number of the MPDU that
  10442. * has failed the target PN check.
  10443. * Value:
  10444. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10445. * that failed the PN check.
  10446. */
  10447. /* first DWORD */
  10448. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10449. #define HTT_RX_PN_IND_PEER_ID_S 8
  10450. #define HTT_RX_PN_IND_TID_M 0xff000000
  10451. #define HTT_RX_PN_IND_TID_S 24
  10452. /* second DWORD */
  10453. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10454. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10455. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10456. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10457. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10458. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10459. #define HTT_RX_PN_IND_BYTES 8
  10460. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10461. do { \
  10462. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10463. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10464. } while (0)
  10465. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10466. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10467. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10468. do { \
  10469. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10470. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10471. } while (0)
  10472. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10473. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10474. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10475. do { \
  10476. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10477. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10478. } while (0)
  10479. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10480. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10481. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10482. do { \
  10483. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10484. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10485. } while (0)
  10486. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10487. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10488. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10489. do { \
  10490. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10491. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10492. } while (0)
  10493. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10494. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10495. /*
  10496. * @brief target -> host rx offload deliver message for LL system
  10497. *
  10498. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10499. *
  10500. * @details
  10501. * In a low latency system this message is sent whenever the offload
  10502. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10503. * The DMA of the actual packets into host memory is done before sending out
  10504. * this message. This message indicates only how many MSDUs to reap. The
  10505. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10506. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10507. * DMA'd by the MAC directly into host memory these packets do not contain
  10508. * the MAC descriptors in the header portion of the packet. Instead they contain
  10509. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10510. * message, the packets are delivered directly to the NW stack without going
  10511. * through the regular reorder buffering and PN checking path since it has
  10512. * already been done in target.
  10513. *
  10514. * |31 24|23 16|15 8|7 0|
  10515. * |-----------------------------------------------------------------------|
  10516. * | Total MSDU count | reserved | msg type |
  10517. * |-----------------------------------------------------------------------|
  10518. *
  10519. * @brief target -> host rx offload deliver message for HL system
  10520. *
  10521. * @details
  10522. * In a high latency system this message is sent whenever the offload manager
  10523. * flushes out the packets it has coalesced in its coalescing buffer. The
  10524. * actual packets are also carried along with this message. When the host
  10525. * receives this message, it is expected to deliver these packets to the NW
  10526. * stack directly instead of routing them through the reorder buffering and
  10527. * PN checking path since it has already been done in target.
  10528. *
  10529. * |31 24|23 16|15 8|7 0|
  10530. * |-----------------------------------------------------------------------|
  10531. * | Total MSDU count | reserved | msg type |
  10532. * |-----------------------------------------------------------------------|
  10533. * | peer ID | MSDU length |
  10534. * |-----------------------------------------------------------------------|
  10535. * | MSDU payload | FW Desc | tid | vdev ID |
  10536. * |-----------------------------------------------------------------------|
  10537. * | MSDU payload contd. |
  10538. * |-----------------------------------------------------------------------|
  10539. * | peer ID | MSDU length |
  10540. * |-----------------------------------------------------------------------|
  10541. * | MSDU payload | FW Desc | tid | vdev ID |
  10542. * |-----------------------------------------------------------------------|
  10543. * | MSDU payload contd. |
  10544. * |-----------------------------------------------------------------------|
  10545. *
  10546. */
  10547. /* first DWORD */
  10548. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10549. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10550. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10551. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10552. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10553. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10558. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10559. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10560. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10561. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10563. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10565. do { \
  10566. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10567. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10568. } while (0)
  10569. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10570. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10571. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10572. do { \
  10573. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10574. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10575. } while (0)
  10576. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10577. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10578. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10579. do { \
  10580. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10581. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10582. } while (0)
  10583. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10584. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10585. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10588. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10589. } while (0)
  10590. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10591. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10592. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10595. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10596. } while (0)
  10597. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10598. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10599. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10600. do { \
  10601. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10602. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10603. } while (0)
  10604. /**
  10605. * @brief target -> host rx peer map/unmap message definition
  10606. *
  10607. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10608. *
  10609. * @details
  10610. * The following diagram shows the format of the rx peer map message sent
  10611. * from the target to the host. This layout assumes the target operates
  10612. * as little-endian.
  10613. *
  10614. * This message always contains a SW peer ID. The main purpose of the
  10615. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10616. * with, so that the host can use that peer ID to determine which peer
  10617. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10618. * other purposes, such as identifying during tx completions which peer
  10619. * the tx frames in question were transmitted to.
  10620. *
  10621. * In certain generations of chips, the peer map message also contains
  10622. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10623. * to identify which peer the frame needs to be forwarded to (i.e. the
  10624. * peer assocated with the Destination MAC Address within the packet),
  10625. * and particularly which vdev needs to transmit the frame (for cases
  10626. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10627. * meaning as AST_INDEX_0.
  10628. * This DA-based peer ID that is provided for certain rx frames
  10629. * (the rx frames that need to be re-transmitted as tx frames)
  10630. * is the ID that the HW uses for referring to the peer in question,
  10631. * rather than the peer ID that the SW+FW use to refer to the peer.
  10632. *
  10633. *
  10634. * |31 24|23 16|15 8|7 0|
  10635. * |-----------------------------------------------------------------------|
  10636. * | SW peer ID | VDEV ID | msg type |
  10637. * |-----------------------------------------------------------------------|
  10638. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10639. * |-----------------------------------------------------------------------|
  10640. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10641. * |-----------------------------------------------------------------------|
  10642. *
  10643. *
  10644. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10645. *
  10646. * The following diagram shows the format of the rx peer unmap message sent
  10647. * from the target to the host.
  10648. *
  10649. * |31 24|23 16|15 8|7 0|
  10650. * |-----------------------------------------------------------------------|
  10651. * | SW peer ID | VDEV ID | msg type |
  10652. * |-----------------------------------------------------------------------|
  10653. *
  10654. * The following field definitions describe the format of the rx peer map
  10655. * and peer unmap messages sent from the target to the host.
  10656. * - MSG_TYPE
  10657. * Bits 7:0
  10658. * Purpose: identifies this as an rx peer map or peer unmap message
  10659. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10660. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10661. * - VDEV_ID
  10662. * Bits 15:8
  10663. * Purpose: Indicates which virtual device the peer is associated
  10664. * with.
  10665. * Value: vdev ID (used in the host to look up the vdev object)
  10666. * - PEER_ID (a.k.a. SW_PEER_ID)
  10667. * Bits 31:16
  10668. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10669. * freeing (unmap)
  10670. * Value: (rx) peer ID
  10671. * - MAC_ADDR_L32 (peer map only)
  10672. * Bits 31:0
  10673. * Purpose: Identifies which peer node the peer ID is for.
  10674. * Value: lower 4 bytes of peer node's MAC address
  10675. * - MAC_ADDR_U16 (peer map only)
  10676. * Bits 15:0
  10677. * Purpose: Identifies which peer node the peer ID is for.
  10678. * Value: upper 2 bytes of peer node's MAC address
  10679. * - HW_PEER_ID
  10680. * Bits 31:16
  10681. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10682. * address, so for rx frames marked for rx --> tx forwarding, the
  10683. * host can determine from the HW peer ID provided as meta-data with
  10684. * the rx frame which peer the frame is supposed to be forwarded to.
  10685. * Value: ID used by the MAC HW to identify the peer
  10686. */
  10687. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10688. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10689. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10690. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10691. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10692. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10693. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10694. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10695. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10696. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10697. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10698. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10699. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10700. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10701. do { \
  10702. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10703. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10704. } while (0)
  10705. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10706. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10707. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10708. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10709. do { \
  10710. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10711. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10712. } while (0)
  10713. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10714. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10715. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10716. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10717. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10718. do { \
  10719. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10720. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10721. } while (0)
  10722. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10723. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10724. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10725. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10726. #define HTT_RX_PEER_MAP_BYTES 12
  10727. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10728. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10729. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10730. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10731. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10732. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10733. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10734. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10735. #define HTT_RX_PEER_UNMAP_BYTES 4
  10736. /**
  10737. * @brief target -> host rx peer map V2 message definition
  10738. *
  10739. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10740. *
  10741. * @details
  10742. * The following diagram shows the format of the rx peer map v2 message sent
  10743. * from the target to the host. This layout assumes the target operates
  10744. * as little-endian.
  10745. *
  10746. * This message always contains a SW peer ID. The main purpose of the
  10747. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10748. * with, so that the host can use that peer ID to determine which peer
  10749. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10750. * other purposes, such as identifying during tx completions which peer
  10751. * the tx frames in question were transmitted to.
  10752. *
  10753. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10754. * is used during rx --> tx frame forwarding to identify which peer the
  10755. * frame needs to be forwarded to (i.e. the peer assocated with the
  10756. * Destination MAC Address within the packet), and particularly which vdev
  10757. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10758. * This DA-based peer ID that is provided for certain rx frames
  10759. * (the rx frames that need to be re-transmitted as tx frames)
  10760. * is the ID that the HW uses for referring to the peer in question,
  10761. * rather than the peer ID that the SW+FW use to refer to the peer.
  10762. *
  10763. * The HW peer id here is the same meaning as AST_INDEX_0.
  10764. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10765. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10766. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10767. * AST is valid.
  10768. *
  10769. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10770. * |-------------------------------------------------------------------------|
  10771. * | SW peer ID | VDEV ID | msg type |
  10772. * |-------------------------------------------------------------------------|
  10773. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10774. * |-------------------------------------------------------------------------|
  10775. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10776. * |-------------------------------------------------------------------------|
  10777. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10778. * |-------------------------------------------------------------------------|
  10779. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10780. * |-------------------------------------------------------------------------|
  10781. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10782. * |-------------------------------------------------------------------------|
  10783. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10784. * |-------------------------------------------------------------------------|
  10785. * | Reserved_2 |
  10786. * |-------------------------------------------------------------------------|
  10787. * Where:
  10788. * NH = Next Hop
  10789. * ASTVM = AST valid mask
  10790. * OA = on-chip AST valid bit
  10791. * ASTFM = AST flow mask
  10792. *
  10793. * The following field definitions describe the format of the rx peer map v2
  10794. * messages sent from the target to the host.
  10795. * - MSG_TYPE
  10796. * Bits 7:0
  10797. * Purpose: identifies this as an rx peer map v2 message
  10798. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10799. * - VDEV_ID
  10800. * Bits 15:8
  10801. * Purpose: Indicates which virtual device the peer is associated with.
  10802. * Value: vdev ID (used in the host to look up the vdev object)
  10803. * - SW_PEER_ID
  10804. * Bits 31:16
  10805. * Purpose: The peer ID (index) that WAL is allocating
  10806. * Value: (rx) peer ID
  10807. * - MAC_ADDR_L32
  10808. * Bits 31:0
  10809. * Purpose: Identifies which peer node the peer ID is for.
  10810. * Value: lower 4 bytes of peer node's MAC address
  10811. * - MAC_ADDR_U16
  10812. * Bits 15:0
  10813. * Purpose: Identifies which peer node the peer ID is for.
  10814. * Value: upper 2 bytes of peer node's MAC address
  10815. * - HW_PEER_ID / AST_INDEX_0
  10816. * Bits 31:16
  10817. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10818. * address, so for rx frames marked for rx --> tx forwarding, the
  10819. * host can determine from the HW peer ID provided as meta-data with
  10820. * the rx frame which peer the frame is supposed to be forwarded to.
  10821. * Value: ID used by the MAC HW to identify the peer
  10822. * - AST_HASH_VALUE
  10823. * Bits 15:0
  10824. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10825. * override feature.
  10826. * - NEXT_HOP
  10827. * Bit 16
  10828. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10829. * (Wireless Distribution System).
  10830. * - AST_VALID_MASK
  10831. * Bits 19:17
  10832. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10833. * - ONCHIP_AST_VALID_FLAG
  10834. * Bit 20
  10835. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10836. * is valid.
  10837. * - AST_INDEX_1
  10838. * Bits 15:0
  10839. * Purpose: indicate the second AST index for this peer
  10840. * - AST_0_FLOW_MASK
  10841. * Bits 19:16
  10842. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10843. * - AST_1_FLOW_MASK
  10844. * Bits 23:20
  10845. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10846. * - AST_2_FLOW_MASK
  10847. * Bits 27:24
  10848. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10849. * - AST_3_FLOW_MASK
  10850. * Bits 31:28
  10851. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10852. * - AST_INDEX_2
  10853. * Bits 15:0
  10854. * Purpose: indicate the third AST index for this peer
  10855. * - TID_VALID_HI_PRI
  10856. * Bits 23:16
  10857. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10858. * - TID_VALID_LOW_PRI
  10859. * Bits 31:24
  10860. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10861. * - AST_INDEX_3
  10862. * Bits 15:0
  10863. * Purpose: indicate the fourth AST index for this peer
  10864. * - ONCHIP_AST_IDX / RESERVED
  10865. * Bits 31:16
  10866. * Purpose: This field is valid only when split AST feature is enabled.
  10867. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10868. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10869. * address, this ast_idx is used for LMAC modules for RXPCU.
  10870. * Value: ID used by the LMAC HW to identify the peer
  10871. */
  10872. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10873. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10874. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10875. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10876. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10877. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10878. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10879. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10880. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10881. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10882. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10883. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10884. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10885. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10886. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10887. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10888. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10889. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10890. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10891. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10892. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10893. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10894. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10895. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10896. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10897. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10898. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10899. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10900. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10901. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10902. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10903. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10904. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10905. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10906. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10907. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10908. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10909. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10910. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10911. do { \
  10912. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10913. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10914. } while (0)
  10915. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10916. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10917. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10918. do { \
  10919. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10920. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10921. } while (0)
  10922. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10923. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10924. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10925. do { \
  10926. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10927. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10928. } while (0)
  10929. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10930. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10931. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10932. do { \
  10933. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10934. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10935. } while (0)
  10936. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10937. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10938. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10939. do { \
  10940. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10941. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10942. } while (0)
  10943. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10944. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10945. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10946. do { \
  10947. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10948. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10949. } while (0)
  10950. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10951. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10952. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10953. do { \
  10954. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10955. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10956. } while (0)
  10957. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10958. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10959. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10960. do { \
  10961. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10962. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10963. } while (0)
  10964. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10965. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10966. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10967. do { \
  10968. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10969. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10970. } while (0)
  10971. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10972. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10973. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10974. do { \
  10975. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10976. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10977. } while (0)
  10978. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10979. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10980. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10981. do { \
  10982. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10983. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10984. } while (0)
  10985. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10986. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10987. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10988. do { \
  10989. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10990. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10991. } while (0)
  10992. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10993. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10994. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10995. do { \
  10996. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10997. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10998. } while (0)
  10999. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11000. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11001. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11002. do { \
  11003. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11004. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11005. } while (0)
  11006. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11007. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11008. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11009. do { \
  11010. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11011. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11012. } while (0)
  11013. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11014. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11015. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11016. do { \
  11017. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11018. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11019. } while (0)
  11020. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11021. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11022. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11023. do { \
  11024. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11025. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11026. } while (0)
  11027. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11028. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11029. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11030. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11031. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11032. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11033. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11034. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11035. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11036. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11037. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11038. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11039. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11040. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11041. /**
  11042. * @brief target -> host rx peer map V3 message definition
  11043. *
  11044. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11045. *
  11046. * @details
  11047. * The following diagram shows the format of the rx peer map v3 message sent
  11048. * from the target to the host.
  11049. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11050. * This layout assumes the target operates as little-endian.
  11051. *
  11052. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11053. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11054. * | SW peer ID | VDEV ID | msg type |
  11055. * |-----------------+--------------------+-----------------+-----------------|
  11056. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11057. * |-----------------+--------------------+-----------------+-----------------|
  11058. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11059. * |-----------------+--------+-----------+-----------------+-----------------|
  11060. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11061. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11062. * | (8bits) | | (4bits) | |
  11063. * |-----------------+--------+--+--+--+--------------------------------------|
  11064. * | RESERVED |E |O | | |
  11065. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11066. * | |V |V | | |
  11067. * |-----------------+--------------------+-----------------------------------|
  11068. * | HTT_MSDU_IDX_ | RESERVED | |
  11069. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11070. * | (8bits) | | |
  11071. * |-----------------+--------------------+-----------------------------------|
  11072. * | Reserved_2 |
  11073. * |--------------------------------------------------------------------------|
  11074. * | Reserved_3 |
  11075. * |--------------------------------------------------------------------------|
  11076. *
  11077. * Where:
  11078. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11079. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11080. * NH = Next Hop
  11081. * The following field definitions describe the format of the rx peer map v3
  11082. * messages sent from the target to the host.
  11083. * - MSG_TYPE
  11084. * Bits 7:0
  11085. * Purpose: identifies this as a peer map v3 message
  11086. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11087. * - VDEV_ID
  11088. * Bits 15:8
  11089. * Purpose: Indicates which virtual device the peer is associated with.
  11090. * - SW_PEER_ID
  11091. * Bits 31:16
  11092. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11093. * - MAC_ADDR_L32
  11094. * Bits 31:0
  11095. * Purpose: Identifies which peer node the peer ID is for.
  11096. * Value: lower 4 bytes of peer node's MAC address
  11097. * - MAC_ADDR_U16
  11098. * Bits 15:0
  11099. * Purpose: Identifies which peer node the peer ID is for.
  11100. * Value: upper 2 bytes of peer node's MAC address
  11101. * - MULTICAST_SW_PEER_ID
  11102. * Bits 31:16
  11103. * Purpose: The multicast peer ID (index)
  11104. * Value: set to HTT_INVALID_PEER if not valid
  11105. * - HW_PEER_ID / AST_INDEX
  11106. * Bits 15:0
  11107. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11108. * address, so for rx frames marked for rx --> tx forwarding, the
  11109. * host can determine from the HW peer ID provided as meta-data with
  11110. * the rx frame which peer the frame is supposed to be forwarded to.
  11111. * - CACHE_SET_NUM
  11112. * Bits 19:16
  11113. * Purpose: Cache Set Number for AST_INDEX
  11114. * Cache set number that should be used to cache the index based
  11115. * search results, for address and flow search.
  11116. * This value should be equal to LSB 4 bits of the hash value
  11117. * of match data, in case of search index points to an entry which
  11118. * may be used in content based search also. The value can be
  11119. * anything when the entry pointed by search index will not be
  11120. * used for content based search.
  11121. * - HTT_MSDU_IDX_VALID_MASK
  11122. * Bits 31:24
  11123. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11124. * - ONCHIP_AST_IDX / RESERVED
  11125. * Bits 15:0
  11126. * Purpose: This field is valid only when split AST feature is enabled.
  11127. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11128. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11129. * address, this ast_idx is used for LMAC modules for RXPCU.
  11130. * - NEXT_HOP
  11131. * Bits 16
  11132. * Purpose: Flag indicates next_hop AST entry used for WDS
  11133. * (Wireless Distribution System).
  11134. * - ONCHIP_AST_VALID
  11135. * Bits 17
  11136. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11137. * - EXT_AST_VALID
  11138. * Bits 18
  11139. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11140. * - EXT_AST_INDEX
  11141. * Bits 15:0
  11142. * Purpose: This field describes Extended AST index
  11143. * Valid if EXT_AST_VALID flag set
  11144. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11145. * Bits 31:24
  11146. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11147. */
  11148. /* dword 0 */
  11149. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11150. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11151. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11152. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11153. /* dword 1 */
  11154. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11155. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11156. /* dword 2 */
  11157. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11158. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11159. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11160. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11161. /* dword 3 */
  11162. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11163. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11164. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11165. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11166. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11167. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11168. /* dword 4 */
  11169. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11170. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11171. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11172. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11173. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11174. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11175. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11176. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11177. /* dword 5 */
  11178. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11179. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11180. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11181. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11182. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11183. do { \
  11184. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11185. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11186. } while (0)
  11187. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11188. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11189. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11190. do { \
  11191. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11192. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11193. } while (0)
  11194. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11195. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11196. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11199. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11200. } while (0)
  11201. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11202. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11203. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11204. do { \
  11205. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11206. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11207. } while (0)
  11208. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11209. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11210. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11211. do { \
  11212. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11213. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11214. } while (0)
  11215. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11216. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11217. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11218. do { \
  11219. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11220. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11221. } while (0)
  11222. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11223. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11224. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11225. do { \
  11226. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11227. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11228. } while (0)
  11229. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11230. (((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)
  11231. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11232. do { \
  11233. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11234. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11235. } while (0)
  11236. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11237. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11238. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11239. do { \
  11240. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11241. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11242. } while (0)
  11243. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11244. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11245. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11246. do { \
  11247. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11248. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11249. } while (0)
  11250. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11251. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11252. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11253. do { \
  11254. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11255. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11256. } while (0)
  11257. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11258. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11259. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11260. do { \
  11261. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11262. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11263. } while (0)
  11264. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11265. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11266. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11267. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11268. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11269. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11270. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11271. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11272. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11273. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11274. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11278. /**
  11279. * @brief target -> host rx peer unmap V2 message definition
  11280. *
  11281. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11282. *
  11283. * The following diagram shows the format of the rx peer unmap message sent
  11284. * from the target to the host.
  11285. *
  11286. * |31 24|23 16|15 8|7 0|
  11287. * |-----------------------------------------------------------------------|
  11288. * | SW peer ID | VDEV ID | msg type |
  11289. * |-----------------------------------------------------------------------|
  11290. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11291. * |-----------------------------------------------------------------------|
  11292. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11293. * |-----------------------------------------------------------------------|
  11294. * | Peer Delete Duration |
  11295. * |-----------------------------------------------------------------------|
  11296. * | Reserved_0 | WDS Free Count |
  11297. * |-----------------------------------------------------------------------|
  11298. * | Reserved_1 |
  11299. * |-----------------------------------------------------------------------|
  11300. * | Reserved_2 |
  11301. * |-----------------------------------------------------------------------|
  11302. *
  11303. *
  11304. * The following field definitions describe the format of the rx peer unmap
  11305. * messages sent from the target to the host.
  11306. * - MSG_TYPE
  11307. * Bits 7:0
  11308. * Purpose: identifies this as an rx peer unmap v2 message
  11309. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11310. * - VDEV_ID
  11311. * Bits 15:8
  11312. * Purpose: Indicates which virtual device the peer is associated
  11313. * with.
  11314. * Value: vdev ID (used in the host to look up the vdev object)
  11315. * - SW_PEER_ID
  11316. * Bits 31:16
  11317. * Purpose: The peer ID (index) that WAL is freeing
  11318. * Value: (rx) peer ID
  11319. * - MAC_ADDR_L32
  11320. * Bits 31:0
  11321. * Purpose: Identifies which peer node the peer ID is for.
  11322. * Value: lower 4 bytes of peer node's MAC address
  11323. * - MAC_ADDR_U16
  11324. * Bits 15:0
  11325. * Purpose: Identifies which peer node the peer ID is for.
  11326. * Value: upper 2 bytes of peer node's MAC address
  11327. * - NEXT_HOP
  11328. * Bits 16
  11329. * Purpose: Bit indicates next_hop AST entry used for WDS
  11330. * (Wireless Distribution System).
  11331. * - PEER_DELETE_DURATION
  11332. * Bits 31:0
  11333. * Purpose: Time taken to delete peer, in msec,
  11334. * Used for monitoring / debugging PEER delete response delay
  11335. * - PEER_WDS_FREE_COUNT
  11336. * Bits 15:0
  11337. * Purpose: Count of WDS entries deleted associated to peer deleted
  11338. */
  11339. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11340. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11341. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11342. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11343. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11344. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11345. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11346. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11347. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11348. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11349. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11350. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11351. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11352. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11353. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11354. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11355. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11356. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11357. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11358. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11359. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11360. do { \
  11361. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11362. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11363. } while (0)
  11364. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11365. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11366. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11367. do { \
  11368. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11369. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11370. } while (0)
  11371. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11372. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11373. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11374. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11375. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11376. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11377. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11378. /**
  11379. * @brief target -> host rx peer mlo map message definition
  11380. *
  11381. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11382. *
  11383. * @details
  11384. * The following diagram shows the format of the rx mlo peer map message sent
  11385. * from the target to the host. This layout assumes the target operates
  11386. * as little-endian.
  11387. *
  11388. * MCC:
  11389. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11390. *
  11391. * WIN:
  11392. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11393. * It will be sent on the Assoc Link.
  11394. *
  11395. * This message always contains a MLO peer ID. The main purpose of the
  11396. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11397. * with, so that the host can use that MLO peer ID to determine which peer
  11398. * transmitted the rx frame.
  11399. *
  11400. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11401. * |-------------------------------------------------------------------------|
  11402. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11403. * |-------------------------------------------------------------------------|
  11404. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11405. * |-------------------------------------------------------------------------|
  11406. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11407. * |-------------------------------------------------------------------------|
  11408. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11409. * |-------------------------------------------------------------------------|
  11410. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11411. * |-------------------------------------------------------------------------|
  11412. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11413. * |-------------------------------------------------------------------------|
  11414. * |RSVD |
  11415. * |-------------------------------------------------------------------------|
  11416. * |RSVD |
  11417. * |-------------------------------------------------------------------------|
  11418. * | htt_tlv_hdr_t |
  11419. * |-------------------------------------------------------------------------|
  11420. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11421. * |-------------------------------------------------------------------------|
  11422. * | htt_tlv_hdr_t |
  11423. * |-------------------------------------------------------------------------|
  11424. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11425. * |-------------------------------------------------------------------------|
  11426. * | htt_tlv_hdr_t |
  11427. * |-------------------------------------------------------------------------|
  11428. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11429. * |-------------------------------------------------------------------------|
  11430. *
  11431. * Where:
  11432. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11433. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11434. * V (valid) - 1 Bit Bit17
  11435. * CHIPID - 3 Bits
  11436. * TIDMASK - 8 Bits
  11437. * CACHE_SET_NUM - 8 Bits
  11438. *
  11439. * The following field definitions describe the format of the rx MLO peer map
  11440. * messages sent from the target to the host.
  11441. * - MSG_TYPE
  11442. * Bits 7:0
  11443. * Purpose: identifies this as an rx mlo peer map message
  11444. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11445. *
  11446. * - MLO_PEER_ID
  11447. * Bits 23:8
  11448. * Purpose: The MLO peer ID (index).
  11449. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11450. * Value: MLO peer ID
  11451. *
  11452. * - NUMLINK
  11453. * Bits: 26:24 (3Bits)
  11454. * Purpose: Indicate the max number of logical links supported per client.
  11455. * Value: number of logical links
  11456. *
  11457. * - PRC
  11458. * Bits: 29:27 (3Bits)
  11459. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11460. * if there is migration of the primary chip.
  11461. * Value: Primary REO CHIPID
  11462. *
  11463. * - MAC_ADDR_L32
  11464. * Bits 31:0
  11465. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11466. * Value: lower 4 bytes of peer node's MAC address
  11467. *
  11468. * - MAC_ADDR_U16
  11469. * Bits 15:0
  11470. * Purpose: Identifies which peer node the peer ID is for.
  11471. * Value: upper 2 bytes of peer node's MAC address
  11472. *
  11473. * - PRIMARY_TCL_AST_IDX
  11474. * Bits 15:0
  11475. * Purpose: Primary TCL AST index for this peer.
  11476. *
  11477. * - V
  11478. * 1 Bit Position 16
  11479. * Purpose: If the ast idx is valid.
  11480. *
  11481. * - CHIPID
  11482. * Bits 19:17
  11483. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11484. *
  11485. * - TIDMASK
  11486. * Bits 27:20
  11487. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11488. *
  11489. * - CACHE_SET_NUM
  11490. * Bits 31:28
  11491. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11492. * Cache set number that should be used to cache the index based
  11493. * search results, for address and flow search.
  11494. * This value should be equal to LSB four bits of the hash value
  11495. * of match data, in case of search index points to an entry which
  11496. * may be used in content based search also. The value can be
  11497. * anything when the entry pointed by search index will not be
  11498. * used for content based search.
  11499. *
  11500. * - htt_tlv_hdr_t
  11501. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11502. *
  11503. * Bits 11:0
  11504. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11505. *
  11506. * Bits 23:12
  11507. * Purpose: Length, Length of the value that follows the header
  11508. *
  11509. * Bits 31:28
  11510. * Purpose: Reserved.
  11511. *
  11512. *
  11513. * - SW_PEER_ID
  11514. * Bits 15:0
  11515. * Purpose: The peer ID (index) that WAL is allocating
  11516. * Value: (rx) peer ID
  11517. *
  11518. * - VDEV_ID
  11519. * Bits 23:16
  11520. * Purpose: Indicates which virtual device the peer is associated with.
  11521. * Value: vdev ID (used in the host to look up the vdev object)
  11522. *
  11523. * - CHIPID
  11524. * Bits 26:24
  11525. * Purpose: Indicates which Chip id the peer is associated with.
  11526. * Value: chip ID (Provided by Host as part of QMI exchange)
  11527. */
  11528. typedef enum {
  11529. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11530. } MLO_PEER_MAP_TLV_TAG_ID;
  11531. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11532. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11533. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11534. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11535. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11536. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11537. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11538. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11539. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11540. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11541. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11542. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11543. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11544. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11545. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11546. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11547. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11548. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11549. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11550. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11551. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11552. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11553. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11554. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11555. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11556. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11557. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11558. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11559. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11560. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11561. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11562. do { \
  11563. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11564. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11565. } while (0)
  11566. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11567. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11568. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11569. do { \
  11570. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11571. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11572. } while (0)
  11573. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11574. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11575. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11576. do { \
  11577. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11578. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11579. } while (0)
  11580. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11581. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11582. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11583. do { \
  11584. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11585. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11586. } while (0)
  11587. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11588. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11589. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11590. do { \
  11591. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11592. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11593. } while (0)
  11594. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11595. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11596. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11597. do { \
  11598. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11599. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11600. } while (0)
  11601. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11602. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11603. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11604. do { \
  11605. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11606. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11607. } while (0)
  11608. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11609. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11610. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11611. do { \
  11612. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11613. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11614. } while (0)
  11615. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11616. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11617. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11618. do { \
  11619. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11620. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11621. } while (0)
  11622. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11623. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11624. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11625. do { \
  11626. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11627. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11628. } while (0)
  11629. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11630. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11631. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11632. do { \
  11633. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11634. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11635. } while (0)
  11636. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11637. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11638. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11639. do { \
  11640. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11641. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11642. } while (0)
  11643. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11644. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11645. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11646. do { \
  11647. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11648. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11649. } while (0)
  11650. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11651. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11652. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11653. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11654. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11655. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11656. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11657. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11658. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11659. *
  11660. * The following diagram shows the format of the rx mlo peer unmap message sent
  11661. * from the target to the host.
  11662. *
  11663. * |31 24|23 16|15 8|7 0|
  11664. * |-----------------------------------------------------------------------|
  11665. * | RSVD_24_31 | MLO peer ID | msg type |
  11666. * |-----------------------------------------------------------------------|
  11667. */
  11668. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11669. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11670. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11671. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11672. /**
  11673. * @brief target -> host message specifying security parameters
  11674. *
  11675. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11676. *
  11677. * @details
  11678. * The following diagram shows the format of the security specification
  11679. * message sent from the target to the host.
  11680. * This security specification message tells the host whether a PN check is
  11681. * necessary on rx data frames, and if so, how large the PN counter is.
  11682. * This message also tells the host about the security processing to apply
  11683. * to defragmented rx frames - specifically, whether a Message Integrity
  11684. * Check is required, and the Michael key to use.
  11685. *
  11686. * |31 24|23 16|15|14 8|7 0|
  11687. * |-----------------------------------------------------------------------|
  11688. * | peer ID | U| security type | msg type |
  11689. * |-----------------------------------------------------------------------|
  11690. * | Michael Key K0 |
  11691. * |-----------------------------------------------------------------------|
  11692. * | Michael Key K1 |
  11693. * |-----------------------------------------------------------------------|
  11694. * | WAPI RSC Low0 |
  11695. * |-----------------------------------------------------------------------|
  11696. * | WAPI RSC Low1 |
  11697. * |-----------------------------------------------------------------------|
  11698. * | WAPI RSC Hi0 |
  11699. * |-----------------------------------------------------------------------|
  11700. * | WAPI RSC Hi1 |
  11701. * |-----------------------------------------------------------------------|
  11702. *
  11703. * The following field definitions describe the format of the security
  11704. * indication message sent from the target to the host.
  11705. * - MSG_TYPE
  11706. * Bits 7:0
  11707. * Purpose: identifies this as a security specification message
  11708. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11709. * - SEC_TYPE
  11710. * Bits 14:8
  11711. * Purpose: specifies which type of security applies to the peer
  11712. * Value: htt_sec_type enum value
  11713. * - UNICAST
  11714. * Bit 15
  11715. * Purpose: whether this security is applied to unicast or multicast data
  11716. * Value: 1 -> unicast, 0 -> multicast
  11717. * - PEER_ID
  11718. * Bits 31:16
  11719. * Purpose: The ID number for the peer the security specification is for
  11720. * Value: peer ID
  11721. * - MICHAEL_KEY_K0
  11722. * Bits 31:0
  11723. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11724. * Value: Michael Key K0 (if security type is TKIP)
  11725. * - MICHAEL_KEY_K1
  11726. * Bits 31:0
  11727. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11728. * Value: Michael Key K1 (if security type is TKIP)
  11729. * - WAPI_RSC_LOW0
  11730. * Bits 31:0
  11731. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11732. * Value: WAPI RSC Low0 (if security type is WAPI)
  11733. * - WAPI_RSC_LOW1
  11734. * Bits 31:0
  11735. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11736. * Value: WAPI RSC Low1 (if security type is WAPI)
  11737. * - WAPI_RSC_HI0
  11738. * Bits 31:0
  11739. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11740. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11741. * - WAPI_RSC_HI1
  11742. * Bits 31:0
  11743. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11744. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11745. */
  11746. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11747. #define HTT_SEC_IND_SEC_TYPE_S 8
  11748. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11749. #define HTT_SEC_IND_UNICAST_S 15
  11750. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11751. #define HTT_SEC_IND_PEER_ID_S 16
  11752. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11753. do { \
  11754. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11755. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11756. } while (0)
  11757. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11758. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11759. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11760. do { \
  11761. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11762. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11763. } while (0)
  11764. #define HTT_SEC_IND_UNICAST_GET(word) \
  11765. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11766. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11767. do { \
  11768. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11769. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11770. } while (0)
  11771. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11772. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11773. #define HTT_SEC_IND_BYTES 28
  11774. /**
  11775. * @brief target -> host rx ADDBA / DELBA message definitions
  11776. *
  11777. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11778. *
  11779. * @details
  11780. * The following diagram shows the format of the rx ADDBA message sent
  11781. * from the target to the host:
  11782. *
  11783. * |31 20|19 16|15 8|7 0|
  11784. * |---------------------------------------------------------------------|
  11785. * | peer ID | TID | window size | msg type |
  11786. * |---------------------------------------------------------------------|
  11787. *
  11788. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11789. *
  11790. * The following diagram shows the format of the rx DELBA message sent
  11791. * from the target to the host:
  11792. *
  11793. * |31 20|19 16|15 10|9 8|7 0|
  11794. * |---------------------------------------------------------------------|
  11795. * | peer ID | TID | window size | IR| msg type |
  11796. * |---------------------------------------------------------------------|
  11797. *
  11798. * The following field definitions describe the format of the rx ADDBA
  11799. * and DELBA messages sent from the target to the host.
  11800. * - MSG_TYPE
  11801. * Bits 7:0
  11802. * Purpose: identifies this as an rx ADDBA or DELBA message
  11803. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11804. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11805. * - IR (initiator / recipient)
  11806. * Bits 9:8 (DELBA only)
  11807. * Purpose: specify whether the DELBA handshake was initiated by the
  11808. * local STA/AP, or by the peer STA/AP
  11809. * Value:
  11810. * 0 - unspecified
  11811. * 1 - initiator (a.k.a. originator)
  11812. * 2 - recipient (a.k.a. responder)
  11813. * 3 - unused / reserved
  11814. * - WIN_SIZE
  11815. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11816. * Purpose: Specifies the length of the block ack window (max = 64).
  11817. * Value:
  11818. * block ack window length specified by the received ADDBA/DELBA
  11819. * management message.
  11820. * - TID
  11821. * Bits 19:16
  11822. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11823. * Value:
  11824. * TID specified by the received ADDBA or DELBA management message.
  11825. * - PEER_ID
  11826. * Bits 31:20
  11827. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11828. * Value:
  11829. * ID (hash value) used by the host for fast, direct lookup of
  11830. * host SW peer info, including rx reorder states.
  11831. */
  11832. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11833. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11834. #define HTT_RX_ADDBA_TID_M 0xf0000
  11835. #define HTT_RX_ADDBA_TID_S 16
  11836. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11837. #define HTT_RX_ADDBA_PEER_ID_S 20
  11838. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11839. do { \
  11840. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11841. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11842. } while (0)
  11843. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11844. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11845. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11846. do { \
  11847. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11848. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11849. } while (0)
  11850. #define HTT_RX_ADDBA_TID_GET(word) \
  11851. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11852. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11853. do { \
  11854. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11855. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11856. } while (0)
  11857. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11858. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11859. #define HTT_RX_ADDBA_BYTES 4
  11860. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11861. #define HTT_RX_DELBA_INITIATOR_S 8
  11862. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11863. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11864. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11865. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11866. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11867. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11868. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11869. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11870. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11871. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11872. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11873. do { \
  11874. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11875. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11876. } while (0)
  11877. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11878. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11879. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11880. do { \
  11881. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11882. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11883. } while (0)
  11884. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11885. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11886. #define HTT_RX_DELBA_BYTES 4
  11887. /**
  11888. * @brief tx queue group information element definition
  11889. *
  11890. * @details
  11891. * The following diagram shows the format of the tx queue group
  11892. * information element, which can be included in target --> host
  11893. * messages to specify the number of tx "credits" (tx descriptors
  11894. * for LL, or tx buffers for HL) available to a particular group
  11895. * of host-side tx queues, and which host-side tx queues belong to
  11896. * the group.
  11897. *
  11898. * |31|30 24|23 16|15|14|13 0|
  11899. * |------------------------------------------------------------------------|
  11900. * | X| reserved | tx queue grp ID | A| S| credit count |
  11901. * |------------------------------------------------------------------------|
  11902. * | vdev ID mask | AC mask |
  11903. * |------------------------------------------------------------------------|
  11904. *
  11905. * The following definitions describe the fields within the tx queue group
  11906. * information element:
  11907. * - credit_count
  11908. * Bits 13:1
  11909. * Purpose: specify how many tx credits are available to the tx queue group
  11910. * Value: An absolute or relative, positive or negative credit value
  11911. * The 'A' bit specifies whether the value is absolute or relative.
  11912. * The 'S' bit specifies whether the value is positive or negative.
  11913. * A negative value can only be relative, not absolute.
  11914. * An absolute value replaces any prior credit value the host has for
  11915. * the tx queue group in question.
  11916. * A relative value is added to the prior credit value the host has for
  11917. * the tx queue group in question.
  11918. * - sign
  11919. * Bit 14
  11920. * Purpose: specify whether the credit count is positive or negative
  11921. * Value: 0 -> positive, 1 -> negative
  11922. * - absolute
  11923. * Bit 15
  11924. * Purpose: specify whether the credit count is absolute or relative
  11925. * Value: 0 -> relative, 1 -> absolute
  11926. * - txq_group_id
  11927. * Bits 23:16
  11928. * Purpose: indicate which tx queue group's credit and/or membership are
  11929. * being specified
  11930. * Value: 0 to max_tx_queue_groups-1
  11931. * - reserved
  11932. * Bits 30:16
  11933. * Value: 0x0
  11934. * - eXtension
  11935. * Bit 31
  11936. * Purpose: specify whether another tx queue group info element follows
  11937. * Value: 0 -> no more tx queue group information elements
  11938. * 1 -> another tx queue group information element immediately follows
  11939. * - ac_mask
  11940. * Bits 15:0
  11941. * Purpose: specify which Access Categories belong to the tx queue group
  11942. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11943. * the tx queue group.
  11944. * The AC bit-mask values are obtained by left-shifting by the
  11945. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11946. * - vdev_id_mask
  11947. * Bits 31:16
  11948. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11949. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11950. * belong to the tx queue group.
  11951. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11952. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11953. */
  11954. PREPACK struct htt_txq_group {
  11955. A_UINT32
  11956. credit_count: 14,
  11957. sign: 1,
  11958. absolute: 1,
  11959. tx_queue_group_id: 8,
  11960. reserved0: 7,
  11961. extension: 1;
  11962. A_UINT32
  11963. ac_mask: 16,
  11964. vdev_id_mask: 16;
  11965. } POSTPACK;
  11966. /* first word */
  11967. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11968. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11969. #define HTT_TXQ_GROUP_SIGN_S 14
  11970. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11971. #define HTT_TXQ_GROUP_ABS_S 15
  11972. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11973. #define HTT_TXQ_GROUP_ID_S 16
  11974. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11975. #define HTT_TXQ_GROUP_EXT_S 31
  11976. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11977. /* second word */
  11978. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11979. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11980. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11981. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11982. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11983. do { \
  11984. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11985. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11986. } while (0)
  11987. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11988. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11989. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11990. do { \
  11991. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11992. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11993. } while (0)
  11994. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11995. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11996. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11997. do { \
  11998. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11999. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12000. } while (0)
  12001. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12002. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12003. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12004. do { \
  12005. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12006. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12007. } while (0)
  12008. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12009. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12010. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12011. do { \
  12012. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12013. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12014. } while (0)
  12015. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12016. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12017. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12018. do { \
  12019. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12020. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12021. } while (0)
  12022. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12023. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12024. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12025. do { \
  12026. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12027. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12028. } while (0)
  12029. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12030. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12031. /**
  12032. * @brief target -> host TX completion indication message definition
  12033. *
  12034. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12035. *
  12036. * @details
  12037. * The following diagram shows the format of the TX completion indication sent
  12038. * from the target to the host
  12039. *
  12040. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12041. * |-------------------------------------------------------------------|
  12042. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12043. * |-------------------------------------------------------------------|
  12044. * payload:| MSDU1 ID | MSDU0 ID |
  12045. * |-------------------------------------------------------------------|
  12046. * : MSDU3 ID | MSDU2 ID :
  12047. * |-------------------------------------------------------------------|
  12048. * | struct htt_tx_compl_ind_append_retries |
  12049. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12050. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12051. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12052. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12053. * |-------------------------------------------------------------------|
  12054. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12055. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12056. * | MSDU0 tx_tsf64_low |
  12057. * |-------------------------------------------------------------------|
  12058. * | MSDU0 tx_tsf64_high |
  12059. * |-------------------------------------------------------------------|
  12060. * | MSDU1 tx_tsf64_low |
  12061. * |-------------------------------------------------------------------|
  12062. * | MSDU1 tx_tsf64_high |
  12063. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12064. * | phy_timestamp |
  12065. * |-------------------------------------------------------------------|
  12066. * | rate specs (see below) |
  12067. * |-------------------------------------------------------------------|
  12068. * | seqctrl | framectrl |
  12069. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12070. * Where:
  12071. * A0 = append (a.k.a. append0)
  12072. * A1 = append1
  12073. * TP = MSDU tx power presence
  12074. * A2 = append2
  12075. * A3 = append3
  12076. * A4 = append4
  12077. *
  12078. * The following field definitions describe the format of the TX completion
  12079. * indication sent from the target to the host
  12080. * Header fields:
  12081. * - msg_type
  12082. * Bits 7:0
  12083. * Purpose: identifies this as HTT TX completion indication
  12084. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12085. * - status
  12086. * Bits 10:8
  12087. * Purpose: the TX completion status of payload fragmentations descriptors
  12088. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12089. * - tid
  12090. * Bits 14:11
  12091. * Purpose: the tid associated with those fragmentation descriptors. It is
  12092. * valid or not, depending on the tid_invalid bit.
  12093. * Value: 0 to 15
  12094. * - tid_invalid
  12095. * Bits 15:15
  12096. * Purpose: this bit indicates whether the tid field is valid or not
  12097. * Value: 0 indicates valid; 1 indicates invalid
  12098. * - num
  12099. * Bits 23:16
  12100. * Purpose: the number of payload in this indication
  12101. * Value: 1 to 255
  12102. * - append (a.k.a. append0)
  12103. * Bits 24:24
  12104. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12105. * the number of tx retries for one MSDU at the end of this message
  12106. * Value: 0 indicates no appending; 1 indicates appending
  12107. * - append1
  12108. * Bits 25:25
  12109. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12110. * contains the timestamp info for each TX msdu id in payload.
  12111. * The order of the timestamps matches the order of the MSDU IDs.
  12112. * Note that a big-endian host needs to account for the reordering
  12113. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12114. * conversion) when determining which tx timestamp corresponds to
  12115. * which MSDU ID.
  12116. * Value: 0 indicates no appending; 1 indicates appending
  12117. * - msdu_tx_power_presence
  12118. * Bits 26:26
  12119. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12120. * for each MSDU referenced by the TX_COMPL_IND message.
  12121. * The tx power is reported in 0.5 dBm units.
  12122. * The order of the per-MSDU tx power reports matches the order
  12123. * of the MSDU IDs.
  12124. * Note that a big-endian host needs to account for the reordering
  12125. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12126. * conversion) when determining which Tx Power corresponds to
  12127. * which MSDU ID.
  12128. * Value: 0 indicates MSDU tx power reports are not appended,
  12129. * 1 indicates MSDU tx power reports are appended
  12130. * - append2
  12131. * Bits 27:27
  12132. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12133. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12134. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12135. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12136. * for each MSDU, for convenience.
  12137. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12138. * this append2 bit is set).
  12139. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12140. * dB above the noise floor.
  12141. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12142. * 1 indicates MSDU ACK RSSI values are appended.
  12143. * - append3
  12144. * Bits 28:28
  12145. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12146. * contains the tx tsf info based on wlan global TSF for
  12147. * each TX msdu id in payload.
  12148. * The order of the tx tsf matches the order of the MSDU IDs.
  12149. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12150. * values to indicate the the lower 32 bits and higher 32 bits of
  12151. * the tx tsf.
  12152. * The tx_tsf64 here represents the time MSDU was acked and the
  12153. * tx_tsf64 has microseconds units.
  12154. * Value: 0 indicates no appending; 1 indicates appending
  12155. * - append4
  12156. * Bits 29:29
  12157. * Purpose: Indicate whether data frame control fields and fields required
  12158. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12159. * message. The order of the this message matches the order of
  12160. * the MSDU IDs.
  12161. * Value: 0 indicates frame control fields and fields required for
  12162. * radio tap header values are not appended,
  12163. * 1 indicates frame control fields and fields required for
  12164. * radio tap header values are appended.
  12165. * Payload fields:
  12166. * - hmsdu_id
  12167. * Bits 15:0
  12168. * Purpose: this ID is used to track the Tx buffer in host
  12169. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12170. */
  12171. PREPACK struct htt_tx_data_hdr_information {
  12172. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12173. A_UINT32 /* word 1 */
  12174. /* preamble:
  12175. * 0-OFDM,
  12176. * 1-CCk,
  12177. * 2-HT,
  12178. * 3-VHT
  12179. */
  12180. preamble: 2, /* [1:0] */
  12181. /* mcs:
  12182. * In case of HT preamble interpret
  12183. * MCS along with NSS.
  12184. * Valid values for HT are 0 to 7.
  12185. * HT mcs 0 with NSS 2 is mcs 8.
  12186. * Valid values for VHT are 0 to 9.
  12187. */
  12188. mcs: 4, /* [5:2] */
  12189. /* rate:
  12190. * This is applicable only for
  12191. * CCK and OFDM preamble type
  12192. * rate 0: OFDM 48 Mbps,
  12193. * 1: OFDM 24 Mbps,
  12194. * 2: OFDM 12 Mbps
  12195. * 3: OFDM 6 Mbps
  12196. * 4: OFDM 54 Mbps
  12197. * 5: OFDM 36 Mbps
  12198. * 6: OFDM 18 Mbps
  12199. * 7: OFDM 9 Mbps
  12200. * rate 0: CCK 11 Mbps Long
  12201. * 1: CCK 5.5 Mbps Long
  12202. * 2: CCK 2 Mbps Long
  12203. * 3: CCK 1 Mbps Long
  12204. * 4: CCK 11 Mbps Short
  12205. * 5: CCK 5.5 Mbps Short
  12206. * 6: CCK 2 Mbps Short
  12207. */
  12208. rate : 3, /* [ 8: 6] */
  12209. rssi : 8, /* [16: 9] units=dBm */
  12210. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12211. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12212. stbc : 1, /* [22] */
  12213. sgi : 1, /* [23] */
  12214. ldpc : 1, /* [24] */
  12215. beamformed: 1, /* [25] */
  12216. /* tx_retry_cnt:
  12217. * Indicates retry count of data tx frames provided by the host.
  12218. */
  12219. tx_retry_cnt: 6; /* [31:26] */
  12220. A_UINT32 /* word 2 */
  12221. framectrl:16, /* [15: 0] */
  12222. seqno:16; /* [31:16] */
  12223. } POSTPACK;
  12224. #define HTT_TX_COMPL_IND_STATUS_S 8
  12225. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12226. #define HTT_TX_COMPL_IND_TID_S 11
  12227. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12228. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12229. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12230. #define HTT_TX_COMPL_IND_NUM_S 16
  12231. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12232. #define HTT_TX_COMPL_IND_APPEND_S 24
  12233. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12234. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12235. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12236. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12237. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12238. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12239. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12240. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12241. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12242. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12243. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12244. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12245. do { \
  12246. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12247. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12248. } while (0)
  12249. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12250. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12251. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12252. do { \
  12253. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12254. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12255. } while (0)
  12256. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12257. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12258. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12259. do { \
  12260. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12261. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12262. } while (0)
  12263. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12264. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12265. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12266. do { \
  12267. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12268. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12269. } while (0)
  12270. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12271. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12272. HTT_TX_COMPL_IND_TID_INV_S)
  12273. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12274. do { \
  12275. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12276. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12277. } while (0)
  12278. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12279. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12280. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12281. do { \
  12282. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12283. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12284. } while (0)
  12285. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12286. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12287. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12288. do { \
  12289. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12290. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12291. } while (0)
  12292. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12293. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12294. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12295. do { \
  12296. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12297. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12298. } while (0)
  12299. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12300. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12301. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12302. do { \
  12303. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12304. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12305. } while (0)
  12306. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12307. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12308. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12309. do { \
  12310. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12311. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12312. } while (0)
  12313. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12314. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12315. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12316. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12317. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12318. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12319. #define HTT_TX_COMPL_IND_STAT_OK 0
  12320. /* DISCARD:
  12321. * current meaning:
  12322. * MSDUs were queued for transmission but filtered by HW or SW
  12323. * without any over the air attempts
  12324. * legacy meaning (HL Rome):
  12325. * MSDUs were discarded by the target FW without any over the air
  12326. * attempts due to lack of space
  12327. */
  12328. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12329. /* NO_ACK:
  12330. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12331. */
  12332. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12333. /* POSTPONE:
  12334. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12335. * be downloaded again later (in the appropriate order), when they are
  12336. * deliverable.
  12337. */
  12338. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12339. /*
  12340. * The PEER_DEL tx completion status is used for HL cases
  12341. * where the peer the frame is for has been deleted.
  12342. * The host has already discarded its copy of the frame, but
  12343. * it still needs the tx completion to restore its credit.
  12344. */
  12345. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12346. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12347. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12348. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12349. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12350. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12351. PREPACK struct htt_tx_compl_ind_base {
  12352. A_UINT32 hdr;
  12353. A_UINT16 payload[1/*or more*/];
  12354. } POSTPACK;
  12355. PREPACK struct htt_tx_compl_ind_append_retries {
  12356. A_UINT16 msdu_id;
  12357. A_UINT8 tx_retries;
  12358. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12359. 0: this is the last append_retries struct */
  12360. } POSTPACK;
  12361. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12362. A_UINT32 timestamp[1/*or more*/];
  12363. } POSTPACK;
  12364. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12365. A_UINT32 tx_tsf64_low;
  12366. A_UINT32 tx_tsf64_high;
  12367. } POSTPACK;
  12368. /* htt_tx_data_hdr_information payload extension fields: */
  12369. /* DWORD zero */
  12370. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12371. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12372. /* DWORD one */
  12373. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12374. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12375. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12376. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12377. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12378. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12379. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12380. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12381. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12382. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12383. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12384. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12385. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12386. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12387. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12388. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12389. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12390. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12391. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12392. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12393. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12394. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12395. /* DWORD two */
  12396. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12397. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12398. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12399. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12400. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12401. do { \
  12402. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12403. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12404. } while (0)
  12405. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12406. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12407. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12408. do { \
  12409. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12410. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12411. } while (0)
  12412. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12413. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12414. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12415. do { \
  12416. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12417. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12418. } while (0)
  12419. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12420. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12421. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12422. do { \
  12423. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12424. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12425. } while (0)
  12426. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12427. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12428. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12429. do { \
  12430. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12431. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12432. } while (0)
  12433. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12434. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12435. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12436. do { \
  12437. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12438. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12439. } while (0)
  12440. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12441. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12442. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12443. do { \
  12444. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12445. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12446. } while (0)
  12447. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12448. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12449. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12450. do { \
  12451. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12452. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12453. } while (0)
  12454. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12455. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12456. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12457. do { \
  12458. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12459. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12460. } while (0)
  12461. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12462. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12463. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12464. do { \
  12465. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12466. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12467. } while (0)
  12468. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12469. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12470. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12471. do { \
  12472. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12473. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12474. } while (0)
  12475. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12476. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12477. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12478. do { \
  12479. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12480. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12481. } while (0)
  12482. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12483. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12484. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12485. do { \
  12486. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12487. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12488. } while (0)
  12489. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12490. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12491. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12492. do { \
  12493. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12494. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12495. } while (0)
  12496. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12497. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12498. /**
  12499. * @brief target -> host rate-control update indication message
  12500. *
  12501. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12502. *
  12503. * @details
  12504. * The following diagram shows the format of the RC Update message
  12505. * sent from the target to the host, while processing the tx-completion
  12506. * of a transmitted PPDU.
  12507. *
  12508. * |31 24|23 16|15 8|7 0|
  12509. * |-------------------------------------------------------------|
  12510. * | peer ID | vdev ID | msg_type |
  12511. * |-------------------------------------------------------------|
  12512. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12513. * |-------------------------------------------------------------|
  12514. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12515. * |-------------------------------------------------------------|
  12516. * | : |
  12517. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12518. * | : |
  12519. * |-------------------------------------------------------------|
  12520. * | : |
  12521. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12522. * | : |
  12523. * |-------------------------------------------------------------|
  12524. * : :
  12525. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12526. *
  12527. */
  12528. typedef struct {
  12529. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12530. A_UINT32 rate_code_flags;
  12531. A_UINT32 flags; /* Encodes information such as excessive
  12532. retransmission, aggregate, some info
  12533. from .11 frame control,
  12534. STBC, LDPC, (SGI and Tx Chain Mask
  12535. are encoded in ptx_rc->flags field),
  12536. AMPDU truncation (BT/time based etc.),
  12537. RTS/CTS attempt */
  12538. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12539. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12540. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12541. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12542. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12543. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12544. } HTT_RC_TX_DONE_PARAMS;
  12545. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12546. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12547. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12548. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12549. #define HTT_RC_UPDATE_VDEVID_S 8
  12550. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12551. #define HTT_RC_UPDATE_PEERID_S 16
  12552. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12553. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12554. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12555. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12556. do { \
  12557. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12558. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12559. } while (0)
  12560. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12561. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12562. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12563. do { \
  12564. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12565. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12566. } while (0)
  12567. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12568. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12569. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12570. do { \
  12571. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12572. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12573. } while (0)
  12574. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12575. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12576. /**
  12577. * @brief target -> host rx fragment indication message definition
  12578. *
  12579. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12580. *
  12581. * @details
  12582. * The following field definitions describe the format of the rx fragment
  12583. * indication message sent from the target to the host.
  12584. * The rx fragment indication message shares the format of the
  12585. * rx indication message, but not all fields from the rx indication message
  12586. * are relevant to the rx fragment indication message.
  12587. *
  12588. *
  12589. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12590. * |-----------+-------------------+---------------------+-------------|
  12591. * | peer ID | |FV| ext TID | msg type |
  12592. * |-------------------------------------------------------------------|
  12593. * | | flush | flush |
  12594. * | | end | start |
  12595. * | | seq num | seq num |
  12596. * |-------------------------------------------------------------------|
  12597. * | reserved | FW rx desc bytes |
  12598. * |-------------------------------------------------------------------|
  12599. * | | FW MSDU Rx |
  12600. * | | desc B0 |
  12601. * |-------------------------------------------------------------------|
  12602. * Header fields:
  12603. * - MSG_TYPE
  12604. * Bits 7:0
  12605. * Purpose: identifies this as an rx fragment indication message
  12606. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12607. * - EXT_TID
  12608. * Bits 12:8
  12609. * Purpose: identify the traffic ID of the rx data, including
  12610. * special "extended" TID values for multicast, broadcast, and
  12611. * non-QoS data frames
  12612. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12613. * - FLUSH_VALID (FV)
  12614. * Bit 13
  12615. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12616. * is valid
  12617. * Value:
  12618. * 1 -> flush IE is valid and needs to be processed
  12619. * 0 -> flush IE is not valid and should be ignored
  12620. * - PEER_ID
  12621. * Bits 31:16
  12622. * Purpose: Identify, by ID, which peer sent the rx data
  12623. * Value: ID of the peer who sent the rx data
  12624. * - FLUSH_SEQ_NUM_START
  12625. * Bits 5:0
  12626. * Purpose: Indicate the start of a series of MPDUs to flush
  12627. * Not all MPDUs within this series are necessarily valid - the host
  12628. * must check each sequence number within this range to see if the
  12629. * corresponding MPDU is actually present.
  12630. * This field is only valid if the FV bit is set.
  12631. * Value:
  12632. * The sequence number for the first MPDUs to check to flush.
  12633. * The sequence number is masked by 0x3f.
  12634. * - FLUSH_SEQ_NUM_END
  12635. * Bits 11:6
  12636. * Purpose: Indicate the end of a series of MPDUs to flush
  12637. * Value:
  12638. * The sequence number one larger than the sequence number of the
  12639. * last MPDU to check to flush.
  12640. * The sequence number is masked by 0x3f.
  12641. * Not all MPDUs within this series are necessarily valid - the host
  12642. * must check each sequence number within this range to see if the
  12643. * corresponding MPDU is actually present.
  12644. * This field is only valid if the FV bit is set.
  12645. * Rx descriptor fields:
  12646. * - FW_RX_DESC_BYTES
  12647. * Bits 15:0
  12648. * Purpose: Indicate how many bytes in the Rx indication are used for
  12649. * FW Rx descriptors
  12650. * Value: 1
  12651. */
  12652. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12653. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12654. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12655. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12656. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12657. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12658. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12659. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12660. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12661. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12662. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12663. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12664. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12665. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12666. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12667. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12668. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12669. #define HTT_RX_FRAG_IND_BYTES \
  12670. (4 /* msg hdr */ + \
  12671. 4 /* flush spec */ + \
  12672. 4 /* (unused) FW rx desc bytes spec */ + \
  12673. 4 /* FW rx desc */)
  12674. /**
  12675. * @brief target -> host test message definition
  12676. *
  12677. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12678. *
  12679. * @details
  12680. * The following field definitions describe the format of the test
  12681. * message sent from the target to the host.
  12682. * The message consists of a 4-octet header, followed by a variable
  12683. * number of 32-bit integer values, followed by a variable number
  12684. * of 8-bit character values.
  12685. *
  12686. * |31 16|15 8|7 0|
  12687. * |-----------------------------------------------------------|
  12688. * | num chars | num ints | msg type |
  12689. * |-----------------------------------------------------------|
  12690. * | int 0 |
  12691. * |-----------------------------------------------------------|
  12692. * | int 1 |
  12693. * |-----------------------------------------------------------|
  12694. * | ... |
  12695. * |-----------------------------------------------------------|
  12696. * | char 3 | char 2 | char 1 | char 0 |
  12697. * |-----------------------------------------------------------|
  12698. * | | | ... | char 4 |
  12699. * |-----------------------------------------------------------|
  12700. * - MSG_TYPE
  12701. * Bits 7:0
  12702. * Purpose: identifies this as a test message
  12703. * Value: HTT_MSG_TYPE_TEST
  12704. * - NUM_INTS
  12705. * Bits 15:8
  12706. * Purpose: indicate how many 32-bit integers follow the message header
  12707. * - NUM_CHARS
  12708. * Bits 31:16
  12709. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12710. */
  12711. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12712. #define HTT_RX_TEST_NUM_INTS_S 8
  12713. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12714. #define HTT_RX_TEST_NUM_CHARS_S 16
  12715. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12716. do { \
  12717. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12718. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12719. } while (0)
  12720. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12721. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12722. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12723. do { \
  12724. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12725. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12726. } while (0)
  12727. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12728. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12729. /**
  12730. * @brief target -> host packet log message
  12731. *
  12732. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12733. *
  12734. * @details
  12735. * The following field definitions describe the format of the packet log
  12736. * message sent from the target to the host.
  12737. * The message consists of a 4-octet header,followed by a variable number
  12738. * of 32-bit character values.
  12739. *
  12740. * |31 16|15 12|11 10|9 8|7 0|
  12741. * |------------------------------------------------------------------|
  12742. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12743. * |------------------------------------------------------------------|
  12744. * | payload |
  12745. * |------------------------------------------------------------------|
  12746. * - MSG_TYPE
  12747. * Bits 7:0
  12748. * Purpose: identifies this as a pktlog message
  12749. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12750. * - mac_id
  12751. * Bits 9:8
  12752. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12753. * Value: 0-3
  12754. * - pdev_id
  12755. * Bits 11:10
  12756. * Purpose: pdev_id
  12757. * Value: 0-3
  12758. * 0 (for rings at SOC level),
  12759. * 1/2/3 PDEV -> 0/1/2
  12760. * - payload_size
  12761. * Bits 31:16
  12762. * Purpose: explicitly specify the payload size
  12763. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12764. */
  12765. PREPACK struct htt_pktlog_msg {
  12766. A_UINT32 header;
  12767. A_UINT32 payload[1/* or more */];
  12768. } POSTPACK;
  12769. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12770. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12771. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12772. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12773. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12774. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12775. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12776. do { \
  12777. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12778. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12779. } while (0)
  12780. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12781. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12782. HTT_T2H_PKTLOG_MAC_ID_S)
  12783. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12784. do { \
  12785. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12786. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12787. } while (0)
  12788. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12789. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12790. HTT_T2H_PKTLOG_PDEV_ID_S)
  12791. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12792. do { \
  12793. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12794. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12795. } while (0)
  12796. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12797. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12798. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12799. /*
  12800. * Rx reorder statistics
  12801. * NB: all the fields must be defined in 4 octets size.
  12802. */
  12803. struct rx_reorder_stats {
  12804. /* Non QoS MPDUs received */
  12805. A_UINT32 deliver_non_qos;
  12806. /* MPDUs received in-order */
  12807. A_UINT32 deliver_in_order;
  12808. /* Flush due to reorder timer expired */
  12809. A_UINT32 deliver_flush_timeout;
  12810. /* Flush due to move out of window */
  12811. A_UINT32 deliver_flush_oow;
  12812. /* Flush due to DELBA */
  12813. A_UINT32 deliver_flush_delba;
  12814. /* MPDUs dropped due to FCS error */
  12815. A_UINT32 fcs_error;
  12816. /* MPDUs dropped due to monitor mode non-data packet */
  12817. A_UINT32 mgmt_ctrl;
  12818. /* Unicast-data MPDUs dropped due to invalid peer */
  12819. A_UINT32 invalid_peer;
  12820. /* MPDUs dropped due to duplication (non aggregation) */
  12821. A_UINT32 dup_non_aggr;
  12822. /* MPDUs dropped due to processed before */
  12823. A_UINT32 dup_past;
  12824. /* MPDUs dropped due to duplicate in reorder queue */
  12825. A_UINT32 dup_in_reorder;
  12826. /* Reorder timeout happened */
  12827. A_UINT32 reorder_timeout;
  12828. /* invalid bar ssn */
  12829. A_UINT32 invalid_bar_ssn;
  12830. /* reorder reset due to bar ssn */
  12831. A_UINT32 ssn_reset;
  12832. /* Flush due to delete peer */
  12833. A_UINT32 deliver_flush_delpeer;
  12834. /* Flush due to offload*/
  12835. A_UINT32 deliver_flush_offload;
  12836. /* Flush due to out of buffer*/
  12837. A_UINT32 deliver_flush_oob;
  12838. /* MPDUs dropped due to PN check fail */
  12839. A_UINT32 pn_fail;
  12840. /* MPDUs dropped due to unable to allocate memory */
  12841. A_UINT32 store_fail;
  12842. /* Number of times the tid pool alloc succeeded */
  12843. A_UINT32 tid_pool_alloc_succ;
  12844. /* Number of times the MPDU pool alloc succeeded */
  12845. A_UINT32 mpdu_pool_alloc_succ;
  12846. /* Number of times the MSDU pool alloc succeeded */
  12847. A_UINT32 msdu_pool_alloc_succ;
  12848. /* Number of times the tid pool alloc failed */
  12849. A_UINT32 tid_pool_alloc_fail;
  12850. /* Number of times the MPDU pool alloc failed */
  12851. A_UINT32 mpdu_pool_alloc_fail;
  12852. /* Number of times the MSDU pool alloc failed */
  12853. A_UINT32 msdu_pool_alloc_fail;
  12854. /* Number of times the tid pool freed */
  12855. A_UINT32 tid_pool_free;
  12856. /* Number of times the MPDU pool freed */
  12857. A_UINT32 mpdu_pool_free;
  12858. /* Number of times the MSDU pool freed */
  12859. A_UINT32 msdu_pool_free;
  12860. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12861. A_UINT32 msdu_queued;
  12862. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12863. A_UINT32 msdu_recycled;
  12864. /* Number of MPDUs with invalid peer but A2 found in AST */
  12865. A_UINT32 invalid_peer_a2_in_ast;
  12866. /* Number of MPDUs with invalid peer but A3 found in AST */
  12867. A_UINT32 invalid_peer_a3_in_ast;
  12868. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12869. A_UINT32 invalid_peer_bmc_mpdus;
  12870. /* Number of MSDUs with err attention word */
  12871. A_UINT32 rxdesc_err_att;
  12872. /* Number of MSDUs with flag of peer_idx_invalid */
  12873. A_UINT32 rxdesc_err_peer_idx_inv;
  12874. /* Number of MSDUs with flag of peer_idx_timeout */
  12875. A_UINT32 rxdesc_err_peer_idx_to;
  12876. /* Number of MSDUs with flag of overflow */
  12877. A_UINT32 rxdesc_err_ov;
  12878. /* Number of MSDUs with flag of msdu_length_err */
  12879. A_UINT32 rxdesc_err_msdu_len;
  12880. /* Number of MSDUs with flag of mpdu_length_err */
  12881. A_UINT32 rxdesc_err_mpdu_len;
  12882. /* Number of MSDUs with flag of tkip_mic_err */
  12883. A_UINT32 rxdesc_err_tkip_mic;
  12884. /* Number of MSDUs with flag of decrypt_err */
  12885. A_UINT32 rxdesc_err_decrypt;
  12886. /* Number of MSDUs with flag of fcs_err */
  12887. A_UINT32 rxdesc_err_fcs;
  12888. /* Number of Unicast (bc_mc bit is not set in attention word)
  12889. * frames with invalid peer handler
  12890. */
  12891. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12892. /* Number of unicast frame directly (direct bit is set in attention word)
  12893. * to DUT with invalid peer handler
  12894. */
  12895. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12896. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12897. * frames with invalid peer handler
  12898. */
  12899. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12900. /* Number of MSDUs dropped due to no first MSDU flag */
  12901. A_UINT32 rxdesc_no_1st_msdu;
  12902. /* Number of MSDUs droped due to ring overflow */
  12903. A_UINT32 msdu_drop_ring_ov;
  12904. /* Number of MSDUs dropped due to FC mismatch */
  12905. A_UINT32 msdu_drop_fc_mismatch;
  12906. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12907. A_UINT32 msdu_drop_mgmt_remote_ring;
  12908. /* Number of MSDUs dropped due to errors not reported in attention word */
  12909. A_UINT32 msdu_drop_misc;
  12910. /* Number of MSDUs go to offload before reorder */
  12911. A_UINT32 offload_msdu_wal;
  12912. /* Number of data frame dropped by offload after reorder */
  12913. A_UINT32 offload_msdu_reorder;
  12914. /* Number of MPDUs with sequence number in the past and within the BA window */
  12915. A_UINT32 dup_past_within_window;
  12916. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12917. A_UINT32 dup_past_outside_window;
  12918. /* Number of MSDUs with decrypt/MIC error */
  12919. A_UINT32 rxdesc_err_decrypt_mic;
  12920. /* Number of data MSDUs received on both local and remote rings */
  12921. A_UINT32 data_msdus_on_both_rings;
  12922. /* MPDUs never filled */
  12923. A_UINT32 holes_not_filled;
  12924. };
  12925. /*
  12926. * Rx Remote buffer statistics
  12927. * NB: all the fields must be defined in 4 octets size.
  12928. */
  12929. struct rx_remote_buffer_mgmt_stats {
  12930. /* Total number of MSDUs reaped for Rx processing */
  12931. A_UINT32 remote_reaped;
  12932. /* MSDUs recycled within firmware */
  12933. A_UINT32 remote_recycled;
  12934. /* MSDUs stored by Data Rx */
  12935. A_UINT32 data_rx_msdus_stored;
  12936. /* Number of HTT indications from WAL Rx MSDU */
  12937. A_UINT32 wal_rx_ind;
  12938. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12939. A_UINT32 wal_rx_ind_unconsumed;
  12940. /* Number of HTT indications from Data Rx MSDU */
  12941. A_UINT32 data_rx_ind;
  12942. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12943. A_UINT32 data_rx_ind_unconsumed;
  12944. /* Number of HTT indications from ATHBUF */
  12945. A_UINT32 athbuf_rx_ind;
  12946. /* Number of remote buffers requested for refill */
  12947. A_UINT32 refill_buf_req;
  12948. /* Number of remote buffers filled by the host */
  12949. A_UINT32 refill_buf_rsp;
  12950. /* Number of times MAC hw_index = f/w write_index */
  12951. A_INT32 mac_no_bufs;
  12952. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12953. A_INT32 fw_indices_equal;
  12954. /* Number of times f/w finds no buffers to post */
  12955. A_INT32 host_no_bufs;
  12956. };
  12957. /*
  12958. * TXBF MU/SU packets and NDPA statistics
  12959. * NB: all the fields must be defined in 4 octets size.
  12960. */
  12961. struct rx_txbf_musu_ndpa_pkts_stats {
  12962. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12963. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12964. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12965. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12966. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12967. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12968. };
  12969. /*
  12970. * htt_dbg_stats_status -
  12971. * present - The requested stats have been delivered in full.
  12972. * This indicates that either the stats information was contained
  12973. * in its entirety within this message, or else this message
  12974. * completes the delivery of the requested stats info that was
  12975. * partially delivered through earlier STATS_CONF messages.
  12976. * partial - The requested stats have been delivered in part.
  12977. * One or more subsequent STATS_CONF messages with the same
  12978. * cookie value will be sent to deliver the remainder of the
  12979. * information.
  12980. * error - The requested stats could not be delivered, for example due
  12981. * to a shortage of memory to construct a message holding the
  12982. * requested stats.
  12983. * invalid - The requested stat type is either not recognized, or the
  12984. * target is configured to not gather the stats type in question.
  12985. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12986. * series_done - This special value indicates that no further stats info
  12987. * elements are present within a series of stats info elems
  12988. * (within a stats upload confirmation message).
  12989. */
  12990. enum htt_dbg_stats_status {
  12991. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12992. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12993. HTT_DBG_STATS_STATUS_ERROR = 2,
  12994. HTT_DBG_STATS_STATUS_INVALID = 3,
  12995. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12996. };
  12997. /**
  12998. * @brief target -> host statistics upload
  12999. *
  13000. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13001. *
  13002. * @details
  13003. * The following field definitions describe the format of the HTT target
  13004. * to host stats upload confirmation message.
  13005. * The message contains a cookie echoed from the HTT host->target stats
  13006. * upload request, which identifies which request the confirmation is
  13007. * for, and a series of tag-length-value stats information elements.
  13008. * The tag-length header for each stats info element also includes a
  13009. * status field, to indicate whether the request for the stat type in
  13010. * question was fully met, partially met, unable to be met, or invalid
  13011. * (if the stat type in question is disabled in the target).
  13012. * A special value of all 1's in this status field is used to indicate
  13013. * the end of the series of stats info elements.
  13014. *
  13015. *
  13016. * |31 16|15 8|7 5|4 0|
  13017. * |------------------------------------------------------------|
  13018. * | reserved | msg type |
  13019. * |------------------------------------------------------------|
  13020. * | cookie LSBs |
  13021. * |------------------------------------------------------------|
  13022. * | cookie MSBs |
  13023. * |------------------------------------------------------------|
  13024. * | stats entry length | reserved | S |stat type|
  13025. * |------------------------------------------------------------|
  13026. * | |
  13027. * | type-specific stats info |
  13028. * | |
  13029. * |------------------------------------------------------------|
  13030. * | stats entry length | reserved | S |stat type|
  13031. * |------------------------------------------------------------|
  13032. * | |
  13033. * | type-specific stats info |
  13034. * | |
  13035. * |------------------------------------------------------------|
  13036. * | n/a | reserved | 111 | n/a |
  13037. * |------------------------------------------------------------|
  13038. * Header fields:
  13039. * - MSG_TYPE
  13040. * Bits 7:0
  13041. * Purpose: identifies this is a statistics upload confirmation message
  13042. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13043. * - COOKIE_LSBS
  13044. * Bits 31:0
  13045. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13046. * message with its preceding host->target stats request message.
  13047. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13048. * - COOKIE_MSBS
  13049. * Bits 31:0
  13050. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13051. * message with its preceding host->target stats request message.
  13052. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13053. *
  13054. * Stats Information Element tag-length header fields:
  13055. * - STAT_TYPE
  13056. * Bits 4:0
  13057. * Purpose: identifies the type of statistics info held in the
  13058. * following information element
  13059. * Value: htt_dbg_stats_type
  13060. * - STATUS
  13061. * Bits 7:5
  13062. * Purpose: indicate whether the requested stats are present
  13063. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13064. * the completion of the stats entry series
  13065. * - LENGTH
  13066. * Bits 31:16
  13067. * Purpose: indicate the stats information size
  13068. * Value: This field specifies the number of bytes of stats information
  13069. * that follows the element tag-length header.
  13070. * It is expected but not required that this length is a multiple of
  13071. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13072. * subsequent stats entry header will begin on a 4-byte aligned
  13073. * boundary.
  13074. */
  13075. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13076. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13077. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13078. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13079. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13080. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13081. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13082. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13083. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13084. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13085. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13086. do { \
  13087. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13088. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13089. } while (0)
  13090. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13091. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13092. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13093. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13094. do { \
  13095. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13096. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13097. } while (0)
  13098. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13099. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13100. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13101. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13102. do { \
  13103. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13104. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13105. } while (0)
  13106. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13107. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13108. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13109. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13110. #define HTT_MAX_AGGR 64
  13111. #define HTT_HL_MAX_AGGR 18
  13112. /**
  13113. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13114. *
  13115. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13116. *
  13117. * @details
  13118. * The following field definitions describe the format of the HTT host
  13119. * to target frag_desc/msdu_ext bank configuration message.
  13120. * The message contains the based address and the min and max id of the
  13121. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13122. * MSDU_EXT/FRAG_DESC.
  13123. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13124. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13125. * the hardware does the mapping/translation.
  13126. *
  13127. * Total banks that can be configured is configured to 16.
  13128. *
  13129. * This should be called before any TX has be initiated by the HTT
  13130. *
  13131. * |31 16|15 8|7 5|4 0|
  13132. * |------------------------------------------------------------|
  13133. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13134. * |------------------------------------------------------------|
  13135. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13136. #if HTT_PADDR64
  13137. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13138. #endif
  13139. * |------------------------------------------------------------|
  13140. * | ... |
  13141. * |------------------------------------------------------------|
  13142. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13143. #if HTT_PADDR64
  13144. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13145. #endif
  13146. * |------------------------------------------------------------|
  13147. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13148. * |------------------------------------------------------------|
  13149. * | ... |
  13150. * |------------------------------------------------------------|
  13151. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13152. * |------------------------------------------------------------|
  13153. * Header fields:
  13154. * - MSG_TYPE
  13155. * Bits 7:0
  13156. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13157. * for systems with 64-bit format for bus addresses:
  13158. * - BANKx_BASE_ADDRESS_LO
  13159. * Bits 31:0
  13160. * Purpose: Provide a mechanism to specify the base address of the
  13161. * MSDU_EXT bank physical/bus address.
  13162. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13163. * - BANKx_BASE_ADDRESS_HI
  13164. * Bits 31:0
  13165. * Purpose: Provide a mechanism to specify the base address of the
  13166. * MSDU_EXT bank physical/bus address.
  13167. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13168. * for systems with 32-bit format for bus addresses:
  13169. * - BANKx_BASE_ADDRESS
  13170. * Bits 31:0
  13171. * Purpose: Provide a mechanism to specify the base address of the
  13172. * MSDU_EXT bank physical/bus address.
  13173. * Value: MSDU_EXT bank physical / bus address
  13174. * - BANKx_MIN_ID
  13175. * Bits 15:0
  13176. * Purpose: Provide a mechanism to specify the min index that needs to
  13177. * mapped.
  13178. * - BANKx_MAX_ID
  13179. * Bits 31:16
  13180. * Purpose: Provide a mechanism to specify the max index that needs to
  13181. * mapped.
  13182. *
  13183. */
  13184. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13185. * safe value.
  13186. * @note MAX supported banks is 16.
  13187. */
  13188. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13189. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13190. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13191. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13192. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13193. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13194. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13195. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13196. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13197. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13198. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13199. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13200. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13201. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13202. do { \
  13203. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13204. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13205. } while (0)
  13206. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13207. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13208. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13209. do { \
  13210. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13211. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13212. } while (0)
  13213. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13214. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13215. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13216. do { \
  13217. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13218. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13219. } while (0)
  13220. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13221. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13222. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13223. do { \
  13224. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13225. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13226. } while (0)
  13227. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13228. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13229. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13230. do { \
  13231. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13232. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13233. } while (0)
  13234. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13235. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13236. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13237. do { \
  13238. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13239. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13240. } while (0)
  13241. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13242. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13243. /*
  13244. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13245. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13246. * addresses are stored in a XXX-bit field.
  13247. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13248. * htt_tx_frag_desc64_bank_cfg_t structs.
  13249. */
  13250. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13251. _paddr_bits_, \
  13252. _paddr__bank_base_address_) \
  13253. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13254. /** word 0 \
  13255. * msg_type: 8, \
  13256. * pdev_id: 2, \
  13257. * swap: 1, \
  13258. * reserved0: 5, \
  13259. * num_banks: 8, \
  13260. * desc_size: 8; \
  13261. */ \
  13262. A_UINT32 word0; \
  13263. /* \
  13264. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13265. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13266. * the second A_UINT32). \
  13267. */ \
  13268. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13269. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13270. } POSTPACK
  13271. /* define htt_tx_frag_desc32_bank_cfg_t */
  13272. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13273. /* define htt_tx_frag_desc64_bank_cfg_t */
  13274. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13275. /*
  13276. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13277. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13278. */
  13279. #if HTT_PADDR64
  13280. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13281. #else
  13282. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13283. #endif
  13284. /**
  13285. * @brief target -> host HTT TX Credit total count update message definition
  13286. *
  13287. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13288. *
  13289. *|31 16|15|14 9| 8 |7 0 |
  13290. *|---------------------+--+----------+-------+----------|
  13291. *|cur htt credit delta | Q| reserved | sign | msg type |
  13292. *|------------------------------------------------------|
  13293. *
  13294. * Header fields:
  13295. * - MSG_TYPE
  13296. * Bits 7:0
  13297. * Purpose: identifies this as a htt tx credit delta update message
  13298. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13299. * - SIGN
  13300. * Bits 8
  13301. * identifies whether credit delta is positive or negative
  13302. * Value:
  13303. * - 0x0: credit delta is positive, rebalance in some buffers
  13304. * - 0x1: credit delta is negative, rebalance out some buffers
  13305. * - reserved
  13306. * Bits 14:9
  13307. * Value: 0x0
  13308. * - TXQ_GRP
  13309. * Bit 15
  13310. * Purpose: indicates whether any tx queue group information elements
  13311. * are appended to the tx credit update message
  13312. * Value: 0 -> no tx queue group information element is present
  13313. * 1 -> a tx queue group information element immediately follows
  13314. * - DELTA_COUNT
  13315. * Bits 31:16
  13316. * Purpose: Specify current htt credit delta absolute count
  13317. */
  13318. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13319. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13320. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13321. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13322. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13323. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13324. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13325. do { \
  13326. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13327. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13328. } while (0)
  13329. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13330. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13331. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13332. do { \
  13333. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13334. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13335. } while (0)
  13336. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13337. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13338. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13339. do { \
  13340. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13341. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13342. } while (0)
  13343. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13344. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13345. #define HTT_TX_CREDIT_MSG_BYTES 4
  13346. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13347. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13348. /**
  13349. * @brief HTT WDI_IPA Operation Response Message
  13350. *
  13351. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13352. *
  13353. * @details
  13354. * HTT WDI_IPA Operation Response message is sent by target
  13355. * to host confirming suspend or resume operation.
  13356. * |31 24|23 16|15 8|7 0|
  13357. * |----------------+----------------+----------------+----------------|
  13358. * | op_code | Rsvd | msg_type |
  13359. * |-------------------------------------------------------------------|
  13360. * | Rsvd | Response len |
  13361. * |-------------------------------------------------------------------|
  13362. * | |
  13363. * | Response-type specific info |
  13364. * | |
  13365. * | |
  13366. * |-------------------------------------------------------------------|
  13367. * Header fields:
  13368. * - MSG_TYPE
  13369. * Bits 7:0
  13370. * Purpose: Identifies this as WDI_IPA Operation Response message
  13371. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13372. * - OP_CODE
  13373. * Bits 31:16
  13374. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13375. * value: = enum htt_wdi_ipa_op_code
  13376. * - RSP_LEN
  13377. * Bits 16:0
  13378. * Purpose: length for the response-type specific info
  13379. * value: = length in bytes for response-type specific info
  13380. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13381. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13382. */
  13383. PREPACK struct htt_wdi_ipa_op_response_t
  13384. {
  13385. /* DWORD 0: flags and meta-data */
  13386. A_UINT32
  13387. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13388. reserved1: 8,
  13389. op_code: 16;
  13390. A_UINT32
  13391. rsp_len: 16,
  13392. reserved2: 16;
  13393. } POSTPACK;
  13394. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13395. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13396. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13397. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13398. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13399. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13400. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13401. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13402. do { \
  13403. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13404. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13405. } while (0)
  13406. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13407. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13408. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13409. do { \
  13410. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13411. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13412. } while (0)
  13413. enum htt_phy_mode {
  13414. htt_phy_mode_11a = 0,
  13415. htt_phy_mode_11g = 1,
  13416. htt_phy_mode_11b = 2,
  13417. htt_phy_mode_11g_only = 3,
  13418. htt_phy_mode_11na_ht20 = 4,
  13419. htt_phy_mode_11ng_ht20 = 5,
  13420. htt_phy_mode_11na_ht40 = 6,
  13421. htt_phy_mode_11ng_ht40 = 7,
  13422. htt_phy_mode_11ac_vht20 = 8,
  13423. htt_phy_mode_11ac_vht40 = 9,
  13424. htt_phy_mode_11ac_vht80 = 10,
  13425. htt_phy_mode_11ac_vht20_2g = 11,
  13426. htt_phy_mode_11ac_vht40_2g = 12,
  13427. htt_phy_mode_11ac_vht80_2g = 13,
  13428. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13429. htt_phy_mode_11ac_vht160 = 15,
  13430. htt_phy_mode_max,
  13431. };
  13432. /**
  13433. * @brief target -> host HTT channel change indication
  13434. *
  13435. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13436. *
  13437. * @details
  13438. * Specify when a channel change occurs.
  13439. * This allows the host to precisely determine which rx frames arrived
  13440. * on the old channel and which rx frames arrived on the new channel.
  13441. *
  13442. *|31 |7 0 |
  13443. *|-------------------------------------------+----------|
  13444. *| reserved | msg type |
  13445. *|------------------------------------------------------|
  13446. *| primary_chan_center_freq_mhz |
  13447. *|------------------------------------------------------|
  13448. *| contiguous_chan1_center_freq_mhz |
  13449. *|------------------------------------------------------|
  13450. *| contiguous_chan2_center_freq_mhz |
  13451. *|------------------------------------------------------|
  13452. *| phy_mode |
  13453. *|------------------------------------------------------|
  13454. *
  13455. * Header fields:
  13456. * - MSG_TYPE
  13457. * Bits 7:0
  13458. * Purpose: identifies this as a htt channel change indication message
  13459. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13460. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13461. * Bits 31:0
  13462. * Purpose: identify the (center of the) new 20 MHz primary channel
  13463. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13464. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13465. * Bits 31:0
  13466. * Purpose: identify the (center of the) contiguous frequency range
  13467. * comprising the new channel.
  13468. * For example, if the new channel is a 80 MHz channel extending
  13469. * 60 MHz beyond the primary channel, this field would be 30 larger
  13470. * than the primary channel center frequency field.
  13471. * Value: center frequency of the contiguous frequency range comprising
  13472. * the full channel in MHz units
  13473. * (80+80 channels also use the CONTIG_CHAN2 field)
  13474. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13475. * Bits 31:0
  13476. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13477. * within a VHT 80+80 channel.
  13478. * This field is only relevant for VHT 80+80 channels.
  13479. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13480. * channel (arbitrary value for cases besides VHT 80+80)
  13481. * - PHY_MODE
  13482. * Bits 31:0
  13483. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13484. * and band
  13485. * Value: htt_phy_mode enum value
  13486. */
  13487. PREPACK struct htt_chan_change_t
  13488. {
  13489. /* DWORD 0: flags and meta-data */
  13490. A_UINT32
  13491. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13492. reserved1: 24;
  13493. A_UINT32 primary_chan_center_freq_mhz;
  13494. A_UINT32 contig_chan1_center_freq_mhz;
  13495. A_UINT32 contig_chan2_center_freq_mhz;
  13496. A_UINT32 phy_mode;
  13497. } POSTPACK;
  13498. /*
  13499. * Due to historical / backwards-compatibility reasons, maintain the
  13500. * below htt_chan_change_msg struct definition, which needs to be
  13501. * consistent with the above htt_chan_change_t struct definition
  13502. * (aside from the htt_chan_change_t definition including the msg_type
  13503. * dword within the message, and the htt_chan_change_msg only containing
  13504. * the payload of the message that follows the msg_type dword).
  13505. */
  13506. PREPACK struct htt_chan_change_msg {
  13507. A_UINT32 chan_mhz; /* frequency in mhz */
  13508. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13509. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13510. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13511. } POSTPACK;
  13512. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13513. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13514. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13515. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13516. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13517. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13518. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13519. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13520. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13521. do { \
  13522. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13523. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13524. } while (0)
  13525. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13526. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13527. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13528. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13529. do { \
  13530. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13531. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13532. } while (0)
  13533. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13534. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13535. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13536. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13537. do { \
  13538. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13539. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13540. } while (0)
  13541. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13542. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13543. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13544. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13545. do { \
  13546. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13547. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13548. } while (0)
  13549. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13550. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13551. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13552. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13553. /**
  13554. * @brief rx offload packet error message
  13555. *
  13556. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13557. *
  13558. * @details
  13559. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13560. * of target payload like mic err.
  13561. *
  13562. * |31 24|23 16|15 8|7 0|
  13563. * |----------------+----------------+----------------+----------------|
  13564. * | tid | vdev_id | msg_sub_type | msg_type |
  13565. * |-------------------------------------------------------------------|
  13566. * : (sub-type dependent content) :
  13567. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13568. * Header fields:
  13569. * - msg_type
  13570. * Bits 7:0
  13571. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13572. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13573. * - msg_sub_type
  13574. * Bits 15:8
  13575. * Purpose: Identifies which type of rx error is reported by this message
  13576. * value: htt_rx_ofld_pkt_err_type
  13577. * - vdev_id
  13578. * Bits 23:16
  13579. * Purpose: Identifies which vdev received the erroneous rx frame
  13580. * value:
  13581. * - tid
  13582. * Bits 31:24
  13583. * Purpose: Identifies the traffic type of the rx frame
  13584. * value:
  13585. *
  13586. * - The payload fields used if the sub-type == MIC error are shown below.
  13587. * Note - MIC err is per MSDU, while PN is per MPDU.
  13588. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13589. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13590. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13591. * instead of sending separate HTT messages for each wrong MSDU within
  13592. * the MPDU.
  13593. *
  13594. * |31 24|23 16|15 8|7 0|
  13595. * |----------------+----------------+----------------+----------------|
  13596. * | Rsvd | key_id | peer_id |
  13597. * |-------------------------------------------------------------------|
  13598. * | receiver MAC addr 31:0 |
  13599. * |-------------------------------------------------------------------|
  13600. * | Rsvd | receiver MAC addr 47:32 |
  13601. * |-------------------------------------------------------------------|
  13602. * | transmitter MAC addr 31:0 |
  13603. * |-------------------------------------------------------------------|
  13604. * | Rsvd | transmitter MAC addr 47:32 |
  13605. * |-------------------------------------------------------------------|
  13606. * | PN 31:0 |
  13607. * |-------------------------------------------------------------------|
  13608. * | Rsvd | PN 47:32 |
  13609. * |-------------------------------------------------------------------|
  13610. * - peer_id
  13611. * Bits 15:0
  13612. * Purpose: identifies which peer is frame is from
  13613. * value:
  13614. * - key_id
  13615. * Bits 23:16
  13616. * Purpose: identifies key_id of rx frame
  13617. * value:
  13618. * - RA_31_0 (receiver MAC addr 31:0)
  13619. * Bits 31:0
  13620. * Purpose: identifies by MAC address which vdev received the frame
  13621. * value: MAC address lower 4 bytes
  13622. * - RA_47_32 (receiver MAC addr 47:32)
  13623. * Bits 15:0
  13624. * Purpose: identifies by MAC address which vdev received the frame
  13625. * value: MAC address upper 2 bytes
  13626. * - TA_31_0 (transmitter MAC addr 31:0)
  13627. * Bits 31:0
  13628. * Purpose: identifies by MAC address which peer transmitted the frame
  13629. * value: MAC address lower 4 bytes
  13630. * - TA_47_32 (transmitter MAC addr 47:32)
  13631. * Bits 15:0
  13632. * Purpose: identifies by MAC address which peer transmitted the frame
  13633. * value: MAC address upper 2 bytes
  13634. * - PN_31_0
  13635. * Bits 31:0
  13636. * Purpose: Identifies pn of rx frame
  13637. * value: PN lower 4 bytes
  13638. * - PN_47_32
  13639. * Bits 15:0
  13640. * Purpose: Identifies pn of rx frame
  13641. * value:
  13642. * TKIP or CCMP: PN upper 2 bytes
  13643. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13644. */
  13645. enum htt_rx_ofld_pkt_err_type {
  13646. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13647. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13648. };
  13649. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13650. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13651. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13652. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13653. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13654. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13655. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13656. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13657. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13658. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13659. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13660. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13661. do { \
  13662. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13663. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13664. } while (0)
  13665. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13666. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13667. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13668. do { \
  13669. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13670. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13671. } while (0)
  13672. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13673. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13674. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13675. do { \
  13676. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13677. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13678. } while (0)
  13679. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13682. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13684. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13689. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13690. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13692. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13693. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13695. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13696. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13697. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13698. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13699. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13700. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13701. do { \
  13702. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13703. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13704. } while (0)
  13705. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13706. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13707. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13708. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13709. do { \
  13710. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13711. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13712. } while (0)
  13713. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13714. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13715. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13716. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13717. do { \
  13718. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13719. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13720. } while (0)
  13721. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13722. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13723. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13724. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13725. do { \
  13726. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13727. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13728. } while (0)
  13729. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13730. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13731. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13732. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13733. do { \
  13734. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13735. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13736. } while (0)
  13737. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13738. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13739. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13740. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13741. do { \
  13742. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13743. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13744. } while (0)
  13745. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13746. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13747. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13748. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13749. do { \
  13750. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13751. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13752. } while (0)
  13753. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13754. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13755. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13756. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13757. do { \
  13758. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13759. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13760. } while (0)
  13761. /**
  13762. * @brief target -> host peer rate report message
  13763. *
  13764. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13765. *
  13766. * @details
  13767. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13768. * justified rate of all the peers.
  13769. *
  13770. * |31 24|23 16|15 8|7 0|
  13771. * |----------------+----------------+----------------+----------------|
  13772. * | peer_count | | msg_type |
  13773. * |-------------------------------------------------------------------|
  13774. * : Payload (variant number of peer rate report) :
  13775. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13776. * Header fields:
  13777. * - msg_type
  13778. * Bits 7:0
  13779. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13780. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13781. * - reserved
  13782. * Bits 15:8
  13783. * Purpose:
  13784. * value:
  13785. * - peer_count
  13786. * Bits 31:16
  13787. * Purpose: Specify how many peer rate report elements are present in the payload.
  13788. * value:
  13789. *
  13790. * Payload:
  13791. * There are variant number of peer rate report follow the first 32 bits.
  13792. * The peer rate report is defined as follows.
  13793. *
  13794. * |31 20|19 16|15 0|
  13795. * |-----------------------+---------+---------------------------------|-
  13796. * | reserved | phy | peer_id | \
  13797. * |-------------------------------------------------------------------| -> report #0
  13798. * | rate | /
  13799. * |-----------------------+---------+---------------------------------|-
  13800. * | reserved | phy | peer_id | \
  13801. * |-------------------------------------------------------------------| -> report #1
  13802. * | rate | /
  13803. * |-----------------------+---------+---------------------------------|-
  13804. * | reserved | phy | peer_id | \
  13805. * |-------------------------------------------------------------------| -> report #2
  13806. * | rate | /
  13807. * |-------------------------------------------------------------------|-
  13808. * : :
  13809. * : :
  13810. * : :
  13811. * :-------------------------------------------------------------------:
  13812. *
  13813. * - peer_id
  13814. * Bits 15:0
  13815. * Purpose: identify the peer
  13816. * value:
  13817. * - phy
  13818. * Bits 19:16
  13819. * Purpose: identify which phy is in use
  13820. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13821. * Please see enum htt_peer_report_phy_type for detail.
  13822. * - reserved
  13823. * Bits 31:20
  13824. * Purpose:
  13825. * value:
  13826. * - rate
  13827. * Bits 31:0
  13828. * Purpose: represent the justified rate of the peer specified by peer_id
  13829. * value:
  13830. */
  13831. enum htt_peer_rate_report_phy_type {
  13832. HTT_PEER_RATE_REPORT_11B = 0,
  13833. HTT_PEER_RATE_REPORT_11A_G,
  13834. HTT_PEER_RATE_REPORT_11N,
  13835. HTT_PEER_RATE_REPORT_11AC,
  13836. };
  13837. #define HTT_PEER_RATE_REPORT_SIZE 8
  13838. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13839. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13840. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13841. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13842. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13843. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13844. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13845. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13846. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13847. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13848. do { \
  13849. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13850. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13851. } while (0)
  13852. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13853. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13854. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13855. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13856. do { \
  13857. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13858. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13859. } while (0)
  13860. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13861. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13862. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13863. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13864. do { \
  13865. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13866. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13867. } while (0)
  13868. /**
  13869. * @brief target -> host flow pool map message
  13870. *
  13871. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13872. *
  13873. * @details
  13874. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13875. * a flow of descriptors.
  13876. *
  13877. * This message is in TLV format and indicates the parameters to be setup a
  13878. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13879. * receive descriptors from a specified pool.
  13880. *
  13881. * The message would appear as follows:
  13882. *
  13883. * |31 24|23 16|15 8|7 0|
  13884. * |----------------+----------------+----------------+----------------|
  13885. * header | reserved | num_flows | msg_type |
  13886. * |-------------------------------------------------------------------|
  13887. * | |
  13888. * : payload :
  13889. * | |
  13890. * |-------------------------------------------------------------------|
  13891. *
  13892. * The header field is one DWORD long and is interpreted as follows:
  13893. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13894. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13895. * this message
  13896. * b'16-31 - reserved: These bits are reserved for future use
  13897. *
  13898. * Payload:
  13899. * The payload would contain multiple objects of the following structure. Each
  13900. * object represents a flow.
  13901. *
  13902. * |31 24|23 16|15 8|7 0|
  13903. * |----------------+----------------+----------------+----------------|
  13904. * header | reserved | num_flows | msg_type |
  13905. * |-------------------------------------------------------------------|
  13906. * payload0| flow_type |
  13907. * |-------------------------------------------------------------------|
  13908. * | flow_id |
  13909. * |-------------------------------------------------------------------|
  13910. * | reserved0 | flow_pool_id |
  13911. * |-------------------------------------------------------------------|
  13912. * | reserved1 | flow_pool_size |
  13913. * |-------------------------------------------------------------------|
  13914. * | reserved2 |
  13915. * |-------------------------------------------------------------------|
  13916. * payload1| flow_type |
  13917. * |-------------------------------------------------------------------|
  13918. * | flow_id |
  13919. * |-------------------------------------------------------------------|
  13920. * | reserved0 | flow_pool_id |
  13921. * |-------------------------------------------------------------------|
  13922. * | reserved1 | flow_pool_size |
  13923. * |-------------------------------------------------------------------|
  13924. * | reserved2 |
  13925. * |-------------------------------------------------------------------|
  13926. * | . |
  13927. * | . |
  13928. * | . |
  13929. * |-------------------------------------------------------------------|
  13930. *
  13931. * Each payload is 5 DWORDS long and is interpreted as follows:
  13932. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13933. * this flow is associated. It can be VDEV, peer,
  13934. * or tid (AC). Based on enum htt_flow_type.
  13935. *
  13936. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13937. * object. For flow_type vdev it is set to the
  13938. * vdevid, for peer it is peerid and for tid, it is
  13939. * tid_num.
  13940. *
  13941. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13942. * in the host for this flow
  13943. * b'16:31 - reserved0: This field in reserved for the future. In case
  13944. * we have a hierarchical implementation (HCM) of
  13945. * pools, it can be used to indicate the ID of the
  13946. * parent-pool.
  13947. *
  13948. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13949. * Descriptors for this flow will be
  13950. * allocated from this pool in the host.
  13951. * b'16:31 - reserved1: This field in reserved for the future. In case
  13952. * we have a hierarchical implementation of pools,
  13953. * it can be used to indicate the max number of
  13954. * descriptors in the pool. The b'0:15 can be used
  13955. * to indicate min number of descriptors in the
  13956. * HCM scheme.
  13957. *
  13958. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13959. * we have a hierarchical implementation of pools,
  13960. * b'0:15 can be used to indicate the
  13961. * priority-based borrowing (PBB) threshold of
  13962. * the flow's pool. The b'16:31 are still left
  13963. * reserved.
  13964. */
  13965. enum htt_flow_type {
  13966. FLOW_TYPE_VDEV = 0,
  13967. /* Insert new flow types above this line */
  13968. };
  13969. PREPACK struct htt_flow_pool_map_payload_t {
  13970. A_UINT32 flow_type;
  13971. A_UINT32 flow_id;
  13972. A_UINT32 flow_pool_id:16,
  13973. reserved0:16;
  13974. A_UINT32 flow_pool_size:16,
  13975. reserved1:16;
  13976. A_UINT32 reserved2;
  13977. } POSTPACK;
  13978. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13979. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13980. (sizeof(struct htt_flow_pool_map_payload_t))
  13981. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13982. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13983. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13984. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13985. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13986. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13987. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13988. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13989. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13990. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13991. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13992. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13993. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13994. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13995. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13996. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13997. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13998. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13999. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14000. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14001. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14002. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14003. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14004. do { \
  14005. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14006. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14007. } while (0)
  14008. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14009. do { \
  14010. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14011. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14012. } while (0)
  14013. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14014. do { \
  14015. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14016. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14017. } while (0)
  14018. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14019. do { \
  14020. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14021. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14022. } while (0)
  14023. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14024. do { \
  14025. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14026. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14027. } while (0)
  14028. /**
  14029. * @brief target -> host flow pool unmap message
  14030. *
  14031. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14032. *
  14033. * @details
  14034. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14035. * down a flow of descriptors.
  14036. * This message indicates that for the flow (whose ID is provided) is wanting
  14037. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14038. * pool of descriptors from where descriptors are being allocated for this
  14039. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14040. * be unmapped by the host.
  14041. *
  14042. * The message would appear as follows:
  14043. *
  14044. * |31 24|23 16|15 8|7 0|
  14045. * |----------------+----------------+----------------+----------------|
  14046. * | reserved0 | msg_type |
  14047. * |-------------------------------------------------------------------|
  14048. * | flow_type |
  14049. * |-------------------------------------------------------------------|
  14050. * | flow_id |
  14051. * |-------------------------------------------------------------------|
  14052. * | reserved1 | flow_pool_id |
  14053. * |-------------------------------------------------------------------|
  14054. *
  14055. * The message is interpreted as follows:
  14056. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14057. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14058. * b'8:31 - reserved0: Reserved for future use
  14059. *
  14060. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14061. * this flow is associated. It can be VDEV, peer,
  14062. * or tid (AC). Based on enum htt_flow_type.
  14063. *
  14064. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14065. * object. For flow_type vdev it is set to the
  14066. * vdevid, for peer it is peerid and for tid, it is
  14067. * tid_num.
  14068. *
  14069. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14070. * used in the host for this flow
  14071. * b'16:31 - reserved0: This field in reserved for the future.
  14072. *
  14073. */
  14074. PREPACK struct htt_flow_pool_unmap_t {
  14075. A_UINT32 msg_type:8,
  14076. reserved0:24;
  14077. A_UINT32 flow_type;
  14078. A_UINT32 flow_id;
  14079. A_UINT32 flow_pool_id:16,
  14080. reserved1:16;
  14081. } POSTPACK;
  14082. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14083. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14084. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14085. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14086. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14087. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14088. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14089. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14090. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14091. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14092. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14093. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14094. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14095. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14096. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14097. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14098. do { \
  14099. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14100. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14101. } while (0)
  14102. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14103. do { \
  14104. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14105. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14106. } while (0)
  14107. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14108. do { \
  14109. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14110. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14111. } while (0)
  14112. /**
  14113. * @brief target -> host SRING setup done message
  14114. *
  14115. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14116. *
  14117. * @details
  14118. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14119. * SRNG ring setup is done
  14120. *
  14121. * This message indicates whether the last setup operation is successful.
  14122. * It will be sent to host when host set respose_required bit in
  14123. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14124. * The message would appear as follows:
  14125. *
  14126. * |31 24|23 16|15 8|7 0|
  14127. * |--------------- +----------------+----------------+----------------|
  14128. * | setup_status | ring_id | pdev_id | msg_type |
  14129. * |-------------------------------------------------------------------|
  14130. *
  14131. * The message is interpreted as follows:
  14132. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14133. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14134. * b'8:15 - pdev_id:
  14135. * 0 (for rings at SOC/UMAC level),
  14136. * 1/2/3 mac id (for rings at LMAC level)
  14137. * b'16:23 - ring_id: Identify the ring which is set up
  14138. * More details can be got from enum htt_srng_ring_id
  14139. * b'24:31 - setup_status: Indicate status of setup operation
  14140. * Refer to htt_ring_setup_status
  14141. */
  14142. PREPACK struct htt_sring_setup_done_t {
  14143. A_UINT32 msg_type: 8,
  14144. pdev_id: 8,
  14145. ring_id: 8,
  14146. setup_status: 8;
  14147. } POSTPACK;
  14148. enum htt_ring_setup_status {
  14149. htt_ring_setup_status_ok = 0,
  14150. htt_ring_setup_status_error,
  14151. };
  14152. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14153. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14154. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14155. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14156. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14157. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14158. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14159. do { \
  14160. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14161. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14162. } while (0)
  14163. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14164. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14165. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14166. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14167. HTT_SRING_SETUP_DONE_RING_ID_S)
  14168. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14169. do { \
  14170. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14171. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14172. } while (0)
  14173. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14174. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14175. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14176. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14177. HTT_SRING_SETUP_DONE_STATUS_S)
  14178. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14179. do { \
  14180. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14181. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14182. } while (0)
  14183. /**
  14184. * @brief target -> flow map flow info
  14185. *
  14186. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14187. *
  14188. * @details
  14189. * HTT TX map flow entry with tqm flow pointer
  14190. * Sent from firmware to host to add tqm flow pointer in corresponding
  14191. * flow search entry. Flow metadata is replayed back to host as part of this
  14192. * struct to enable host to find the specific flow search entry
  14193. *
  14194. * The message would appear as follows:
  14195. *
  14196. * |31 28|27 18|17 14|13 8|7 0|
  14197. * |-------+------------------------------------------+----------------|
  14198. * | rsvd0 | fse_hsh_idx | msg_type |
  14199. * |-------------------------------------------------------------------|
  14200. * | rsvd1 | tid | peer_id |
  14201. * |-------------------------------------------------------------------|
  14202. * | tqm_flow_pntr_lo |
  14203. * |-------------------------------------------------------------------|
  14204. * | tqm_flow_pntr_hi |
  14205. * |-------------------------------------------------------------------|
  14206. * | fse_meta_data |
  14207. * |-------------------------------------------------------------------|
  14208. *
  14209. * The message is interpreted as follows:
  14210. *
  14211. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14212. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14213. *
  14214. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14215. * for this flow entry
  14216. *
  14217. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14218. *
  14219. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14220. *
  14221. * dword1 - b'14:17 - tid
  14222. *
  14223. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14224. *
  14225. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14226. *
  14227. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14228. *
  14229. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14230. * given by host
  14231. */
  14232. PREPACK struct htt_tx_map_flow_info {
  14233. A_UINT32
  14234. msg_type: 8,
  14235. fse_hsh_idx: 20,
  14236. rsvd0: 4;
  14237. A_UINT32
  14238. peer_id: 14,
  14239. tid: 4,
  14240. rsvd1: 14;
  14241. A_UINT32 tqm_flow_pntr_lo;
  14242. A_UINT32 tqm_flow_pntr_hi;
  14243. struct htt_tx_flow_metadata fse_meta_data;
  14244. } POSTPACK;
  14245. /* DWORD 0 */
  14246. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14247. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14248. /* DWORD 1 */
  14249. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14250. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14251. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14252. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14253. /* DWORD 0 */
  14254. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14255. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14256. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14257. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14258. do { \
  14259. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14260. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14261. } while (0)
  14262. /* DWORD 1 */
  14263. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14264. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14265. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14266. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14267. do { \
  14268. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14269. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14270. } while (0)
  14271. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14272. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14273. HTT_TX_MAP_FLOW_INFO_TID_S)
  14274. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14275. do { \
  14276. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14277. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14278. } while (0)
  14279. /*
  14280. * htt_dbg_ext_stats_status -
  14281. * present - The requested stats have been delivered in full.
  14282. * This indicates that either the stats information was contained
  14283. * in its entirety within this message, or else this message
  14284. * completes the delivery of the requested stats info that was
  14285. * partially delivered through earlier STATS_CONF messages.
  14286. * partial - The requested stats have been delivered in part.
  14287. * One or more subsequent STATS_CONF messages with the same
  14288. * cookie value will be sent to deliver the remainder of the
  14289. * information.
  14290. * error - The requested stats could not be delivered, for example due
  14291. * to a shortage of memory to construct a message holding the
  14292. * requested stats.
  14293. * invalid - The requested stat type is either not recognized, or the
  14294. * target is configured to not gather the stats type in question.
  14295. */
  14296. enum htt_dbg_ext_stats_status {
  14297. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14298. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14299. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14300. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14301. };
  14302. /**
  14303. * @brief target -> host ppdu stats upload
  14304. *
  14305. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14306. *
  14307. * @details
  14308. * The following field definitions describe the format of the HTT target
  14309. * to host ppdu stats indication message.
  14310. *
  14311. *
  14312. * |31 16|15 12|11 10|9 8|7 0 |
  14313. * |----------------------------------------------------------------------|
  14314. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14315. * |----------------------------------------------------------------------|
  14316. * | ppdu_id |
  14317. * |----------------------------------------------------------------------|
  14318. * | Timestamp in us |
  14319. * |----------------------------------------------------------------------|
  14320. * | reserved |
  14321. * |----------------------------------------------------------------------|
  14322. * | type-specific stats info |
  14323. * | (see htt_ppdu_stats.h) |
  14324. * |----------------------------------------------------------------------|
  14325. * Header fields:
  14326. * - MSG_TYPE
  14327. * Bits 7:0
  14328. * Purpose: Identifies this is a PPDU STATS indication
  14329. * message.
  14330. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14331. * - mac_id
  14332. * Bits 9:8
  14333. * Purpose: mac_id of this ppdu_id
  14334. * Value: 0-3
  14335. * - pdev_id
  14336. * Bits 11:10
  14337. * Purpose: pdev_id of this ppdu_id
  14338. * Value: 0-3
  14339. * 0 (for rings at SOC level),
  14340. * 1/2/3 PDEV -> 0/1/2
  14341. * - payload_size
  14342. * Bits 31:16
  14343. * Purpose: total tlv size
  14344. * Value: payload_size in bytes
  14345. */
  14346. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14347. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14348. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14349. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14350. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14351. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14352. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14353. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14354. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14355. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14356. do { \
  14357. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14358. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14359. } while (0)
  14360. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14361. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14362. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14363. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14364. do { \
  14365. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14366. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14367. } while (0)
  14368. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14369. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14370. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14371. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14372. do { \
  14373. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14374. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14375. } while (0)
  14376. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14377. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14378. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14379. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14380. do { \
  14381. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14382. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14383. } while (0)
  14384. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14385. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14386. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14387. /* htt_t2h_ppdu_stats_ind_hdr_t
  14388. * This struct contains the fields within the header of the
  14389. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14390. * stats info.
  14391. * This struct assumes little-endian layout, and thus is only
  14392. * suitable for use within processors known to be little-endian
  14393. * (such as the target).
  14394. * In contrast, the above macros provide endian-portable methods
  14395. * to get and set the bitfields within this PPDU_STATS_IND header.
  14396. */
  14397. typedef struct {
  14398. A_UINT32 msg_type: 8, /* bits 7:0 */
  14399. mac_id: 2, /* bits 9:8 */
  14400. pdev_id: 2, /* bits 11:10 */
  14401. reserved1: 4, /* bits 15:12 */
  14402. payload_size: 16; /* bits 31:16 */
  14403. A_UINT32 ppdu_id;
  14404. A_UINT32 timestamp_us;
  14405. A_UINT32 reserved2;
  14406. } htt_t2h_ppdu_stats_ind_hdr_t;
  14407. /**
  14408. * @brief target -> host extended statistics upload
  14409. *
  14410. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14411. *
  14412. * @details
  14413. * The following field definitions describe the format of the HTT target
  14414. * to host stats upload confirmation message.
  14415. * The message contains a cookie echoed from the HTT host->target stats
  14416. * upload request, which identifies which request the confirmation is
  14417. * for, and a single stats can span over multiple HTT stats indication
  14418. * due to the HTT message size limitation so every HTT ext stats indication
  14419. * will have tag-length-value stats information elements.
  14420. * The tag-length header for each HTT stats IND message also includes a
  14421. * status field, to indicate whether the request for the stat type in
  14422. * question was fully met, partially met, unable to be met, or invalid
  14423. * (if the stat type in question is disabled in the target).
  14424. * A Done bit 1's indicate the end of the of stats info elements.
  14425. *
  14426. *
  14427. * |31 16|15 12|11|10 8|7 5|4 0|
  14428. * |--------------------------------------------------------------|
  14429. * | reserved | msg type |
  14430. * |--------------------------------------------------------------|
  14431. * | cookie LSBs |
  14432. * |--------------------------------------------------------------|
  14433. * | cookie MSBs |
  14434. * |--------------------------------------------------------------|
  14435. * | stats entry length | rsvd | D| S | stat type |
  14436. * |--------------------------------------------------------------|
  14437. * | type-specific stats info |
  14438. * | (see htt_stats.h) |
  14439. * |--------------------------------------------------------------|
  14440. * Header fields:
  14441. * - MSG_TYPE
  14442. * Bits 7:0
  14443. * Purpose: Identifies this is a extended statistics upload confirmation
  14444. * message.
  14445. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14446. * - COOKIE_LSBS
  14447. * Bits 31:0
  14448. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14449. * message with its preceding host->target stats request message.
  14450. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14451. * - COOKIE_MSBS
  14452. * Bits 31:0
  14453. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14454. * message with its preceding host->target stats request message.
  14455. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14456. *
  14457. * Stats Information Element tag-length header fields:
  14458. * - STAT_TYPE
  14459. * Bits 7:0
  14460. * Purpose: identifies the type of statistics info held in the
  14461. * following information element
  14462. * Value: htt_dbg_ext_stats_type
  14463. * - STATUS
  14464. * Bits 10:8
  14465. * Purpose: indicate whether the requested stats are present
  14466. * Value: htt_dbg_ext_stats_status
  14467. * - DONE
  14468. * Bits 11
  14469. * Purpose:
  14470. * Indicates the completion of the stats entry, this will be the last
  14471. * stats conf HTT segment for the requested stats type.
  14472. * Value:
  14473. * 0 -> the stats retrieval is ongoing
  14474. * 1 -> the stats retrieval is complete
  14475. * - LENGTH
  14476. * Bits 31:16
  14477. * Purpose: indicate the stats information size
  14478. * Value: This field specifies the number of bytes of stats information
  14479. * that follows the element tag-length header.
  14480. * It is expected but not required that this length is a multiple of
  14481. * 4 bytes.
  14482. */
  14483. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14484. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14485. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14486. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14487. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14488. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14489. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14490. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14491. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14492. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14493. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14494. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14495. do { \
  14496. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14497. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14498. } while (0)
  14499. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14500. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14501. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14502. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14503. do { \
  14504. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14505. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14506. } while (0)
  14507. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14508. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14509. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14510. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14511. do { \
  14512. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14513. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14514. } while (0)
  14515. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14516. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14517. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14518. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14519. do { \
  14520. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14521. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14522. } while (0)
  14523. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14524. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14525. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14526. /**
  14527. * @brief target -> host streaming statistics upload
  14528. *
  14529. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14530. *
  14531. * @details
  14532. * The following field definitions describe the format of the HTT target
  14533. * to host streaming stats upload indication message.
  14534. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14535. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14536. * use the STREAMING_STATS_REQ message to halt the target's production of
  14537. * STREAMING_STATS_IND messages.
  14538. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14539. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14540. *
  14541. * |31 8|7 0|
  14542. * |--------------------------------------------------------------|
  14543. * | reserved | msg type |
  14544. * |--------------------------------------------------------------|
  14545. * | type-specific stats info |
  14546. * | (see htt_stats.h) |
  14547. * |--------------------------------------------------------------|
  14548. * Header fields:
  14549. * - MSG_TYPE
  14550. * Bits 7:0
  14551. * Purpose: Identifies this as a streaming statistics upload indication
  14552. * message.
  14553. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14554. */
  14555. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14556. typedef enum {
  14557. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14558. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14559. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14560. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14561. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14562. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14563. /* Reserved from 128 - 255 for target internal use.*/
  14564. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14565. } HTT_PEER_TYPE;
  14566. /** macro to convert MAC address from char array to HTT word format */
  14567. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14568. (phtt_mac_addr)->mac_addr31to0 = \
  14569. (((c_macaddr)[0] << 0) | \
  14570. ((c_macaddr)[1] << 8) | \
  14571. ((c_macaddr)[2] << 16) | \
  14572. ((c_macaddr)[3] << 24)); \
  14573. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14574. } while (0)
  14575. /**
  14576. * @brief target -> host monitor mac header indication message
  14577. *
  14578. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14579. *
  14580. * @details
  14581. * The following diagram shows the format of the monitor mac header message
  14582. * sent from the target to the host.
  14583. * This message is primarily sent when promiscuous rx mode is enabled.
  14584. * One message is sent per rx PPDU.
  14585. *
  14586. * |31 24|23 16|15 8|7 0|
  14587. * |-------------------------------------------------------------|
  14588. * | peer_id | reserved0 | msg_type |
  14589. * |-------------------------------------------------------------|
  14590. * | reserved1 | num_mpdu |
  14591. * |-------------------------------------------------------------|
  14592. * | struct hw_rx_desc |
  14593. * | (see wal_rx_desc.h) |
  14594. * |-------------------------------------------------------------|
  14595. * | struct ieee80211_frame_addr4 |
  14596. * | (see ieee80211_defs.h) |
  14597. * |-------------------------------------------------------------|
  14598. * | struct ieee80211_frame_addr4 |
  14599. * | (see ieee80211_defs.h) |
  14600. * |-------------------------------------------------------------|
  14601. * | ...... |
  14602. * |-------------------------------------------------------------|
  14603. *
  14604. * Header fields:
  14605. * - msg_type
  14606. * Bits 7:0
  14607. * Purpose: Identifies this is a monitor mac header indication message.
  14608. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14609. * - peer_id
  14610. * Bits 31:16
  14611. * Purpose: Software peer id given by host during association,
  14612. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14613. * for rx PPDUs received from unassociated peers.
  14614. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14615. * - num_mpdu
  14616. * Bits 15:0
  14617. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14618. * delivered within the message.
  14619. * Value: 1 to 32
  14620. * num_mpdu is limited to a maximum value of 32, due to buffer
  14621. * size limits. For PPDUs with more than 32 MPDUs, only the
  14622. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14623. * the PPDU will be provided.
  14624. */
  14625. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14626. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14627. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14628. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14629. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14630. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14631. do { \
  14632. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14633. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14634. } while (0)
  14635. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14636. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14637. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14638. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14639. do { \
  14640. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14641. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14642. } while (0)
  14643. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14644. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14645. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14646. /**
  14647. * @brief target -> host flow pool resize Message
  14648. *
  14649. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14650. *
  14651. * @details
  14652. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14653. * the flow pool associated with the specified ID is resized
  14654. *
  14655. * The message would appear as follows:
  14656. *
  14657. * |31 16|15 8|7 0|
  14658. * |---------------------------------+----------------+----------------|
  14659. * | reserved0 | Msg type |
  14660. * |-------------------------------------------------------------------|
  14661. * | flow pool new size | flow pool ID |
  14662. * |-------------------------------------------------------------------|
  14663. *
  14664. * The message is interpreted as follows:
  14665. * b'0:7 - msg_type: This will be set to 0x21
  14666. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14667. *
  14668. * b'0:15 - flow pool ID: Existing flow pool ID
  14669. *
  14670. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14671. *
  14672. */
  14673. PREPACK struct htt_flow_pool_resize_t {
  14674. A_UINT32 msg_type:8,
  14675. reserved0:24;
  14676. A_UINT32 flow_pool_id:16,
  14677. flow_pool_new_size:16;
  14678. } POSTPACK;
  14679. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14680. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14681. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14682. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14683. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14684. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14685. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14686. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14687. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14688. do { \
  14689. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14690. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14691. } while (0)
  14692. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14693. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14694. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14695. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14696. do { \
  14697. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14698. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14699. } while (0)
  14700. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14701. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14702. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14703. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14704. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14705. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14706. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14707. /*
  14708. * The read and write indices point to the data within the host buffer.
  14709. * Because the first 4 bytes of the host buffer is used for the read index and
  14710. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14711. * The read index and write index are the byte offsets from the base of the
  14712. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14713. * Refer the ASCII text picture below.
  14714. */
  14715. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14716. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14717. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14718. /*
  14719. ***************************************************************************
  14720. *
  14721. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14722. *
  14723. ***************************************************************************
  14724. *
  14725. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14726. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14727. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14728. * written into the Host memory region mentioned below.
  14729. *
  14730. * Read index is updated by the Host. At any point of time, the read index will
  14731. * indicate the index that will next be read by the Host. The read index is
  14732. * in units of bytes offset from the base of the meta-data buffer.
  14733. *
  14734. * Write index is updated by the FW. At any point of time, the write index will
  14735. * indicate from where the FW can start writing any new data. The write index is
  14736. * in units of bytes offset from the base of the meta-data buffer.
  14737. *
  14738. * If the Host is not fast enough in reading the CFR data, any new capture data
  14739. * would be dropped if there is no space left to write the new captures.
  14740. *
  14741. * The last 4 bytes of the memory region will have the magic pattern
  14742. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14743. * not overrun the host buffer.
  14744. *
  14745. * ,--------------------. read and write indices store the
  14746. * | | byte offset from the base of the
  14747. * | ,--------+--------. meta-data buffer to the next
  14748. * | | | | location within the data buffer
  14749. * | | v v that will be read / written
  14750. * ************************************************************************
  14751. * * Read * Write * * Magic *
  14752. * * index * index * CFR data1 ...... CFR data N * pattern *
  14753. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14754. * ************************************************************************
  14755. * |<---------- data buffer ---------->|
  14756. *
  14757. * |<----------------- meta-data buffer allocated in Host ----------------|
  14758. *
  14759. * Note:
  14760. * - Considering the 4 bytes needed to store the Read index (R) and the
  14761. * Write index (W), the initial value is as follows:
  14762. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14763. * - Buffer empty condition:
  14764. * R = W
  14765. *
  14766. * Regarding CFR data format:
  14767. * --------------------------
  14768. *
  14769. * Each CFR tone is stored in HW as 16-bits with the following format:
  14770. * {bits[15:12], bits[11:6], bits[5:0]} =
  14771. * {unsigned exponent (4 bits),
  14772. * signed mantissa_real (6 bits),
  14773. * signed mantissa_imag (6 bits)}
  14774. *
  14775. * CFR_real = mantissa_real * 2^(exponent-5)
  14776. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14777. *
  14778. *
  14779. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14780. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14781. *
  14782. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14783. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14784. * .
  14785. * .
  14786. * .
  14787. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14788. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14789. */
  14790. /* Bandwidth of peer CFR captures */
  14791. typedef enum {
  14792. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14793. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14794. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14795. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14796. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14797. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14798. } HTT_PEER_CFR_CAPTURE_BW;
  14799. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14800. * was captured
  14801. */
  14802. typedef enum {
  14803. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14804. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14805. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14806. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14807. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14808. } HTT_PEER_CFR_CAPTURE_MODE;
  14809. typedef enum {
  14810. /* This message type is currently used for the below purpose:
  14811. *
  14812. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14813. * wmi_peer_cfr_capture_cmd.
  14814. * If payload_present bit is set to 0 then the associated memory region
  14815. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14816. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14817. * message; the CFR dump will be present at the end of the message,
  14818. * after the chan_phy_mode.
  14819. */
  14820. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14821. /* Always keep this last */
  14822. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14823. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14824. /**
  14825. * @brief target -> host CFR dump completion indication message definition
  14826. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14827. *
  14828. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14829. *
  14830. * @details
  14831. * The following diagram shows the format of the Channel Frequency Response
  14832. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14833. * the channel capture of a peer is copied by Firmware into the Host memory
  14834. *
  14835. * **************************************************************************
  14836. *
  14837. * Message format when the CFR capture message type is
  14838. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14839. *
  14840. * **************************************************************************
  14841. *
  14842. * |31 16|15 |8|7 0|
  14843. * |----------------------------------------------------------------|
  14844. * header: | reserved |P| msg_type |
  14845. * word 0 | | | |
  14846. * |----------------------------------------------------------------|
  14847. * payload: | cfr_capture_msg_type |
  14848. * word 1 | |
  14849. * |----------------------------------------------------------------|
  14850. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14851. * word 2 | | | | | | | | |
  14852. * |----------------------------------------------------------------|
  14853. * | mac_addr31to0 |
  14854. * word 3 | |
  14855. * |----------------------------------------------------------------|
  14856. * | unused / reserved | mac_addr47to32 |
  14857. * word 4 | | |
  14858. * |----------------------------------------------------------------|
  14859. * | index |
  14860. * word 5 | |
  14861. * |----------------------------------------------------------------|
  14862. * | length |
  14863. * word 6 | |
  14864. * |----------------------------------------------------------------|
  14865. * | timestamp |
  14866. * word 7 | |
  14867. * |----------------------------------------------------------------|
  14868. * | counter |
  14869. * word 8 | |
  14870. * |----------------------------------------------------------------|
  14871. * | chan_mhz |
  14872. * word 9 | |
  14873. * |----------------------------------------------------------------|
  14874. * | band_center_freq1 |
  14875. * word 10 | |
  14876. * |----------------------------------------------------------------|
  14877. * | band_center_freq2 |
  14878. * word 11 | |
  14879. * |----------------------------------------------------------------|
  14880. * | chan_phy_mode |
  14881. * word 12 | |
  14882. * |----------------------------------------------------------------|
  14883. * where,
  14884. * P - payload present bit (payload_present explained below)
  14885. * req_id - memory request id (mem_req_id explained below)
  14886. * S - status field (status explained below)
  14887. * capbw - capture bandwidth (capture_bw explained below)
  14888. * mode - mode of capture (mode explained below)
  14889. * sts - space time streams (sts_count explained below)
  14890. * chbw - channel bandwidth (channel_bw explained below)
  14891. * captype - capture type (cap_type explained below)
  14892. *
  14893. * The following field definitions describe the format of the CFR dump
  14894. * completion indication sent from the target to the host
  14895. *
  14896. * Header fields:
  14897. *
  14898. * Word 0
  14899. * - msg_type
  14900. * Bits 7:0
  14901. * Purpose: Identifies this as CFR TX completion indication
  14902. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14903. * - payload_present
  14904. * Bit 8
  14905. * Purpose: Identifies how CFR data is sent to host
  14906. * Value: 0 - If CFR Payload is written to host memory
  14907. * 1 - If CFR Payload is sent as part of HTT message
  14908. * (This is the requirement for SDIO/USB where it is
  14909. * not possible to write CFR data to host memory)
  14910. * - reserved
  14911. * Bits 31:9
  14912. * Purpose: Reserved
  14913. * Value: 0
  14914. *
  14915. * Payload fields:
  14916. *
  14917. * Word 1
  14918. * - cfr_capture_msg_type
  14919. * Bits 31:0
  14920. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14921. * to specify the format used for the remainder of the message
  14922. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14923. * (currently only MSG_TYPE_1 is defined)
  14924. *
  14925. * Word 2
  14926. * - mem_req_id
  14927. * Bits 6:0
  14928. * Purpose: Contain the mem request id of the region where the CFR capture
  14929. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14930. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14931. this value is invalid)
  14932. * - status
  14933. * Bit 7
  14934. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14935. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14936. * - capture_bw
  14937. * Bits 10:8
  14938. * Purpose: Carry the bandwidth of the CFR capture
  14939. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14940. * - mode
  14941. * Bits 13:11
  14942. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14943. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14944. * - sts_count
  14945. * Bits 16:14
  14946. * Purpose: Carry the number of space time streams
  14947. * Value: Number of space time streams
  14948. * - channel_bw
  14949. * Bits 19:17
  14950. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14951. * measurement
  14952. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14953. * - cap_type
  14954. * Bits 23:20
  14955. * Purpose: Carry the type of the capture
  14956. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14957. * - vdev_id
  14958. * Bits 31:24
  14959. * Purpose: Carry the virtual device id
  14960. * Value: vdev ID
  14961. *
  14962. * Word 3
  14963. * - mac_addr31to0
  14964. * Bits 31:0
  14965. * Purpose: Contain the bits 31:0 of the peer MAC address
  14966. * Value: Bits 31:0 of the peer MAC address
  14967. *
  14968. * Word 4
  14969. * - mac_addr47to32
  14970. * Bits 15:0
  14971. * Purpose: Contain the bits 47:32 of the peer MAC address
  14972. * Value: Bits 47:32 of the peer MAC address
  14973. *
  14974. * Word 5
  14975. * - index
  14976. * Bits 31:0
  14977. * Purpose: Contain the index at which this CFR dump was written in the Host
  14978. * allocated memory. This index is the number of bytes from the base address.
  14979. * Value: Index position
  14980. *
  14981. * Word 6
  14982. * - length
  14983. * Bits 31:0
  14984. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14985. * Value: Length of the CFR capture of the peer
  14986. *
  14987. * Word 7
  14988. * - timestamp
  14989. * Bits 31:0
  14990. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14991. * clock used for this timestamp is private to the target and not visible to
  14992. * the host i.e., Host can interpret only the relative timestamp deltas from
  14993. * one message to the next, but can't interpret the absolute timestamp from a
  14994. * single message.
  14995. * Value: Timestamp in microseconds
  14996. *
  14997. * Word 8
  14998. * - counter
  14999. * Bits 31:0
  15000. * Purpose: Carry the count of the current CFR capture from FW. This is
  15001. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15002. * in host memory)
  15003. * Value: Count of the current CFR capture
  15004. *
  15005. * Word 9
  15006. * - chan_mhz
  15007. * Bits 31:0
  15008. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15009. * Value: Primary 20 channel frequency
  15010. *
  15011. * Word 10
  15012. * - band_center_freq1
  15013. * Bits 31:0
  15014. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15015. * Value: Center frequency 1 in MHz
  15016. *
  15017. * Word 11
  15018. * - band_center_freq2
  15019. * Bits 31:0
  15020. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15021. * the VDEV
  15022. * 80plus80 mode
  15023. * Value: Center frequency 2 in MHz
  15024. *
  15025. * Word 12
  15026. * - chan_phy_mode
  15027. * Bits 31:0
  15028. * Purpose: Carry the phy mode of the channel, of the VDEV
  15029. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15030. */
  15031. PREPACK struct htt_cfr_dump_ind_type_1 {
  15032. A_UINT32 mem_req_id:7,
  15033. status:1,
  15034. capture_bw:3,
  15035. mode:3,
  15036. sts_count:3,
  15037. channel_bw:3,
  15038. cap_type:4,
  15039. vdev_id:8;
  15040. htt_mac_addr addr;
  15041. A_UINT32 index;
  15042. A_UINT32 length;
  15043. A_UINT32 timestamp;
  15044. A_UINT32 counter;
  15045. struct htt_chan_change_msg chan;
  15046. } POSTPACK;
  15047. PREPACK struct htt_cfr_dump_compl_ind {
  15048. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15049. union {
  15050. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15051. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15052. /* If there is a need to change the memory layout and its associated
  15053. * HTT indication format, a new CFR capture message type can be
  15054. * introduced and added into this union.
  15055. */
  15056. };
  15057. } POSTPACK;
  15058. /*
  15059. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15060. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15061. */
  15062. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15063. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15064. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15065. do { \
  15066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15067. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15068. } while(0)
  15069. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15070. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15071. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15072. /*
  15073. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15074. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15075. */
  15076. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15077. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15078. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15079. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15080. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15081. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15082. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15083. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15084. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15085. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15086. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15087. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15088. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15089. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15090. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15091. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15092. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15093. do { \
  15094. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15095. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15096. } while (0)
  15097. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15098. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15099. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15100. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15101. do { \
  15102. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15103. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15104. } while (0)
  15105. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15106. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15107. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15108. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15109. do { \
  15110. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15111. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15112. } while (0)
  15113. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15114. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15115. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15116. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15117. do { \
  15118. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15119. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15120. } while (0)
  15121. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15122. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15123. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15124. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15125. do { \
  15126. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15127. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15128. } while (0)
  15129. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15130. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15131. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15132. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15133. do { \
  15134. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15135. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15136. } while (0)
  15137. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15138. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15139. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15140. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15141. do { \
  15142. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15143. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15144. } while (0)
  15145. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15146. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15147. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15148. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15149. do { \
  15150. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15151. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15152. } while (0)
  15153. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15154. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15155. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15156. /**
  15157. * @brief target -> host peer (PPDU) stats message
  15158. *
  15159. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15160. *
  15161. * @details
  15162. * This message is generated by FW when FW is sending stats to host
  15163. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15164. * This message is sent autonomously by the target rather than upon request
  15165. * by the host.
  15166. * The following field definitions describe the format of the HTT target
  15167. * to host peer stats indication message.
  15168. *
  15169. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15170. * or more PPDU stats records.
  15171. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15172. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15173. * then the message would start with the
  15174. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15175. * below.
  15176. *
  15177. * |31 16|15|14|13 11|10 9|8|7 0|
  15178. * |-------------------------------------------------------------|
  15179. * | reserved |MSG_TYPE |
  15180. * |-------------------------------------------------------------|
  15181. * rec 0 | TLV header |
  15182. * rec 0 |-------------------------------------------------------------|
  15183. * rec 0 | ppdu successful bytes |
  15184. * rec 0 |-------------------------------------------------------------|
  15185. * rec 0 | ppdu retry bytes |
  15186. * rec 0 |-------------------------------------------------------------|
  15187. * rec 0 | ppdu failed bytes |
  15188. * rec 0 |-------------------------------------------------------------|
  15189. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15190. * rec 0 |-------------------------------------------------------------|
  15191. * rec 0 | retried MSDUs | successful MSDUs |
  15192. * rec 0 |-------------------------------------------------------------|
  15193. * rec 0 | TX duration | failed MSDUs |
  15194. * rec 0 |-------------------------------------------------------------|
  15195. * ...
  15196. * |-------------------------------------------------------------|
  15197. * rec N | TLV header |
  15198. * rec N |-------------------------------------------------------------|
  15199. * rec N | ppdu successful bytes |
  15200. * rec N |-------------------------------------------------------------|
  15201. * rec N | ppdu retry bytes |
  15202. * rec N |-------------------------------------------------------------|
  15203. * rec N | ppdu failed bytes |
  15204. * rec N |-------------------------------------------------------------|
  15205. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15206. * rec N |-------------------------------------------------------------|
  15207. * rec N | retried MSDUs | successful MSDUs |
  15208. * rec N |-------------------------------------------------------------|
  15209. * rec N | TX duration | failed MSDUs |
  15210. * rec N |-------------------------------------------------------------|
  15211. *
  15212. * where:
  15213. * A = is A-MPDU flag
  15214. * BA = block-ack failure flags
  15215. * BW = bandwidth spec
  15216. * SG = SGI enabled spec
  15217. * S = skipped rate ctrl
  15218. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15219. *
  15220. * Header
  15221. * ------
  15222. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15223. * dword0 - b'8:31 - reserved : Reserved for future use
  15224. *
  15225. * payload include below peer_stats information
  15226. * --------------------------------------------
  15227. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15228. * @tx_success_bytes : total successful bytes in the PPDU.
  15229. * @tx_retry_bytes : total retried bytes in the PPDU.
  15230. * @tx_failed_bytes : total failed bytes in the PPDU.
  15231. * @tx_ratecode : rate code used for the PPDU.
  15232. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15233. * @ba_ack_failed : BA/ACK failed for this PPDU
  15234. * b00 -> BA received
  15235. * b01 -> BA failed once
  15236. * b10 -> BA failed twice, when HW retry is enabled.
  15237. * @bw : BW
  15238. * b00 -> 20 MHz
  15239. * b01 -> 40 MHz
  15240. * b10 -> 80 MHz
  15241. * b11 -> 160 MHz (or 80+80)
  15242. * @sg : SGI enabled
  15243. * @s : skipped ratectrl
  15244. * @peer_id : peer id
  15245. * @tx_success_msdus : successful MSDUs
  15246. * @tx_retry_msdus : retried MSDUs
  15247. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15248. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15249. */
  15250. /**
  15251. * @brief target -> host backpressure event
  15252. *
  15253. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15254. *
  15255. * @details
  15256. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15257. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15258. * This message will only be sent if the backpressure condition has existed
  15259. * continuously for an initial period (100 ms).
  15260. * Repeat messages with updated information will be sent after each
  15261. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15262. * This message indicates the ring id along with current head and tail index
  15263. * locations (i.e. write and read indices).
  15264. * The backpressure time indicates the time in ms for which continous
  15265. * backpressure has been observed in the ring.
  15266. *
  15267. * The message format is as follows:
  15268. *
  15269. * |31 24|23 16|15 8|7 0|
  15270. * |----------------+----------------+----------------+----------------|
  15271. * | ring_id | ring_type | pdev_id | msg_type |
  15272. * |-------------------------------------------------------------------|
  15273. * | tail_idx | head_idx |
  15274. * |-------------------------------------------------------------------|
  15275. * | backpressure_time_ms |
  15276. * |-------------------------------------------------------------------|
  15277. *
  15278. * The message is interpreted as follows:
  15279. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15280. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15281. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15282. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15283. the msg is for LMAC ring.
  15284. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15285. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15286. * htt_backpressure_lmac_ring_id. This represents
  15287. * the ring id for which continous backpressure is seen
  15288. *
  15289. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15290. * the ring indicated by the ring_id
  15291. *
  15292. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15293. * the ring indicated by the ring id
  15294. *
  15295. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15296. * backpressure has been seen in the ring
  15297. * indicated by the ring_id.
  15298. * Units = milliseconds
  15299. */
  15300. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15301. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15302. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15303. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15304. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15305. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15306. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15307. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15308. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15309. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15310. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15311. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15312. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15313. do { \
  15314. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15315. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15316. } while (0)
  15317. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15318. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15319. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15320. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15321. do { \
  15322. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15323. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15324. } while (0)
  15325. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15326. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15327. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15328. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15329. do { \
  15330. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15331. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15332. } while (0)
  15333. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15334. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15335. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15336. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15337. do { \
  15338. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15339. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15340. } while (0)
  15341. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15342. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15343. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15344. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15345. do { \
  15346. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15347. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15348. } while (0)
  15349. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15350. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15351. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15352. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15353. do { \
  15354. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15355. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15356. } while (0)
  15357. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15358. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15359. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15360. enum htt_backpressure_ring_type {
  15361. HTT_SW_RING_TYPE_UMAC,
  15362. HTT_SW_RING_TYPE_LMAC,
  15363. HTT_SW_RING_TYPE_MAX,
  15364. };
  15365. /* Ring id for which the message is sent to host */
  15366. enum htt_backpressure_umac_ringid {
  15367. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15368. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15369. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15370. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15371. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15372. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15373. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15374. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15375. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15376. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15377. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15378. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15379. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15380. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15381. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15382. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15383. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15384. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15385. HTT_SW_UMAC_RING_IDX_MAX,
  15386. };
  15387. enum htt_backpressure_lmac_ringid {
  15388. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15389. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15390. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15391. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15392. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15393. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15394. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15395. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15396. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15397. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15398. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15399. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15400. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15401. HTT_SW_LMAC_RING_IDX_MAX,
  15402. };
  15403. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15404. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15405. pdev_id: 8,
  15406. ring_type: 8, /* htt_backpressure_ring_type */
  15407. /*
  15408. * ring_id holds an enum value from either
  15409. * htt_backpressure_umac_ringid or
  15410. * htt_backpressure_lmac_ringid, based on
  15411. * the ring_type setting.
  15412. */
  15413. ring_id: 8;
  15414. A_UINT16 head_idx;
  15415. A_UINT16 tail_idx;
  15416. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15417. } POSTPACK;
  15418. /*
  15419. * Defines two 32 bit words that can be used by the target to indicate a per
  15420. * user RU allocation and rate information.
  15421. *
  15422. * This information is currently provided in the "sw_response_reference_ptr"
  15423. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15424. * "rx_ppdu_end_user_stats" TLV.
  15425. *
  15426. * VALID:
  15427. * The consumer of these words must explicitly check the valid bit,
  15428. * and only attempt interpretation of any of the remaining fields if
  15429. * the valid bit is set to 1.
  15430. *
  15431. * VERSION:
  15432. * The consumer of these words must also explicitly check the version bit,
  15433. * and only use the V0 definition if the VERSION field is set to 0.
  15434. *
  15435. * Version 1 is currently undefined, with the exception of the VALID and
  15436. * VERSION fields.
  15437. *
  15438. * Version 0:
  15439. *
  15440. * The fields below are duplicated per BW.
  15441. *
  15442. * The consumer must determine which BW field to use, based on the UL OFDMA
  15443. * PPDU BW indicated by HW.
  15444. *
  15445. * RU_START: RU26 start index for the user.
  15446. * Note that this is always using the RU26 index, regardless
  15447. * of the actual RU assigned to the user
  15448. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15449. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15450. *
  15451. * For example, 20MHz (the value in the top row is RU_START)
  15452. *
  15453. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15454. * RU Size 1 (52): | | | | | |
  15455. * RU Size 2 (106): | | | |
  15456. * RU Size 3 (242): | |
  15457. *
  15458. * RU_SIZE: Indicates the RU size, as defined by enum
  15459. * htt_ul_ofdma_user_info_ru_size.
  15460. *
  15461. * LDPC: LDPC enabled (if 0, BCC is used)
  15462. *
  15463. * DCM: DCM enabled
  15464. *
  15465. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15466. * |---------------------------------+--------------------------------|
  15467. * |Ver|Valid| FW internal |
  15468. * |---------------------------------+--------------------------------|
  15469. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15470. * |---------------------------------+--------------------------------|
  15471. */
  15472. enum htt_ul_ofdma_user_info_ru_size {
  15473. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15474. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15475. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15476. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15477. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15478. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15479. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15480. };
  15481. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15482. struct htt_ul_ofdma_user_info_v0 {
  15483. A_UINT32 word0;
  15484. A_UINT32 word1;
  15485. };
  15486. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15487. A_UINT32 w0_fw_rsvd:30; \
  15488. A_UINT32 w0_valid:1; \
  15489. A_UINT32 w0_version:1;
  15490. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15491. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15492. };
  15493. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15494. A_UINT32 w1_nss:3; \
  15495. A_UINT32 w1_mcs:4; \
  15496. A_UINT32 w1_ldpc:1; \
  15497. A_UINT32 w1_dcm:1; \
  15498. A_UINT32 w1_ru_start:7; \
  15499. A_UINT32 w1_ru_size:3; \
  15500. A_UINT32 w1_trig_type:4; \
  15501. A_UINT32 w1_unused:9;
  15502. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15503. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15504. };
  15505. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15506. A_UINT32 w0_fw_rsvd:27; \
  15507. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15508. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15509. 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) */
  15510. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15511. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15512. };
  15513. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15514. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15515. A_UINT32 w1_trig_type:4; \
  15516. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15517. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15518. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15519. };
  15520. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15521. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15522. union {
  15523. A_UINT32 word0;
  15524. struct {
  15525. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15526. };
  15527. };
  15528. union {
  15529. A_UINT32 word1;
  15530. struct {
  15531. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15532. };
  15533. };
  15534. } POSTPACK;
  15535. /*
  15536. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15537. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15538. * this should be picked.
  15539. */
  15540. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15541. union {
  15542. A_UINT32 word0;
  15543. struct {
  15544. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15545. };
  15546. };
  15547. union {
  15548. A_UINT32 word1;
  15549. struct {
  15550. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15551. };
  15552. };
  15553. } POSTPACK;
  15554. enum HTT_UL_OFDMA_TRIG_TYPE {
  15555. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15556. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15557. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15558. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15559. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15560. };
  15561. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15562. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15563. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15564. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15565. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15566. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15567. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15568. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15569. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15570. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15576. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15579. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15584. /*--- word 0 ---*/
  15585. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15586. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15587. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15588. do { \
  15589. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15590. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15591. } while (0)
  15592. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15593. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15594. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15595. do { \
  15596. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15597. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15598. } while (0)
  15599. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15600. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15601. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15602. do { \
  15603. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15604. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15605. } while (0)
  15606. /*--- word 1 ---*/
  15607. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15608. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15609. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15610. do { \
  15611. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15612. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15613. } while (0)
  15614. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15615. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15616. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15617. do { \
  15618. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15619. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15620. } while (0)
  15621. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15622. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15623. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15624. do { \
  15625. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15626. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15627. } while (0)
  15628. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15629. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15630. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15631. do { \
  15632. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15633. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15634. } while (0)
  15635. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15636. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15637. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15638. do { \
  15639. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15640. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15641. } while (0)
  15642. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15643. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15644. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15645. do { \
  15646. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15647. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15648. } while (0)
  15649. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15650. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15651. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15652. do { \
  15653. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15654. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15655. } while (0)
  15656. /**
  15657. * @brief target -> host channel calibration data message
  15658. *
  15659. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15660. *
  15661. * @brief host -> target channel calibration data message
  15662. *
  15663. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15664. *
  15665. * @details
  15666. * The following field definitions describe the format of the channel
  15667. * calibration data message sent from the target to the host when
  15668. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15669. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15670. * The message is defined as htt_chan_caldata_msg followed by a variable
  15671. * number of 32-bit character values.
  15672. *
  15673. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15674. * |------------------------------------------------------------------|
  15675. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15676. * |------------------------------------------------------------------|
  15677. * | payload size | mhz |
  15678. * |------------------------------------------------------------------|
  15679. * | center frequency 2 | center frequency 1 |
  15680. * |------------------------------------------------------------------|
  15681. * | check sum |
  15682. * |------------------------------------------------------------------|
  15683. * | payload |
  15684. * |------------------------------------------------------------------|
  15685. * message info field:
  15686. * - MSG_TYPE
  15687. * Bits 7:0
  15688. * Purpose: identifies this as a channel calibration data message
  15689. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15690. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15691. * - SUB_TYPE
  15692. * Bits 11:8
  15693. * Purpose: T2H: indicates whether target is providing chan cal data
  15694. * to the host to store, or requesting that the host
  15695. * download previously-stored data.
  15696. * H2T: indicates whether the host is providing the requested
  15697. * channel cal data, or if it is rejecting the data
  15698. * request because it does not have the requested data.
  15699. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15700. * - CHKSUM_VALID
  15701. * Bit 12
  15702. * Purpose: indicates if the checksum field is valid
  15703. * value:
  15704. * - FRAG
  15705. * Bit 19:16
  15706. * Purpose: indicates the fragment index for message
  15707. * value: 0 for first fragment, 1 for second fragment, ...
  15708. * - APPEND
  15709. * Bit 20
  15710. * Purpose: indicates if this is the last fragment
  15711. * value: 0 = final fragment, 1 = more fragments will be appended
  15712. *
  15713. * channel and payload size field
  15714. * - MHZ
  15715. * Bits 15:0
  15716. * Purpose: indicates the channel primary frequency
  15717. * Value:
  15718. * - PAYLOAD_SIZE
  15719. * Bits 31:16
  15720. * Purpose: indicates the bytes of calibration data in payload
  15721. * Value:
  15722. *
  15723. * center frequency field
  15724. * - CENTER FREQUENCY 1
  15725. * Bits 15:0
  15726. * Purpose: indicates the channel center frequency
  15727. * Value: channel center frequency, in MHz units
  15728. * - CENTER FREQUENCY 2
  15729. * Bits 31:16
  15730. * Purpose: indicates the secondary channel center frequency,
  15731. * only for 11acvht 80plus80 mode
  15732. * Value: secondary channel center frequeny, in MHz units, if applicable
  15733. *
  15734. * checksum field
  15735. * - CHECK_SUM
  15736. * Bits 31:0
  15737. * Purpose: check the payload data, it is just for this fragment.
  15738. * This is intended for the target to check that the channel
  15739. * calibration data returned by the host is the unmodified data
  15740. * that was previously provided to the host by the target.
  15741. * value: checksum of fragment payload
  15742. */
  15743. PREPACK struct htt_chan_caldata_msg {
  15744. /* DWORD 0: message info */
  15745. A_UINT32
  15746. msg_type: 8,
  15747. sub_type: 4 ,
  15748. chksum_valid: 1, /** 1:valid, 0:invalid */
  15749. reserved1: 3,
  15750. frag_idx: 4, /** fragment index for calibration data */
  15751. appending: 1, /** 0: no fragment appending,
  15752. * 1: extra fragment appending */
  15753. reserved2: 11;
  15754. /* DWORD 1: channel and payload size */
  15755. A_UINT32
  15756. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15757. payload_size: 16; /** unit: bytes */
  15758. /* DWORD 2: center frequency */
  15759. A_UINT32
  15760. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15761. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15762. * valid only for 11acvht 80plus80 mode */
  15763. /* DWORD 3: check sum */
  15764. A_UINT32 chksum;
  15765. /* variable length for calibration data */
  15766. A_UINT32 payload[1/* or more */];
  15767. } POSTPACK;
  15768. /* T2H SUBTYPE */
  15769. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15770. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15771. /* H2T SUBTYPE */
  15772. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15773. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15774. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15775. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15776. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15777. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15778. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15779. do { \
  15780. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15781. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15782. } while (0)
  15783. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15784. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15785. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15786. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15787. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15788. do { \
  15789. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15790. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15791. } while (0)
  15792. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15793. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15794. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15795. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15796. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15797. do { \
  15798. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15799. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15800. } while (0)
  15801. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15802. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15803. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15804. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15805. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15806. do { \
  15807. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15808. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15809. } while (0)
  15810. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15811. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15812. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15813. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15814. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15815. do { \
  15816. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15817. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15818. } while (0)
  15819. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15820. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15821. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15822. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15823. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15824. do { \
  15825. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15826. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15827. } while (0)
  15828. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15829. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15830. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15831. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15832. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15833. do { \
  15834. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15835. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15836. } while (0)
  15837. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15838. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15839. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15840. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15841. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15842. do { \
  15843. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15844. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15845. } while (0)
  15846. /**
  15847. * @brief target -> host FSE CMEM based send
  15848. *
  15849. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15850. *
  15851. * @details
  15852. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15853. * FSE placement in CMEM is enabled.
  15854. *
  15855. * This message sends the non-secure CMEM base address.
  15856. * It will be sent to host in response to message
  15857. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15858. * The message would appear as follows:
  15859. *
  15860. * |31 24|23 16|15 8|7 0|
  15861. * |----------------+----------------+----------------+----------------|
  15862. * | reserved | num_entries | msg_type |
  15863. * |----------------+----------------+----------------+----------------|
  15864. * | base_address_lo |
  15865. * |----------------+----------------+----------------+----------------|
  15866. * | base_address_hi |
  15867. * |-------------------------------------------------------------------|
  15868. *
  15869. * The message is interpreted as follows:
  15870. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15871. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15872. * b'8:15 - number_entries: Indicated the number of entries
  15873. * programmed.
  15874. * b'16:31 - reserved.
  15875. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15876. * CMEM base address
  15877. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15878. * CMEM base address
  15879. */
  15880. PREPACK struct htt_cmem_base_send_t {
  15881. A_UINT32 msg_type: 8,
  15882. num_entries: 8,
  15883. reserved: 16;
  15884. A_UINT32 base_address_lo;
  15885. A_UINT32 base_address_hi;
  15886. } POSTPACK;
  15887. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15888. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15889. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15890. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15891. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15892. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15893. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15894. do { \
  15895. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15896. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15897. } while (0)
  15898. /**
  15899. * @brief - HTT PPDU ID format
  15900. *
  15901. * @details
  15902. * The following field definitions describe the format of the PPDU ID.
  15903. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15904. *
  15905. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15906. * +--------------------------------------------------------------------------
  15907. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15908. * +--------------------------------------------------------------------------
  15909. *
  15910. * sch id :Schedule command id
  15911. * Bits [11 : 0] : monotonically increasing counter to track the
  15912. * PPDU posted to a specific transmit queue.
  15913. *
  15914. * hwq_id: Hardware Queue ID.
  15915. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15916. *
  15917. * mac_id: MAC ID
  15918. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15919. *
  15920. * seq_idx: Sequence index.
  15921. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15922. * a particular TXOP.
  15923. *
  15924. * tqm_cmd: HWSCH/TQM flag.
  15925. * Bit [23] : Always set to 0.
  15926. *
  15927. * seq_cmd_type: Sequence command type.
  15928. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15929. * Refer to enum HTT_STATS_FTYPE for values.
  15930. */
  15931. PREPACK struct htt_ppdu_id {
  15932. A_UINT32
  15933. sch_id: 12,
  15934. hwq_id: 5,
  15935. mac_id: 2,
  15936. seq_idx: 2,
  15937. reserved1: 2,
  15938. tqm_cmd: 1,
  15939. seq_cmd_type: 6,
  15940. reserved2: 2;
  15941. } POSTPACK;
  15942. #define HTT_PPDU_ID_SCH_ID_S 0
  15943. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15944. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15945. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15946. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15947. do { \
  15948. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15949. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15950. } while (0)
  15951. #define HTT_PPDU_ID_HWQ_ID_S 12
  15952. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15953. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15954. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15955. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15956. do { \
  15957. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15958. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15959. } while (0)
  15960. #define HTT_PPDU_ID_MAC_ID_S 17
  15961. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15962. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15963. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15964. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15965. do { \
  15966. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15967. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15968. } while (0)
  15969. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15970. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15971. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15972. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15973. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15974. do { \
  15975. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15976. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15977. } while (0)
  15978. #define HTT_PPDU_ID_TQM_CMD_S 23
  15979. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15980. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15981. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15982. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15983. do { \
  15984. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15985. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15986. } while (0)
  15987. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15988. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15989. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15990. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15991. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15992. do { \
  15993. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15994. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15995. } while (0)
  15996. /**
  15997. * @brief target -> RX PEER METADATA V0 format
  15998. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15999. * message from target, and will confirm to the target which peer metadata
  16000. * version to use in the wmi_init message.
  16001. *
  16002. * The following diagram shows the format of the RX PEER METADATA.
  16003. *
  16004. * |31 24|23 16|15 8|7 0|
  16005. * |-----------------------------------------------------------------------|
  16006. * | Reserved | VDEV ID | PEER ID |
  16007. * |-----------------------------------------------------------------------|
  16008. */
  16009. PREPACK struct htt_rx_peer_metadata_v0 {
  16010. A_UINT32
  16011. peer_id: 16,
  16012. vdev_id: 8,
  16013. reserved1: 8;
  16014. } POSTPACK;
  16015. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16016. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16017. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16018. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16019. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16020. do { \
  16021. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16022. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16023. } while (0)
  16024. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16025. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16026. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16027. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16028. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16029. do { \
  16030. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16031. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16032. } while (0)
  16033. /**
  16034. * @brief target -> RX PEER METADATA V1 format
  16035. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16036. * message from target, and will confirm to the target which peer metadata
  16037. * version to use in the wmi_init message.
  16038. *
  16039. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16040. *
  16041. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16042. * |-----------------------------------------------------------------------|
  16043. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16044. * |-----------------------------------------------------------------------|
  16045. */
  16046. PREPACK struct htt_rx_peer_metadata_v1 {
  16047. A_UINT32
  16048. peer_id: 13,
  16049. ml_peer_valid: 1,
  16050. reserved1: 2,
  16051. vdev_id: 8,
  16052. lmac_id: 2,
  16053. chip_id: 3,
  16054. reserved2: 3;
  16055. } POSTPACK;
  16056. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16057. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16058. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16059. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16060. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16061. do { \
  16062. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16063. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16064. } while (0)
  16065. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16066. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16067. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16068. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16069. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16070. do { \
  16071. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16072. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16073. } while (0)
  16074. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16075. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16076. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16077. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16078. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16079. do { \
  16080. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16081. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16082. } while (0)
  16083. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16084. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16085. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16086. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16087. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16088. do { \
  16089. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16090. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16091. } while (0)
  16092. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16093. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16094. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16095. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16096. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16097. do { \
  16098. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16099. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16100. } while (0)
  16101. /*
  16102. * In some systems, the host SW wants to specify priorities between
  16103. * different MSDU / flow queues within the same peer-TID.
  16104. * The below enums are used for the host to identify to the target
  16105. * which MSDU queue's priority it wants to adjust.
  16106. */
  16107. /*
  16108. * The MSDUQ index describe index of TCL HW, where each index is
  16109. * used for queuing particular types of MSDUs.
  16110. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16111. */
  16112. enum HTT_MSDUQ_INDEX {
  16113. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16114. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16115. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16116. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16117. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16118. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16119. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16120. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16121. HTT_MSDUQ_MAX_INDEX,
  16122. };
  16123. /* MSDU qtype definition */
  16124. enum HTT_MSDU_QTYPE {
  16125. /*
  16126. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16127. * relative priority. Instead, the relative priority of CRIT_0 versus
  16128. * CRIT_1 is controlled by the FW, through the configuration parameters
  16129. * it applies to the queues.
  16130. */
  16131. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16132. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16133. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16134. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16135. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16136. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16137. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16138. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16139. /* New MSDU_QTYPE should be added above this line */
  16140. /*
  16141. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16142. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16143. * any host/target message definitions. The QTYPE_MAX value can
  16144. * only be used internally within the host or within the target.
  16145. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16146. * it must regard the unexpected value as a default qtype value,
  16147. * or ignore it.
  16148. */
  16149. HTT_MSDU_QTYPE_MAX,
  16150. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16151. };
  16152. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16153. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16154. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16155. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16156. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16157. };
  16158. /**
  16159. * @brief target -> host mlo timestamp offset indication
  16160. *
  16161. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16162. *
  16163. * @details
  16164. * The following field definitions describe the format of the HTT target
  16165. * to host mlo timestamp offset indication message.
  16166. *
  16167. *
  16168. * |31 16|15 12|11 10|9 8|7 0 |
  16169. * |----------------------------------------------------------------------|
  16170. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16171. * |----------------------------------------------------------------------|
  16172. * | Sync time stamp lo in us |
  16173. * |----------------------------------------------------------------------|
  16174. * | Sync time stamp hi in us |
  16175. * |----------------------------------------------------------------------|
  16176. * | mlo time stamp offset lo in us |
  16177. * |----------------------------------------------------------------------|
  16178. * | mlo time stamp offset hi in us |
  16179. * |----------------------------------------------------------------------|
  16180. * | mlo time stamp offset clocks in clock ticks |
  16181. * |----------------------------------------------------------------------|
  16182. * |31 26|25 16|15 0 |
  16183. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16184. * | | compensation in clks | |
  16185. * |----------------------------------------------------------------------|
  16186. * |31 22|21 0 |
  16187. * | rsvd 3 | mlo time stamp comp timer period |
  16188. * |----------------------------------------------------------------------|
  16189. * The message is interpreted as follows:
  16190. *
  16191. * dword0 - b'0:7 - msg_type: This will be set to
  16192. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16193. * value: 0x28
  16194. *
  16195. * dword0 - b'9:8 - pdev_id
  16196. *
  16197. * dword0 - b'11:10 - chip_id
  16198. *
  16199. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16200. *
  16201. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16202. *
  16203. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16204. * which last sync interrupt was received
  16205. *
  16206. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16207. * which last sync interrupt was received
  16208. *
  16209. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16210. *
  16211. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16212. *
  16213. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16214. *
  16215. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16216. *
  16217. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16218. * for sub us resolution
  16219. *
  16220. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16221. *
  16222. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16223. * is applied, in us
  16224. *
  16225. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16226. */
  16227. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16228. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16229. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16242. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16243. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16244. do { \
  16245. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16246. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16247. } while (0)
  16248. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16249. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16250. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16251. do { \
  16252. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16253. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16254. } while (0)
  16255. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16256. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16257. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16258. do { \
  16259. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16260. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16261. } while (0)
  16262. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16263. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16264. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16265. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16266. do { \
  16267. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16268. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16269. } while (0)
  16270. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16271. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16272. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16273. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16274. do { \
  16275. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16276. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16277. } while (0)
  16278. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16279. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16280. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16281. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16282. do { \
  16283. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16284. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16285. } while (0)
  16286. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16287. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16288. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16289. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16290. do { \
  16291. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16292. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16293. } while (0)
  16294. typedef struct {
  16295. A_UINT32 msg_type: 8, /* bits 7:0 */
  16296. pdev_id: 2, /* bits 9:8 */
  16297. chip_id: 2, /* bits 11:10 */
  16298. reserved1: 4, /* bits 15:12 */
  16299. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16300. A_UINT32 sync_timestamp_lo_us;
  16301. A_UINT32 sync_timestamp_hi_us;
  16302. A_UINT32 mlo_timestamp_offset_lo_us;
  16303. A_UINT32 mlo_timestamp_offset_hi_us;
  16304. A_UINT32 mlo_timestamp_offset_clks;
  16305. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16306. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16307. reserved2: 6; /* bits 31:26 */
  16308. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16309. reserved3: 10; /* bits 31:22 */
  16310. } htt_t2h_mlo_offset_ind_t;
  16311. /*
  16312. * @brief target -> host VDEV TX RX STATS
  16313. *
  16314. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16315. *
  16316. * @details
  16317. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16318. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16319. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16320. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16321. * periodically by target even in the absence of any further HTT request
  16322. * messages from host.
  16323. *
  16324. * The message is formatted as follows:
  16325. *
  16326. * |31 16|15 8|7 0|
  16327. * |---------------------------------+----------------+----------------|
  16328. * | payload_size | pdev_id | msg_type |
  16329. * |---------------------------------+----------------+----------------|
  16330. * | reserved0 |
  16331. * |-------------------------------------------------------------------|
  16332. * | reserved1 |
  16333. * |-------------------------------------------------------------------|
  16334. * | reserved2 |
  16335. * |-------------------------------------------------------------------|
  16336. * | |
  16337. * | VDEV specific Tx Rx stats info |
  16338. * | |
  16339. * |-------------------------------------------------------------------|
  16340. *
  16341. * The message is interpreted as follows:
  16342. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16343. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16344. * b'8:15 - pdev_id
  16345. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16346. * message header fields (msg_type through reserved2)
  16347. * dword1 - b'0:31 - reserved0.
  16348. * dword2 - b'0:31 - reserved1.
  16349. * dword3 - b'0:31 - reserved2.
  16350. */
  16351. typedef struct {
  16352. A_UINT32 msg_type: 8,
  16353. pdev_id: 8,
  16354. payload_size: 16;
  16355. A_UINT32 reserved0;
  16356. A_UINT32 reserved1;
  16357. A_UINT32 reserved2;
  16358. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16359. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16360. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16361. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16362. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16363. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16364. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16365. do { \
  16366. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16367. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16368. } while (0)
  16369. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16370. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16371. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16372. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16373. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16374. do { \
  16375. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16376. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16377. } while (0)
  16378. /* SOC related stats */
  16379. typedef struct {
  16380. htt_tlv_hdr_t tlv_hdr;
  16381. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16382. * This can be due to either the peer is deleted or deletion is ongoing
  16383. * */
  16384. A_UINT32 inv_peers_msdu_drop_count_lo;
  16385. A_UINT32 inv_peers_msdu_drop_count_hi;
  16386. } htt_t2h_soc_txrx_stats_common_tlv;
  16387. /* VDEV HW Tx/Rx stats */
  16388. typedef struct {
  16389. htt_tlv_hdr_t tlv_hdr;
  16390. A_UINT32 vdev_id;
  16391. /* Rx msdu byte cnt */
  16392. A_UINT32 rx_msdu_byte_cnt_lo;
  16393. A_UINT32 rx_msdu_byte_cnt_hi;
  16394. /* Rx msdu cnt */
  16395. A_UINT32 rx_msdu_cnt_lo;
  16396. A_UINT32 rx_msdu_cnt_hi;
  16397. /* tx msdu byte cnt */
  16398. A_UINT32 tx_msdu_byte_cnt_lo;
  16399. A_UINT32 tx_msdu_byte_cnt_hi;
  16400. /* tx msdu cnt */
  16401. A_UINT32 tx_msdu_cnt_lo;
  16402. A_UINT32 tx_msdu_cnt_hi;
  16403. /* tx excessive retry discarded msdu cnt */
  16404. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16405. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16406. /* TX congestion ctrl msdu drop cnt */
  16407. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16408. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16409. /* discarded tx msdus cnt coz of time to live expiry */
  16410. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16411. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16412. /* tx excessive retry discarded msdu byte cnt */
  16413. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16414. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16415. /* TX congestion ctrl msdu drop byte cnt */
  16416. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16417. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16418. /* discarded tx msdus byte cnt coz of time to live expiry */
  16419. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16420. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16421. /* TQM bypass frame cnt */
  16422. A_UINT32 tqm_bypass_frame_cnt_lo;
  16423. A_UINT32 tqm_bypass_frame_cnt_hi;
  16424. /* TQM bypass byte cnt */
  16425. A_UINT32 tqm_bypass_byte_cnt_lo;
  16426. A_UINT32 tqm_bypass_byte_cnt_hi;
  16427. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16428. /*
  16429. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16430. *
  16431. * @details
  16432. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16433. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16434. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16435. * the default MSDU queues of each of the specified TIDs for the peer
  16436. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16437. * If the default MSDU queues of a given TID within the peer are not linked
  16438. * to a service class, the svc_class_id field for that TID will have a
  16439. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16440. * queues for that TID are not mapped to any service class.
  16441. *
  16442. * |31 16|15 8|7 0|
  16443. * |------------------------------+--------------+--------------|
  16444. * | peer ID | reserved | msg type |
  16445. * |------------------------------+--------------+------+-------|
  16446. * | reserved | svc class ID | TID |
  16447. * |------------------------------------------------------------|
  16448. * ...
  16449. * |------------------------------------------------------------|
  16450. * | reserved | svc class ID | TID |
  16451. * |------------------------------------------------------------|
  16452. * Header fields:
  16453. * dword0 - b'7:0 - msg_type: This will be set to
  16454. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16455. * b'31:16 - peer ID
  16456. * dword1 - b'7:0 - TID
  16457. * b'15:8 - svc class ID
  16458. * (dword2, etc. same format as dword1)
  16459. */
  16460. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16461. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16462. A_UINT32 msg_type :8,
  16463. reserved0 :8,
  16464. peer_id :16;
  16465. struct {
  16466. A_UINT32 tid :8,
  16467. svc_class_id :8,
  16468. reserved1 :16;
  16469. } tid_reports[1/*or more*/];
  16470. } POSTPACK;
  16471. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16472. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16473. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16474. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16475. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16476. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16477. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16478. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16479. do { \
  16480. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16481. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16482. } while (0)
  16483. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16484. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16485. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16486. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16487. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16488. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16489. do { \
  16490. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16491. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16492. } while (0)
  16493. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16494. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16495. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16496. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16497. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16498. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16499. do { \
  16500. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16501. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16502. } while (0)
  16503. /*
  16504. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16505. *
  16506. * @details
  16507. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16508. * flow if the flow is seen the associated service class is conveyed to the
  16509. * target via TCL Data Command. Target on the other hand internally creates the
  16510. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16511. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16512. * the newly created MSDUQ
  16513. *
  16514. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16515. * |------------------------------+------------------------+--------------|
  16516. * | peer ID | HTT qtype | msg type |
  16517. * |---------------------------------+--------------+--+---+-------+------|
  16518. * | reserved |AST list index|FO|WC | HLOS | remap|
  16519. * | | | | | TID | TID |
  16520. * |---------------------+------------------------------------------------|
  16521. * | reserved1 | tgt_opaque_id |
  16522. * |---------------------+------------------------------------------------|
  16523. *
  16524. * Header fields:
  16525. *
  16526. * dword0 - b'7:0 - msg_type: This will be set to
  16527. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16528. * b'15:8 - HTT qtype
  16529. * b'31:16 - peer ID
  16530. *
  16531. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16532. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16533. * hlos_tid : Common to Lithium and Beryllium
  16534. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16535. * TCL Data Command : Beryllium
  16536. * b10 - flow_override (FO), as sent by host in
  16537. * TCL Data Command: Beryllium
  16538. * b11:14 - ast_list_idx
  16539. * Array index into the list of extension AST entries
  16540. * (not the actual AST 16-bit index).
  16541. * The ast_list_idx is one-based, with the following
  16542. * range of values:
  16543. * - legacy targets supporting 16 user-defined
  16544. * MSDU queues: 1-2
  16545. * - legacy targets supporting 48 user-defined
  16546. * MSDU queues: 1-6
  16547. * - new targets: 0 (peer_id is used instead)
  16548. * Note that since ast_list_idx is one-based,
  16549. * the host will need to subtract 1 to use it as an
  16550. * index into a list of extension AST entries.
  16551. * b15:31 - reserved
  16552. *
  16553. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16554. * unique MSDUQ id in firmware
  16555. * b'24:31 - reserved1
  16556. */
  16557. PREPACK struct htt_t2h_sawf_msduq_event {
  16558. A_UINT32 msg_type : 8,
  16559. htt_qtype : 8,
  16560. peer_id :16;
  16561. A_UINT32 remap_tid : 4,
  16562. hlos_tid : 4,
  16563. who_classify_info_sel : 2,
  16564. flow_override : 1,
  16565. ast_list_idx : 4,
  16566. reserved :17;
  16567. A_UINT32 tgt_opaque_id :24,
  16568. reserved1 : 8;
  16569. } POSTPACK;
  16570. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16571. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16572. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16573. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16574. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16575. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16576. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16577. do { \
  16578. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16579. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16580. } while (0)
  16581. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16582. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16583. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16584. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16585. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16586. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16587. do { \
  16588. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16589. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16590. } while (0)
  16591. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16592. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16593. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16594. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16595. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16596. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16597. do { \
  16598. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16599. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16600. } while (0)
  16601. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16602. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16603. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16604. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16605. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16606. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16607. do { \
  16608. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16609. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16610. } while (0)
  16611. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16612. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16613. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16614. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16615. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16616. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16617. do { \
  16618. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16619. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16620. } while (0)
  16621. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16622. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16623. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16624. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16625. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16626. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16627. do { \
  16628. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16629. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16630. } while (0)
  16631. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  16632. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  16633. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  16634. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  16635. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  16636. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  16637. do { \
  16638. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  16639. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  16640. } while (0)
  16641. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  16642. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  16643. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  16644. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  16645. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  16646. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  16647. do { \
  16648. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  16649. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  16650. } while (0)
  16651. #endif