htt.h 877 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. */
  231. #define HTT_CURRENT_VERSION_MAJOR 3
  232. #define HTT_CURRENT_VERSION_MINOR 109
  233. #define HTT_NUM_TX_FRAG_DESC 1024
  234. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  235. #define HTT_CHECK_SET_VAL(field, val) \
  236. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  237. /* macros to assist in sign-extending fields from HTT messages */
  238. #define HTT_SIGN_BIT_MASK(field) \
  239. ((field ## _M + (1 << field ## _S)) >> 1)
  240. #define HTT_SIGN_BIT(_val, field) \
  241. (_val & HTT_SIGN_BIT_MASK(field))
  242. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  243. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  244. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  245. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  246. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  247. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  248. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  249. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  250. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  251. /*
  252. * TEMPORARY:
  253. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  254. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  255. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  256. * updated.
  257. */
  258. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  259. /*
  260. * TEMPORARY:
  261. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  262. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  263. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  264. * updated.
  265. */
  266. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  267. /**
  268. * htt_dbg_stats_type -
  269. * bit positions for each stats type within a stats type bitmask
  270. * The bitmask contains 24 bits.
  271. */
  272. enum htt_dbg_stats_type {
  273. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  274. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  275. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  276. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  277. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  278. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  279. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  280. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  281. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  282. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  283. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  284. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  285. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  286. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  287. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  288. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  289. /* bits 16-23 currently reserved */
  290. /* keep this last */
  291. HTT_DBG_NUM_STATS
  292. };
  293. /*=== HTT option selection TLVs ===
  294. * Certain HTT messages have alternatives or options.
  295. * For such cases, the host and target need to agree on which option to use.
  296. * Option specification TLVs can be appended to the VERSION_REQ and
  297. * VERSION_CONF messages to select options other than the default.
  298. * These TLVs are entirely optional - if they are not provided, there is a
  299. * well-defined default for each option. If they are provided, they can be
  300. * provided in any order. Each TLV can be present or absent independent of
  301. * the presence / absence of other TLVs.
  302. *
  303. * The HTT option selection TLVs use the following format:
  304. * |31 16|15 8|7 0|
  305. * |---------------------------------+----------------+----------------|
  306. * | value (payload) | length | tag |
  307. * |-------------------------------------------------------------------|
  308. * The value portion need not be only 2 bytes; it can be extended by any
  309. * integer number of 4-byte units. The total length of the TLV, including
  310. * the tag and length fields, must be a multiple of 4 bytes. The length
  311. * field specifies the total TLV size in 4-byte units. Thus, the typical
  312. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  313. * field, would store 0x1 in its length field, to show that the TLV occupies
  314. * a single 4-byte unit.
  315. */
  316. /*--- TLV header format - applies to all HTT option TLVs ---*/
  317. enum HTT_OPTION_TLV_TAGS {
  318. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  319. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  320. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  321. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  322. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  323. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  324. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  325. };
  326. #define HTT_TCL_METADATA_VER_SZ 4
  327. PREPACK struct htt_option_tlv_header_t {
  328. A_UINT8 tag;
  329. A_UINT8 length;
  330. } POSTPACK;
  331. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  332. #define HTT_OPTION_TLV_TAG_S 0
  333. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  334. #define HTT_OPTION_TLV_LENGTH_S 8
  335. /*
  336. * value0 - 16 bit value field stored in word0
  337. * The TLV's value field may be longer than 2 bytes, in which case
  338. * the remainder of the value is stored in word1, word2, etc.
  339. */
  340. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  341. #define HTT_OPTION_TLV_VALUE0_S 16
  342. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_TAG_GET(word) \
  348. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  349. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  355. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  356. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  357. do { \
  358. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  359. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  360. } while (0)
  361. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  362. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  363. /*--- format of specific HTT option TLVs ---*/
  364. /*
  365. * HTT option TLV for specifying LL bus address size
  366. * Some chips require bus addresses used by the target to access buffers
  367. * within the host's memory to be 32 bits; others require bus addresses
  368. * used by the target to access buffers within the host's memory to be
  369. * 64 bits.
  370. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  371. * a suffix to the VERSION_CONF message to specify which bus address format
  372. * the target requires.
  373. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  374. * default to providing bus addresses to the target in 32-bit format.
  375. */
  376. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  377. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  379. };
  380. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  381. struct htt_option_tlv_header_t hdr;
  382. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  383. } POSTPACK;
  384. /*
  385. * HTT option TLV for specifying whether HL systems should indicate
  386. * over-the-air tx completion for individual frames, or should instead
  387. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  388. * requests an OTA tx completion for a particular tx frame.
  389. * This option does not apply to LL systems, where the TX_COMPL_IND
  390. * is mandatory.
  391. * This option is primarily intended for HL systems in which the tx frame
  392. * downloads over the host --> target bus are as slow as or slower than
  393. * the transmissions over the WLAN PHY. For cases where the bus is faster
  394. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  395. * and consquently will send one TX_COMPL_IND message that covers several
  396. * tx frames. For cases where the WLAN PHY is faster than the bus,
  397. * the target will end up transmitting very short A-MPDUs, and consequently
  398. * sending many TX_COMPL_IND messages, which each cover a very small number
  399. * of tx frames.
  400. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  401. * a suffix to the VERSION_REQ message to request whether the host desires to
  402. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  403. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  404. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  405. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  406. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  407. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  408. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  409. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  410. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  411. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  412. * TLV.
  413. */
  414. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  415. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  416. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  417. };
  418. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying how many tx queue groups the target
  424. * may establish.
  425. * This TLV specifies the maximum value the target may send in the
  426. * txq_group_id field of any TXQ_GROUP information elements sent by
  427. * the target to the host. This allows the host to pre-allocate an
  428. * appropriate number of tx queue group structs.
  429. *
  430. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  431. * a suffix to the VERSION_REQ message to specify whether the host supports
  432. * tx queue groups at all, and if so if there is any limit on the number of
  433. * tx queue groups that the host supports.
  434. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  435. * a suffix to the VERSION_CONF message. If the host has specified in the
  436. * VER_REQ message a limit on the number of tx queue groups the host can
  437. * supprt, the target shall limit its specification of the maximum tx groups
  438. * to be no larger than this host-specified limit.
  439. *
  440. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  441. * shall preallocate 4 tx queue group structs, and the target shall not
  442. * specify a txq_group_id larger than 3.
  443. */
  444. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  445. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  446. /*
  447. * values 1 through N specify the max number of tx queue groups
  448. * the sender supports
  449. */
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  451. };
  452. /* TEMPORARY backwards-compatibility alias for a typo fix -
  453. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  454. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  455. * to support the old name (with the typo) until all references to the
  456. * old name are replaced with the new name.
  457. */
  458. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  459. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  460. struct htt_option_tlv_header_t hdr;
  461. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  462. } POSTPACK;
  463. /*
  464. * HTT option TLV for specifying whether the target supports an extended
  465. * version of the HTT tx descriptor. If the target provides this TLV
  466. * and specifies in the TLV that the target supports an extended version
  467. * of the HTT tx descriptor, the target must check the "extension" bit in
  468. * the HTT tx descriptor, and if the extension bit is set, to expect a
  469. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  470. * descriptor. Furthermore, the target must provide room for the HTT
  471. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  472. * This option is intended for systems where the host needs to explicitly
  473. * control the transmission parameters such as tx power for individual
  474. * tx frames.
  475. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  476. * as a suffix to the VERSION_CONF message to explicitly specify whether
  477. * the target supports the HTT tx MSDU extension descriptor.
  478. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  479. * by the host as lack of target support for the HTT tx MSDU extension
  480. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  481. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  482. * the HTT tx MSDU extension descriptor.
  483. * The host is not required to provide the HTT tx MSDU extension descriptor
  484. * just because the target supports it; the target must check the
  485. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  486. * extension descriptor is present.
  487. */
  488. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  489. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  491. };
  492. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  493. struct htt_option_tlv_header_t hdr;
  494. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  495. } POSTPACK;
  496. /*
  497. * For the tcl data command V2 and higher support added a new
  498. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  499. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  500. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  501. * HTT option TLV for specifying which version of the TCL metadata struct
  502. * should be used:
  503. * V1 -> use htt_tx_tcl_metadata struct
  504. * V2 -> use htt_tx_tcl_metadata_v2 struct
  505. * Old FW will only support V1.
  506. * New FW will support V2. New FW will still support V1, at least during
  507. * a transition period.
  508. * Similarly, old host will only support V1, and new host will support V1 + V2.
  509. *
  510. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  511. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  512. * of TCL metadata the host supports. If the host doesn't provide a
  513. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  514. * is implicitly understood that the host only supports V1.
  515. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  516. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  517. * the host shall use. The target shall only select one of the versions
  518. * supported by the host. If the target doesn't provide a
  519. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  520. * is implicitly understood that the V1 TCL metadata shall be used.
  521. */
  522. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  523. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  524. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  525. };
  526. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  527. struct htt_option_tlv_header_t hdr;
  528. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  529. } POSTPACK;
  530. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  531. HTT_OPTION_TLV_VALUE0_SET(word, value)
  532. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  533. HTT_OPTION_TLV_VALUE0_GET(word)
  534. typedef struct {
  535. union {
  536. /* BIT [11 : 0] :- tag
  537. * BIT [23 : 12] :- length
  538. * BIT [31 : 24] :- reserved
  539. */
  540. A_UINT32 tag__length;
  541. /*
  542. * The following struct is not endian-portable.
  543. * It is suitable for use within the target, which is known to be
  544. * little-endian.
  545. * The host should use the above endian-portable macros to access
  546. * the tag and length bitfields in an endian-neutral manner.
  547. */
  548. struct {
  549. A_UINT32 tag : 12, /* BIT [11 : 0] */
  550. length : 12, /* BIT [23 : 12] */
  551. reserved : 8; /* BIT [31 : 24] */
  552. };
  553. };
  554. } htt_tlv_hdr_t;
  555. /** HTT stats TLV tag values */
  556. typedef enum {
  557. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  558. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  559. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  560. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  561. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  562. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  563. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  564. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  565. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  568. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  569. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  570. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  571. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  572. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  573. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  574. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  575. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  578. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  579. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  580. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  581. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  582. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  583. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  584. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  585. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  586. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  587. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  588. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  589. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  590. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  591. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  592. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  593. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  594. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  595. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  596. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  597. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  598. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  599. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  600. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  602. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  603. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  608. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  611. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  612. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  613. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  614. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  615. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  616. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  617. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  618. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  619. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  620. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  621. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  622. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  623. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  624. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  625. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  626. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  627. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  628. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  629. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  630. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  631. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  632. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  633. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  634. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  635. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  636. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  637. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  638. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  639. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  640. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  641. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  642. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  643. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  644. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  645. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  646. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  647. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  648. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  649. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  650. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  651. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  652. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  655. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  656. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  657. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  658. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  659. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  660. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  661. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  662. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  665. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  666. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  667. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  668. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  669. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  670. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  671. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  674. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  675. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  676. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  677. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  678. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  679. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  680. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  681. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  682. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  683. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  684. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  685. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  686. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  687. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  688. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  689. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  690. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  692. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  693. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  694. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  697. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  698. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  699. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  700. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  701. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  702. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  703. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  704. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  712. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  713. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  714. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  715. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  716. HTT_STATS_MAX_TAG,
  717. } htt_stats_tlv_tag_t;
  718. /* retain deprecated enum name as an alias for the current enum name */
  719. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  720. #define HTT_STATS_TLV_TAG_M 0x00000fff
  721. #define HTT_STATS_TLV_TAG_S 0
  722. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  723. #define HTT_STATS_TLV_LENGTH_S 12
  724. #define HTT_STATS_TLV_TAG_GET(_var) \
  725. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  726. HTT_STATS_TLV_TAG_S)
  727. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  728. do { \
  729. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  730. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  731. } while (0)
  732. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  733. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  734. HTT_STATS_TLV_LENGTH_S)
  735. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  736. do { \
  737. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  738. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  739. } while (0)
  740. /*=== host -> target messages ===============================================*/
  741. enum htt_h2t_msg_type {
  742. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  743. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  744. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  745. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  746. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  747. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  748. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  749. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  750. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  751. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  752. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  753. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  754. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  755. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  756. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  757. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  758. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  759. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  760. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  761. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  762. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  763. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  764. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  765. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  766. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  767. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  768. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  769. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  770. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  771. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  772. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  773. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  774. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  775. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  776. /* keep this last */
  777. HTT_H2T_NUM_MSGS
  778. };
  779. /*
  780. * HTT host to target message type -
  781. * stored in bits 7:0 of the first word of the message
  782. */
  783. #define HTT_H2T_MSG_TYPE_M 0xff
  784. #define HTT_H2T_MSG_TYPE_S 0
  785. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  786. do { \
  787. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  788. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  789. } while (0)
  790. #define HTT_H2T_MSG_TYPE_GET(word) \
  791. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  792. /**
  793. * @brief host -> target version number request message definition
  794. *
  795. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  796. *
  797. *
  798. * |31 24|23 16|15 8|7 0|
  799. * |----------------+----------------+----------------+----------------|
  800. * | reserved | msg type |
  801. * |-------------------------------------------------------------------|
  802. * : option request TLV (optional) |
  803. * :...................................................................:
  804. *
  805. * The VER_REQ message may consist of a single 4-byte word, or may be
  806. * extended with TLVs that specify which HTT options the host is requesting
  807. * from the target.
  808. * The following option TLVs may be appended to the VER_REQ message:
  809. * - HL_SUPPRESS_TX_COMPL_IND
  810. * - HL_MAX_TX_QUEUE_GROUPS
  811. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  812. * may be appended to the VER_REQ message (but only one TLV of each type).
  813. *
  814. * Header fields:
  815. * - MSG_TYPE
  816. * Bits 7:0
  817. * Purpose: identifies this as a version number request message
  818. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  819. */
  820. #define HTT_VER_REQ_BYTES 4
  821. /* TBDXXX: figure out a reasonable number */
  822. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  823. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  824. /**
  825. * @brief HTT tx MSDU descriptor
  826. *
  827. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  828. *
  829. * @details
  830. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  831. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  832. * the target firmware needs for the FW's tx processing, particularly
  833. * for creating the HW msdu descriptor.
  834. * The same HTT tx descriptor is used for HL and LL systems, though
  835. * a few fields within the tx descriptor are used only by LL or
  836. * only by HL.
  837. * The HTT tx descriptor is defined in two manners: by a struct with
  838. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  839. * definitions.
  840. * The target should use the struct def, for simplicitly and clarity,
  841. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  842. * neutral. Specifically, the host shall use the get/set macros built
  843. * around the mask + shift defs.
  844. */
  845. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  846. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  847. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  848. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  849. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  850. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  851. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  852. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  853. #define HTT_TX_VDEV_ID_WORD 0
  854. #define HTT_TX_VDEV_ID_MASK 0x3f
  855. #define HTT_TX_VDEV_ID_SHIFT 16
  856. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  857. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  858. #define HTT_TX_MSDU_LEN_DWORD 1
  859. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  860. /*
  861. * HTT_VAR_PADDR macros
  862. * Allow physical / bus addresses to be either a single 32-bit value,
  863. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  864. */
  865. #define HTT_VAR_PADDR32(var_name) \
  866. A_UINT32 var_name
  867. #define HTT_VAR_PADDR64_LE(var_name) \
  868. struct { \
  869. /* little-endian: lo precedes hi */ \
  870. A_UINT32 lo; \
  871. A_UINT32 hi; \
  872. } var_name
  873. /*
  874. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  875. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  876. * addresses are stored in a XXX-bit field.
  877. * This macro is used to define both htt_tx_msdu_desc32_t and
  878. * htt_tx_msdu_desc64_t structs.
  879. */
  880. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  881. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  882. { \
  883. /* DWORD 0: flags and meta-data */ \
  884. A_UINT32 \
  885. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  886. \
  887. /* pkt_subtype - \
  888. * Detailed specification of the tx frame contents, extending the \
  889. * general specification provided by pkt_type. \
  890. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  891. * pkt_type | pkt_subtype \
  892. * ============================================================== \
  893. * 802.3 | bit 0:3 - Reserved \
  894. * | bit 4: 0x0 - Copy-Engine Classification Results \
  895. * | not appended to the HTT message \
  896. * | 0x1 - Copy-Engine Classification Results \
  897. * | appended to the HTT message in the \
  898. * | format: \
  899. * | [HTT tx desc, frame header, \
  900. * | CE classification results] \
  901. * | The CE classification results begin \
  902. * | at the next 4-byte boundary after \
  903. * | the frame header. \
  904. * ------------+------------------------------------------------- \
  905. * Eth2 | bit 0:3 - Reserved \
  906. * | bit 4: 0x0 - Copy-Engine Classification Results \
  907. * | not appended to the HTT message \
  908. * | 0x1 - Copy-Engine Classification Results \
  909. * | appended to the HTT message. \
  910. * | See the above specification of the \
  911. * | CE classification results location. \
  912. * ------------+------------------------------------------------- \
  913. * native WiFi | bit 0:3 - Reserved \
  914. * | bit 4: 0x0 - Copy-Engine Classification Results \
  915. * | not appended to the HTT message \
  916. * | 0x1 - Copy-Engine Classification Results \
  917. * | appended to the HTT message. \
  918. * | See the above specification of the \
  919. * | CE classification results location. \
  920. * ------------+------------------------------------------------- \
  921. * mgmt | 0x0 - 802.11 MAC header absent \
  922. * | 0x1 - 802.11 MAC header present \
  923. * ------------+------------------------------------------------- \
  924. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  925. * | 0x1 - 802.11 MAC header present \
  926. * | bit 1: 0x0 - allow aggregation \
  927. * | 0x1 - don't allow aggregation \
  928. * | bit 2: 0x0 - perform encryption \
  929. * | 0x1 - don't perform encryption \
  930. * | bit 3: 0x0 - perform tx classification / queuing \
  931. * | 0x1 - don't perform tx classification; \
  932. * | insert the frame into the "misc" \
  933. * | tx queue \
  934. * | bit 4: 0x0 - Copy-Engine Classification Results \
  935. * | not appended to the HTT message \
  936. * | 0x1 - Copy-Engine Classification Results \
  937. * | appended to the HTT message. \
  938. * | See the above specification of the \
  939. * | CE classification results location. \
  940. */ \
  941. pkt_subtype: 5, \
  942. \
  943. /* pkt_type - \
  944. * General specification of the tx frame contents. \
  945. * The htt_pkt_type enum should be used to specify and check the \
  946. * value of this field. \
  947. */ \
  948. pkt_type: 3, \
  949. \
  950. /* vdev_id - \
  951. * ID for the vdev that is sending this tx frame. \
  952. * For certain non-standard packet types, e.g. pkt_type == raw \
  953. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  954. * This field is used primarily for determining where to queue \
  955. * broadcast and multicast frames. \
  956. */ \
  957. vdev_id: 6, \
  958. /* ext_tid - \
  959. * The extended traffic ID. \
  960. * If the TID is unknown, the extended TID is set to \
  961. * HTT_TX_EXT_TID_INVALID. \
  962. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  963. * value of the QoS TID. \
  964. * If the tx frame is non-QoS data, then the extended TID is set to \
  965. * HTT_TX_EXT_TID_NON_QOS. \
  966. * If the tx frame is multicast or broadcast, then the extended TID \
  967. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  968. */ \
  969. ext_tid: 5, \
  970. \
  971. /* postponed - \
  972. * This flag indicates whether the tx frame has been downloaded to \
  973. * the target before but discarded by the target, and now is being \
  974. * downloaded again; or if this is a new frame that is being \
  975. * downloaded for the first time. \
  976. * This flag allows the target to determine the correct order for \
  977. * transmitting new vs. old frames. \
  978. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  979. * This flag only applies to HL systems, since in LL systems, \
  980. * the tx flow control is handled entirely within the target. \
  981. */ \
  982. postponed: 1, \
  983. \
  984. /* extension - \
  985. * This flag indicates whether a HTT tx MSDU extension descriptor \
  986. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  987. * \
  988. * 0x0 - no extension MSDU descriptor is present \
  989. * 0x1 - an extension MSDU descriptor immediately follows the \
  990. * regular MSDU descriptor \
  991. */ \
  992. extension: 1, \
  993. \
  994. /* cksum_offload - \
  995. * This flag indicates whether checksum offload is enabled or not \
  996. * for this frame. Target FW use this flag to turn on HW checksumming \
  997. * 0x0 - No checksum offload \
  998. * 0x1 - L3 header checksum only \
  999. * 0x2 - L4 checksum only \
  1000. * 0x3 - L3 header checksum + L4 checksum \
  1001. */ \
  1002. cksum_offload: 2, \
  1003. \
  1004. /* tx_comp_req - \
  1005. * This flag indicates whether Tx Completion \
  1006. * from fw is required or not. \
  1007. * This flag is only relevant if tx completion is not \
  1008. * universally enabled. \
  1009. * For all LL systems, tx completion is mandatory, \
  1010. * so this flag will be irrelevant. \
  1011. * For HL systems tx completion is optional, but HL systems in which \
  1012. * the bus throughput exceeds the WLAN throughput will \
  1013. * probably want to always use tx completion, and thus \
  1014. * would not check this flag. \
  1015. * This flag is required when tx completions are not used universally, \
  1016. * but are still required for certain tx frames for which \
  1017. * an OTA delivery acknowledgment is needed by the host. \
  1018. * In practice, this would be for HL systems in which the \
  1019. * bus throughput is less than the WLAN throughput. \
  1020. * \
  1021. * 0x0 - Tx Completion Indication from Fw not required \
  1022. * 0x1 - Tx Completion Indication from Fw is required \
  1023. */ \
  1024. tx_compl_req: 1; \
  1025. \
  1026. \
  1027. /* DWORD 1: MSDU length and ID */ \
  1028. A_UINT32 \
  1029. len: 16, /* MSDU length, in bytes */ \
  1030. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1031. * and this id is used to calculate fragmentation \
  1032. * descriptor pointer inside the target based on \
  1033. * the base address, configured inside the target. \
  1034. */ \
  1035. \
  1036. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1037. /* frags_desc_ptr - \
  1038. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1039. * where the tx frame's fragments reside in memory. \
  1040. * This field only applies to LL systems, since in HL systems the \
  1041. * (degenerate single-fragment) fragmentation descriptor is created \
  1042. * within the target. \
  1043. */ \
  1044. _paddr__frags_desc_ptr_; \
  1045. \
  1046. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1047. /* \
  1048. * Peer ID : Target can use this value to know which peer-id packet \
  1049. * destined to. \
  1050. * It's intended to be specified by host in case of NAWDS. \
  1051. */ \
  1052. A_UINT16 peerid; \
  1053. \
  1054. /* \
  1055. * Channel frequency: This identifies the desired channel \
  1056. * frequency (in mhz) for tx frames. This is used by FW to help \
  1057. * determine when it is safe to transmit or drop frames for \
  1058. * off-channel operation. \
  1059. * The default value of zero indicates to FW that the corresponding \
  1060. * VDEV's home channel (if there is one) is the desired channel \
  1061. * frequency. \
  1062. */ \
  1063. A_UINT16 chanfreq; \
  1064. \
  1065. /* Reason reserved is commented is increasing the htt structure size \
  1066. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1067. * A_UINT32 reserved_dword3_bits0_31; \
  1068. */ \
  1069. } POSTPACK
  1070. /* define a htt_tx_msdu_desc32_t type */
  1071. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1072. /* define a htt_tx_msdu_desc64_t type */
  1073. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1074. /*
  1075. * Make htt_tx_msdu_desc_t be an alias for either
  1076. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1077. */
  1078. #if HTT_PADDR64
  1079. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1080. #else
  1081. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1082. #endif
  1083. /* decriptor information for Management frame*/
  1084. /*
  1085. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1086. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1087. */
  1088. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1089. extern A_UINT32 mgmt_hdr_len;
  1090. PREPACK struct htt_mgmt_tx_desc_t {
  1091. A_UINT32 msg_type;
  1092. #if HTT_PADDR64
  1093. A_UINT64 frag_paddr; /* DMAble address of the data */
  1094. #else
  1095. A_UINT32 frag_paddr; /* DMAble address of the data */
  1096. #endif
  1097. A_UINT32 desc_id; /* returned to host during completion
  1098. * to free the meory*/
  1099. A_UINT32 len; /* Fragment length */
  1100. A_UINT32 vdev_id; /* virtual device ID*/
  1101. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1102. } POSTPACK;
  1103. PREPACK struct htt_mgmt_tx_compl_ind {
  1104. A_UINT32 desc_id;
  1105. A_UINT32 status;
  1106. } POSTPACK;
  1107. /*
  1108. * This SDU header size comes from the summation of the following:
  1109. * 1. Max of:
  1110. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1111. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1112. * b. 802.11 header, for raw frames: 36 bytes
  1113. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1114. * QoS header, HT header)
  1115. * c. 802.3 header, for ethernet frames: 14 bytes
  1116. * (destination address, source address, ethertype / length)
  1117. * 2. Max of:
  1118. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1119. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1120. * 3. 802.1Q VLAN header: 4 bytes
  1121. * 4. LLC/SNAP header: 8 bytes
  1122. */
  1123. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1124. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1125. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1126. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1127. A_COMPILE_TIME_ASSERT(
  1128. htt_encap_hdr_size_max_check_nwifi,
  1129. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1130. A_COMPILE_TIME_ASSERT(
  1131. htt_encap_hdr_size_max_check_enet,
  1132. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1133. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1134. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1135. #define HTT_TX_HDR_SIZE_802_1Q 4
  1136. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1137. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1138. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1139. HTT_TX_HDR_SIZE_802_1Q + \
  1140. HTT_TX_HDR_SIZE_LLC_SNAP)
  1141. #define HTT_HL_TX_FRM_HDR_LEN \
  1142. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1143. #define HTT_LL_TX_FRM_HDR_LEN \
  1144. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1145. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1146. /* dword 0 */
  1147. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1148. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1149. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1150. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1151. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1152. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1153. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1154. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1155. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1156. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1157. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1158. #define HTT_TX_DESC_PKT_TYPE_S 13
  1159. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1160. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1161. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1162. #define HTT_TX_DESC_VDEV_ID_S 16
  1163. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1164. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1165. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1166. #define HTT_TX_DESC_EXT_TID_S 22
  1167. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1168. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1169. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1170. #define HTT_TX_DESC_POSTPONED_S 27
  1171. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1172. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1173. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1174. #define HTT_TX_DESC_EXTENSION_S 28
  1175. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1176. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1177. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1178. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1179. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1180. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1181. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1182. #define HTT_TX_DESC_TX_COMP_S 31
  1183. /* dword 1 */
  1184. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1185. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1186. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1187. #define HTT_TX_DESC_FRM_LEN_S 0
  1188. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1189. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1190. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1191. #define HTT_TX_DESC_FRM_ID_S 16
  1192. /* dword 2 */
  1193. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1194. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1195. /* for systems using 64-bit format for bus addresses */
  1196. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1197. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1198. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1199. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1200. /* for systems using 32-bit format for bus addresses */
  1201. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1202. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1203. /* dword 3 */
  1204. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1205. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1206. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1207. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1208. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1209. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1210. #if HTT_PADDR64
  1211. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1212. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1213. #else
  1214. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1215. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1216. #endif
  1217. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1218. #define HTT_TX_DESC_PEER_ID_S 0
  1219. /*
  1220. * TEMPORARY:
  1221. * The original definitions for the PEER_ID fields contained typos
  1222. * (with _DESC_PADDR appended to this PEER_ID field name).
  1223. * Retain deprecated original names for PEER_ID fields until all code that
  1224. * refers to them has been updated.
  1225. */
  1226. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1227. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1228. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1229. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1230. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1231. HTT_TX_DESC_PEER_ID_M
  1232. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1233. HTT_TX_DESC_PEER_ID_S
  1234. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1235. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1236. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1237. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1238. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1239. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1240. #if HTT_PADDR64
  1241. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1242. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1243. #else
  1244. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1245. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1246. #endif
  1247. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1248. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1249. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1250. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1251. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1255. } while (0)
  1256. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1257. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1258. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1261. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1262. } while (0)
  1263. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1264. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1265. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1269. } while (0)
  1270. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1271. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1272. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1276. } while (0)
  1277. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1278. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1279. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1283. } while (0)
  1284. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1285. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1286. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1290. } while (0)
  1291. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1292. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1293. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1297. } while (0)
  1298. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1299. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1300. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1304. } while (0)
  1305. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1306. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1307. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1311. } while (0)
  1312. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1313. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1314. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1318. } while (0)
  1319. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1320. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1321. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1322. do { \
  1323. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1324. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1325. } while (0)
  1326. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1327. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1328. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1332. } while (0)
  1333. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1334. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1335. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1339. } while (0)
  1340. /* enums used in the HTT tx MSDU extension descriptor */
  1341. enum {
  1342. htt_tx_guard_interval_regular = 0,
  1343. htt_tx_guard_interval_short = 1,
  1344. };
  1345. enum {
  1346. htt_tx_preamble_type_ofdm = 0,
  1347. htt_tx_preamble_type_cck = 1,
  1348. htt_tx_preamble_type_ht = 2,
  1349. htt_tx_preamble_type_vht = 3,
  1350. };
  1351. enum {
  1352. htt_tx_bandwidth_5MHz = 0,
  1353. htt_tx_bandwidth_10MHz = 1,
  1354. htt_tx_bandwidth_20MHz = 2,
  1355. htt_tx_bandwidth_40MHz = 3,
  1356. htt_tx_bandwidth_80MHz = 4,
  1357. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1358. };
  1359. /**
  1360. * @brief HTT tx MSDU extension descriptor
  1361. * @details
  1362. * If the target supports HTT tx MSDU extension descriptors, the host has
  1363. * the option of appending the following struct following the regular
  1364. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1365. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1366. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1367. * tx specs for each frame.
  1368. */
  1369. PREPACK struct htt_tx_msdu_desc_ext_t {
  1370. /* DWORD 0: flags */
  1371. A_UINT32
  1372. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1373. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1374. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1375. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1376. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1377. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1378. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1379. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1380. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1381. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1382. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1383. /* DWORD 1: tx power, tx rate, tx BW */
  1384. A_UINT32
  1385. /* pwr -
  1386. * Specify what power the tx frame needs to be transmitted at.
  1387. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1388. * The value needs to be appropriately sign-extended when extracting
  1389. * the value from the message and storing it in a variable that is
  1390. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1391. * automatically handles this sign-extension.)
  1392. * If the transmission uses multiple tx chains, this power spec is
  1393. * the total transmit power, assuming incoherent combination of
  1394. * per-chain power to produce the total power.
  1395. */
  1396. pwr: 8,
  1397. /* mcs_mask -
  1398. * Specify the allowable values for MCS index (modulation and coding)
  1399. * to use for transmitting the frame.
  1400. *
  1401. * For HT / VHT preamble types, this mask directly corresponds to
  1402. * the HT or VHT MCS indices that are allowed. For each bit N set
  1403. * within the mask, MCS index N is allowed for transmitting the frame.
  1404. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1405. * rates versus OFDM rates, so the host has the option of specifying
  1406. * that the target must transmit the frame with CCK or OFDM rates
  1407. * (not HT or VHT), but leaving the decision to the target whether
  1408. * to use CCK or OFDM.
  1409. *
  1410. * For CCK and OFDM, the bits within this mask are interpreted as
  1411. * follows:
  1412. * bit 0 -> CCK 1 Mbps rate is allowed
  1413. * bit 1 -> CCK 2 Mbps rate is allowed
  1414. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1415. * bit 3 -> CCK 11 Mbps rate is allowed
  1416. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1417. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1418. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1419. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1420. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1421. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1422. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1423. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1424. *
  1425. * The MCS index specification needs to be compatible with the
  1426. * bandwidth mask specification. For example, a MCS index == 9
  1427. * specification is inconsistent with a preamble type == VHT,
  1428. * Nss == 1, and channel bandwidth == 20 MHz.
  1429. *
  1430. * Furthermore, the host has only a limited ability to specify to
  1431. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1432. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1433. */
  1434. mcs_mask: 12,
  1435. /* nss_mask -
  1436. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1437. * Each bit in this mask corresponds to a Nss value:
  1438. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1439. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1440. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1441. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1442. * The values in the Nss mask must be suitable for the recipient, e.g.
  1443. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1444. * recipient which only supports 2x2 MIMO.
  1445. */
  1446. nss_mask: 4,
  1447. /* guard_interval -
  1448. * Specify a htt_tx_guard_interval enum value to indicate whether
  1449. * the transmission should use a regular guard interval or a
  1450. * short guard interval.
  1451. */
  1452. guard_interval: 1,
  1453. /* preamble_type_mask -
  1454. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1455. * may choose from for transmitting this frame.
  1456. * The bits in this mask correspond to the values in the
  1457. * htt_tx_preamble_type enum. For example, to allow the target
  1458. * to transmit the frame as either CCK or OFDM, this field would
  1459. * be set to
  1460. * (1 << htt_tx_preamble_type_ofdm) |
  1461. * (1 << htt_tx_preamble_type_cck)
  1462. */
  1463. preamble_type_mask: 4,
  1464. reserved1_31_29: 3; /* unused, set to 0x0 */
  1465. /* DWORD 2: tx chain mask, tx retries */
  1466. A_UINT32
  1467. /* chain_mask - specify which chains to transmit from */
  1468. chain_mask: 4,
  1469. /* retry_limit -
  1470. * Specify the maximum number of transmissions, including the
  1471. * initial transmission, to attempt before giving up if no ack
  1472. * is received.
  1473. * If the tx rate is specified, then all retries shall use the
  1474. * same rate as the initial transmission.
  1475. * If no tx rate is specified, the target can choose whether to
  1476. * retain the original rate during the retransmissions, or to
  1477. * fall back to a more robust rate.
  1478. */
  1479. retry_limit: 4,
  1480. /* bandwidth_mask -
  1481. * Specify what channel widths may be used for the transmission.
  1482. * A value of zero indicates "don't care" - the target may choose
  1483. * the transmission bandwidth.
  1484. * The bits within this mask correspond to the htt_tx_bandwidth
  1485. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1486. * The bandwidth_mask must be consistent with the preamble_type_mask
  1487. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1488. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1489. */
  1490. bandwidth_mask: 6,
  1491. reserved2_31_14: 18; /* unused, set to 0x0 */
  1492. /* DWORD 3: tx expiry time (TSF) LSBs */
  1493. A_UINT32 expire_tsf_lo;
  1494. /* DWORD 4: tx expiry time (TSF) MSBs */
  1495. A_UINT32 expire_tsf_hi;
  1496. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1497. } POSTPACK;
  1498. /* DWORD 0 */
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1503. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1519. /* DWORD 1 */
  1520. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1521. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1522. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1523. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1524. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1525. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1526. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1527. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1528. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1529. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1530. /* DWORD 2 */
  1531. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1532. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1533. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1534. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1535. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1536. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1537. /* DWORD 0 */
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1539. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1540. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1542. do { \
  1543. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1544. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1545. } while (0)
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1547. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1548. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1550. do { \
  1551. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1552. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1553. } while (0)
  1554. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1555. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1556. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1558. do { \
  1559. HTT_CHECK_SET_VAL( \
  1560. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1561. ((_var) |= ((_val) \
  1562. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1563. } while (0)
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1565. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1566. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1568. do { \
  1569. HTT_CHECK_SET_VAL( \
  1570. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1571. ((_var) |= ((_val) \
  1572. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1573. } while (0)
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1575. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1576. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1578. do { \
  1579. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1580. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1581. } while (0)
  1582. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1583. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1584. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1585. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1586. do { \
  1587. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1588. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1589. } while (0)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1591. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1592. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1594. do { \
  1595. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1596. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1597. } while (0)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1599. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1600. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1601. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1602. do { \
  1603. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1604. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1608. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1609. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1613. } while (0)
  1614. /* DWORD 1 */
  1615. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1617. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1618. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1619. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1620. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1621. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1622. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1623. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1624. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1625. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1626. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1627. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1628. do { \
  1629. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1630. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1631. } while (0)
  1632. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1634. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1635. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1638. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1639. } while (0)
  1640. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1641. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1642. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1643. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1646. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1647. } while (0)
  1648. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1649. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1650. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1651. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1652. do { \
  1653. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1654. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1655. } while (0)
  1656. /* DWORD 2 */
  1657. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1659. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1660. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1667. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1668. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1675. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1676. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1679. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1680. } while (0)
  1681. typedef enum {
  1682. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1683. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1684. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1685. } htt_11ax_ltf_subtype_t;
  1686. typedef enum {
  1687. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1688. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1689. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1690. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1691. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1692. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1693. } htt_tx_ext2_preamble_type_t;
  1694. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1695. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1696. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1697. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1698. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1699. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1700. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1701. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1702. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1703. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1704. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1705. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1706. /**
  1707. * @brief HTT tx MSDU extension descriptor v2
  1708. * @details
  1709. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1710. * is received as tcl_exit_base->host_meta_info in firmware.
  1711. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1712. * are already part of tcl_exit_base.
  1713. */
  1714. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1715. /* DWORD 0: flags */
  1716. A_UINT32
  1717. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1718. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1719. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1720. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1721. valid_retries : 1, /* if set, tx retries spec is valid */
  1722. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1723. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1724. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1725. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1726. valid_key_flags : 1, /* if set, key flags is valid */
  1727. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1728. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1729. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1730. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1731. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1732. 1 = ENCRYPT,
  1733. 2 ~ 3 - Reserved */
  1734. /* retry_limit -
  1735. * Specify the maximum number of transmissions, including the
  1736. * initial transmission, to attempt before giving up if no ack
  1737. * is received.
  1738. * If the tx rate is specified, then all retries shall use the
  1739. * same rate as the initial transmission.
  1740. * If no tx rate is specified, the target can choose whether to
  1741. * retain the original rate during the retransmissions, or to
  1742. * fall back to a more robust rate.
  1743. */
  1744. retry_limit : 4,
  1745. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1746. * Valid only for 11ax preamble types HE_SU
  1747. * and HE_EXT_SU
  1748. */
  1749. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1750. * Valid only for 11ax preamble types HE_SU
  1751. * and HE_EXT_SU
  1752. */
  1753. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1754. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1755. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1756. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1757. */
  1758. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1759. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1760. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1761. * Use cases:
  1762. * Any time firmware uses TQM-BYPASS for Data
  1763. * TID, firmware expect host to set this bit.
  1764. */
  1765. /* DWORD 1: tx power, tx rate */
  1766. A_UINT32
  1767. power : 8, /* unit of the power field is 0.5 dbm
  1768. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1769. * signed value ranging from -64dbm to 63.5 dbm
  1770. */
  1771. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1772. * Setting more than one MCS 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 MCS values.
  1777. */
  1778. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1779. * Setting more than one Nss isn't currently
  1780. * supported by the target (but is supported
  1781. * in the interface in case in the future
  1782. * the target supports specifications of
  1783. * a limited set of Nss values.
  1784. */
  1785. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1786. update_peer_cache : 1; /* When set these custom values will be
  1787. * used for all packets, until the next
  1788. * update via this ext header.
  1789. * This is to make sure not all packets
  1790. * need to include this header.
  1791. */
  1792. /* DWORD 2: tx chain mask, tx retries */
  1793. A_UINT32
  1794. /* chain_mask - specify which chains to transmit from */
  1795. chain_mask : 8,
  1796. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1797. * TODO: Update Enum values for key_flags
  1798. */
  1799. /*
  1800. * Channel frequency: This identifies the desired channel
  1801. * frequency (in MHz) for tx frames. This is used by FW to help
  1802. * determine when it is safe to transmit or drop frames for
  1803. * off-channel operation.
  1804. * The default value of zero indicates to FW that the corresponding
  1805. * VDEV's home channel (if there is one) is the desired channel
  1806. * frequency.
  1807. */
  1808. chanfreq : 16;
  1809. /* DWORD 3: tx expiry time (TSF) LSBs */
  1810. A_UINT32 expire_tsf_lo;
  1811. /* DWORD 4: tx expiry time (TSF) MSBs */
  1812. A_UINT32 expire_tsf_hi;
  1813. /* DWORD 5: flags to control routing / processing of the MSDU */
  1814. A_UINT32
  1815. /* learning_frame
  1816. * When this flag is set, this frame will be dropped by FW
  1817. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1818. */
  1819. learning_frame : 1,
  1820. /* send_as_standalone
  1821. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1822. * i.e. with no A-MSDU or A-MPDU aggregation.
  1823. * The scope is extended to other use-cases.
  1824. */
  1825. send_as_standalone : 1,
  1826. /* is_host_opaque_valid
  1827. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1828. * with valid information.
  1829. */
  1830. is_host_opaque_valid : 1,
  1831. traffic_end_indication: 1,
  1832. rsvd0 : 28;
  1833. /* DWORD 6 : Host opaque cookie for special frames */
  1834. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1835. rsvd1 : 16;
  1836. /*
  1837. * This structure can be expanded further up to 40 bytes
  1838. * by adding further DWORDs as needed.
  1839. */
  1840. } POSTPACK;
  1841. /* DWORD 0 */
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1868. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1869. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1870. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1871. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1872. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1873. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1874. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1875. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1876. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1877. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1878. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1879. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1880. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1881. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1882. /* DWORD 1 */
  1883. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1884. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1885. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1886. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1887. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1888. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1889. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1890. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1891. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1892. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1893. /* DWORD 2 */
  1894. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1895. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1896. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1897. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1898. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1899. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1900. /* DWORD 5 */
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1907. /* DWORD 6 */
  1908. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1909. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1910. /* DWORD 0 */
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1912. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1913. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1915. do { \
  1916. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1917. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1918. } while (0)
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1920. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1921. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1923. do { \
  1924. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1925. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1926. } while (0)
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1928. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1929. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1931. do { \
  1932. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1933. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1934. } while (0)
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1936. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL( \
  1941. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1942. ((_var) |= ((_val) \
  1943. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1944. } while (0)
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1946. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1947. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1952. } while (0)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1954. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1955. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1960. } while (0)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1962. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1963. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL( \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1968. ((_var) |= ((_val) \
  1969. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1970. } while (0)
  1971. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1972. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1973. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1974. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1978. } while (0)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1980. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1981. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1986. } while (0)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1994. } while (0)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1996. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1997. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1998. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2002. } while (0)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2004. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2005. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2006. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2010. } while (0)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2012. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2013. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2014. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2018. } while (0)
  2019. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2020. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2021. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2022. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2026. } while (0)
  2027. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2028. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2029. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2030. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2031. do { \
  2032. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2033. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2034. } while (0)
  2035. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2036. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2037. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2038. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2039. do { \
  2040. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2041. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2042. } while (0)
  2043. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2044. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2045. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2046. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2047. do { \
  2048. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2049. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2050. } while (0)
  2051. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2052. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2053. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2054. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2055. do { \
  2056. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2057. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2058. } while (0)
  2059. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2066. } while (0)
  2067. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2068. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2069. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2070. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2074. } while (0)
  2075. /* DWORD 1 */
  2076. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2077. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2078. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2079. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2080. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2081. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2082. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2083. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2084. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2085. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2086. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2087. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2088. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2092. } while (0)
  2093. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2094. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2095. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2096. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2100. } while (0)
  2101. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2102. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2103. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2104. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2105. do { \
  2106. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2107. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2108. } while (0)
  2109. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2110. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2111. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2112. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2113. do { \
  2114. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2115. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2116. } while (0)
  2117. /* DWORD 2 */
  2118. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2120. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2121. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2125. } while (0)
  2126. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2127. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2128. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2129. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2130. do { \
  2131. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2132. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2133. } while (0)
  2134. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2135. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2136. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2137. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2138. do { \
  2139. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2140. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2141. } while (0)
  2142. /* DWORD 5 */
  2143. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2144. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2145. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2146. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2150. } while (0)
  2151. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2152. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2153. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2154. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2158. } while (0)
  2159. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2160. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2161. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2162. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2166. } while (0)
  2167. /* DWORD 6 */
  2168. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2169. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2170. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2171. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2175. } while (0)
  2176. typedef enum {
  2177. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2178. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2179. } htt_tcl_metadata_type;
  2180. /**
  2181. * @brief HTT TCL command number format
  2182. * @details
  2183. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2184. * available to firmware as tcl_exit_base->tcl_status_number.
  2185. * For regular / multicast packets host will send vdev and mac id and for
  2186. * NAWDS packets, host will send peer id.
  2187. * A_UINT32 is used to avoid endianness conversion problems.
  2188. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2189. */
  2190. typedef struct {
  2191. A_UINT32
  2192. type: 1, /* vdev_id based or peer_id based */
  2193. rsvd: 31;
  2194. } htt_tx_tcl_vdev_or_peer_t;
  2195. typedef struct {
  2196. A_UINT32
  2197. type: 1, /* vdev_id based or peer_id based */
  2198. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2199. vdev_id: 8,
  2200. pdev_id: 2,
  2201. host_inspected:1,
  2202. rsvd: 19;
  2203. } htt_tx_tcl_vdev_metadata;
  2204. typedef struct {
  2205. A_UINT32
  2206. type: 1, /* vdev_id based or peer_id based */
  2207. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2208. peer_id: 14,
  2209. rsvd: 16;
  2210. } htt_tx_tcl_peer_metadata;
  2211. PREPACK struct htt_tx_tcl_metadata {
  2212. union {
  2213. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2214. htt_tx_tcl_vdev_metadata vdev_meta;
  2215. htt_tx_tcl_peer_metadata peer_meta;
  2216. };
  2217. } POSTPACK;
  2218. /* DWORD 0 */
  2219. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2220. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2221. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2222. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2223. /* VDEV metadata */
  2224. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2225. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2226. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2227. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2228. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2229. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2230. /* PEER metadata */
  2231. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2232. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2233. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2234. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2235. HTT_TX_TCL_METADATA_TYPE_S)
  2236. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2237. do { \
  2238. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2239. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2240. } while (0)
  2241. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2242. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2243. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2244. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2245. do { \
  2246. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2247. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2248. } while (0)
  2249. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2250. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2251. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2252. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2255. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2256. } while (0)
  2257. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2258. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2259. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2260. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2264. } while (0)
  2265. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2266. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2267. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2268. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2272. } while (0)
  2273. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2274. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2275. HTT_TX_TCL_METADATA_PEER_ID_S)
  2276. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2280. } while (0)
  2281. /*------------------------------------------------------------------
  2282. * V2 Version of TCL Data Command
  2283. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2284. * MLO global_seq all flavours of TCL Data Cmd.
  2285. *-----------------------------------------------------------------*/
  2286. typedef enum {
  2287. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2288. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2289. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2290. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2291. } htt_tcl_metadata_type_v2;
  2292. /**
  2293. * @brief HTT TCL command number format
  2294. * @details
  2295. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2296. * available to firmware as tcl_exit_base->tcl_status_number.
  2297. * A_UINT32 is used to avoid endianness conversion problems.
  2298. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2299. */
  2300. typedef struct {
  2301. A_UINT32
  2302. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2303. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2304. vdev_id: 8,
  2305. pdev_id: 2,
  2306. host_inspected:1,
  2307. rsvd: 2,
  2308. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2309. } htt_tx_tcl_vdev_metadata_v2;
  2310. typedef struct {
  2311. A_UINT32
  2312. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2313. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2314. peer_id: 13,
  2315. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2316. } htt_tx_tcl_peer_metadata_v2;
  2317. typedef struct {
  2318. A_UINT32
  2319. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2320. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2321. svc_class_id: 8,
  2322. rsvd: 5,
  2323. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2324. } htt_tx_tcl_svc_class_id_metadata;
  2325. typedef struct {
  2326. A_UINT32
  2327. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2328. host_inspected: 1,
  2329. global_seq_no: 12,
  2330. rsvd: 1,
  2331. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2332. } htt_tx_tcl_global_seq_metadata;
  2333. PREPACK struct htt_tx_tcl_metadata_v2 {
  2334. union {
  2335. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2336. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2337. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2338. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2339. };
  2340. } POSTPACK;
  2341. /* DWORD 0 */
  2342. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2343. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2344. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2345. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2346. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2347. /* VDEV V2 metadata */
  2348. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2349. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2350. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2351. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2352. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2353. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2354. /* PEER V2 metadata */
  2355. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2356. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2357. /* SVC_CLASS_ID metadata */
  2358. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2359. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2360. /* Global Seq no metadata */
  2361. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2362. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2363. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2364. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2365. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2366. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2367. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2368. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2369. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2370. do { \
  2371. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2372. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2373. } while (0)
  2374. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2375. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2376. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2377. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2378. do { \
  2379. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2380. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2381. } while (0)
  2382. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2383. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2384. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2385. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2386. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2387. do { \
  2388. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2389. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2390. } while (0)
  2391. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2392. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2393. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2394. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2395. do { \
  2396. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2397. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2398. } while (0)
  2399. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2400. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2401. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2402. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2403. do { \
  2404. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2405. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2406. } while (0)
  2407. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2408. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2409. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2410. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2411. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2412. do { \
  2413. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2414. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2415. } while (0)
  2416. /*----- Get and Set V2 type field in Service Class fields ----*/
  2417. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2418. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2419. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2420. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2424. } while (0)
  2425. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2426. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2427. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2428. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2429. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2430. do { \
  2431. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2432. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2433. } while (0)
  2434. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2435. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2436. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2437. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2438. do { \
  2439. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2440. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2441. } while (0)
  2442. /*------------------------------------------------------------------
  2443. * End V2 Version of TCL Data Command
  2444. *-----------------------------------------------------------------*/
  2445. typedef enum {
  2446. HTT_TX_FW2WBM_TX_STATUS_OK,
  2447. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2448. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2449. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2450. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2451. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2452. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2453. HTT_TX_FW2WBM_TX_STATUS_MAX
  2454. } htt_tx_fw2wbm_tx_status_t;
  2455. typedef enum {
  2456. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2457. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2458. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2459. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2460. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2461. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2462. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2463. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2464. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2465. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2466. } htt_tx_fw2wbm_reinject_reason_t;
  2467. /**
  2468. * @brief HTT TX WBM Completion from firmware to host
  2469. * @details
  2470. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2471. * DWORD 3 and 4 for software based completions (Exception frames and
  2472. * TQM bypass frames)
  2473. * For software based completions, wbm_release_ring->release_source_module will
  2474. * be set to release_source_fw
  2475. */
  2476. PREPACK struct htt_tx_wbm_completion {
  2477. A_UINT32
  2478. sch_cmd_id: 24,
  2479. exception_frame: 1, /* If set, this packet was queued via exception path */
  2480. rsvd0_31_25: 7;
  2481. A_UINT32
  2482. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2483. * reception of an ACK or BA, this field indicates
  2484. * the RSSI of the received ACK or BA frame.
  2485. * When the frame is removed as result of a direct
  2486. * remove command from the SW, this field is set
  2487. * to 0x0 (which is never a valid value when real
  2488. * RSSI is available).
  2489. * Units: dB w.r.t noise floor
  2490. */
  2491. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2492. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2493. rsvd1_31_16: 16;
  2494. } POSTPACK;
  2495. /* DWORD 0 */
  2496. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2497. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2498. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2499. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2500. /* DWORD 1 */
  2501. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2502. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2503. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2504. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2505. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2506. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2507. /* DWORD 0 */
  2508. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2509. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2510. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2511. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2512. do { \
  2513. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2514. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2515. } while (0)
  2516. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2517. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2518. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2519. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2520. do { \
  2521. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2522. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2523. } while (0)
  2524. /* DWORD 1 */
  2525. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2526. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2527. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2528. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2529. do { \
  2530. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2531. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2532. } while (0)
  2533. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2534. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2535. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2536. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2537. do { \
  2538. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2539. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2540. } while (0)
  2541. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2542. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2543. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2544. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2545. do { \
  2546. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2547. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2548. } while (0)
  2549. /**
  2550. * @brief HTT TX WBM Completion from firmware to host
  2551. * @details
  2552. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2553. * (WBM) offload HW.
  2554. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2555. * For software based completions, release_source_module will
  2556. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2557. * struct wbm_release_ring and then switch to this after looking at
  2558. * release_source_module.
  2559. */
  2560. PREPACK struct htt_tx_wbm_completion_v2 {
  2561. A_UINT32
  2562. used_by_hw0; /* Refer to struct wbm_release_ring */
  2563. A_UINT32
  2564. used_by_hw1; /* Refer to struct wbm_release_ring */
  2565. A_UINT32
  2566. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2567. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2568. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2569. exception_frame: 1,
  2570. rsvd0: 12, /* For future use */
  2571. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2572. rsvd1: 1; /* For future use */
  2573. A_UINT32
  2574. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2575. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2576. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2577. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2578. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2579. */
  2580. A_UINT32
  2581. data1: 32;
  2582. A_UINT32
  2583. data2: 32;
  2584. A_UINT32
  2585. used_by_hw3; /* Refer to struct wbm_release_ring */
  2586. } POSTPACK;
  2587. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2588. /* DWORD 3 */
  2589. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2590. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2591. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2592. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2593. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2594. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2595. /* DWORD 3 */
  2596. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2597. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2598. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2599. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2600. do { \
  2601. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2602. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2603. } while (0)
  2604. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2605. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2606. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2607. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2608. do { \
  2609. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2610. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2611. } while (0)
  2612. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2613. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2614. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2615. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2618. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2619. } while (0)
  2620. /**
  2621. * @brief HTT TX WBM Completion from firmware to host (V3)
  2622. * @details
  2623. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2624. * (WBM) offload HW.
  2625. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2626. * For software based completions, release_source_module will
  2627. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2628. * struct wbm_release_ring and then switch to this after looking at
  2629. * release_source_module.
  2630. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2631. * by new generations of targets.
  2632. */
  2633. PREPACK struct htt_tx_wbm_completion_v3 {
  2634. A_UINT32
  2635. used_by_hw0; /* Refer to struct wbm_release_ring */
  2636. A_UINT32
  2637. used_by_hw1; /* Refer to struct wbm_release_ring */
  2638. A_UINT32
  2639. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2640. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2641. used_by_hw3: 15;
  2642. A_UINT32
  2643. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2644. exception_frame: 1,
  2645. rsvd0: 27; /* For future use */
  2646. A_UINT32
  2647. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2648. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2649. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2650. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2651. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2652. */
  2653. A_UINT32
  2654. data1: 32;
  2655. A_UINT32
  2656. data2: 32;
  2657. A_UINT32
  2658. rsvd1: 20,
  2659. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2660. } POSTPACK;
  2661. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2662. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2663. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2664. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2665. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2666. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2667. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2668. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2669. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2670. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2671. do { \
  2672. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2673. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2674. } while (0)
  2675. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2676. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2677. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2678. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2679. do { \
  2680. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2681. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2682. } while (0)
  2683. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2684. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2685. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2686. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2687. do { \
  2688. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2689. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2690. } while (0)
  2691. typedef enum {
  2692. TX_FRAME_TYPE_UNDEFINED = 0,
  2693. TX_FRAME_TYPE_EAPOL = 1,
  2694. } htt_tx_wbm_status_frame_type;
  2695. /**
  2696. * @brief HTT TX WBM transmit status from firmware to host
  2697. * @details
  2698. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2699. * (WBM) offload HW.
  2700. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2701. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2702. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2703. */
  2704. PREPACK struct htt_tx_wbm_transmit_status {
  2705. A_UINT32
  2706. sch_cmd_id: 24,
  2707. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2708. * reception of an ACK or BA, this field indicates
  2709. * the RSSI of the received ACK or BA frame.
  2710. * When the frame is removed as result of a direct
  2711. * remove command from the SW, this field is set
  2712. * to 0x0 (which is never a valid value when real
  2713. * RSSI is available).
  2714. * Units: dB w.r.t noise floor
  2715. */
  2716. A_UINT32
  2717. sw_peer_id: 16,
  2718. tid_num: 5,
  2719. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2720. * and tid_num fields contain valid data.
  2721. * If this "valid" flag is not set, the
  2722. * sw_peer_id and tid_num fields must be ignored.
  2723. */
  2724. mcast: 1,
  2725. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2726. * contains valid data.
  2727. */
  2728. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2729. reserved: 4;
  2730. A_UINT32
  2731. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2732. * packets in the wbm completion path
  2733. */
  2734. } POSTPACK;
  2735. /* DWORD 4 */
  2736. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2737. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2738. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2739. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2740. /* DWORD 5 */
  2741. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2742. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2743. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2744. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2745. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2746. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2747. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2748. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2749. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2750. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2751. /* DWORD 4 */
  2752. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2753. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2754. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2755. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2756. do { \
  2757. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2758. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2759. } while (0)
  2760. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2761. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2762. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2763. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2764. do { \
  2765. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2766. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2767. } while (0)
  2768. /* DWORD 5 */
  2769. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2770. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2771. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2772. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2775. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2776. } while (0)
  2777. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2778. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2779. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2780. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2781. do { \
  2782. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2783. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2784. } while (0)
  2785. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2786. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2787. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2788. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2789. do { \
  2790. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2791. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2792. } while (0)
  2793. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2794. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2795. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2796. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2799. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2800. } while (0)
  2801. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2802. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2803. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2804. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2807. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2808. } while (0)
  2809. /**
  2810. * @brief HTT TX WBM reinject status from firmware to host
  2811. * @details
  2812. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2813. * (WBM) offload HW.
  2814. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2815. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2816. */
  2817. PREPACK struct htt_tx_wbm_reinject_status {
  2818. A_UINT32
  2819. reserved0: 32;
  2820. A_UINT32
  2821. reserved1: 32;
  2822. A_UINT32
  2823. reserved2: 32;
  2824. } POSTPACK;
  2825. /**
  2826. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2827. * @details
  2828. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2829. * (WBM) offload HW.
  2830. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2831. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2832. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2833. * STA side.
  2834. */
  2835. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2836. A_UINT32
  2837. mec_sa_addr_31_0;
  2838. A_UINT32
  2839. mec_sa_addr_47_32: 16,
  2840. sa_ast_index: 16;
  2841. A_UINT32
  2842. vdev_id: 8,
  2843. reserved0: 24;
  2844. } POSTPACK;
  2845. /* DWORD 4 - mec_sa_addr_31_0 */
  2846. /* DWORD 5 */
  2847. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2848. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2849. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2850. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2851. /* DWORD 6 */
  2852. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2853. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2854. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2855. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2856. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2857. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2860. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2861. } while (0)
  2862. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2863. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2864. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2865. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2868. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2869. } while (0)
  2870. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2871. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2872. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2873. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2876. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2877. } while (0)
  2878. typedef enum {
  2879. TX_FLOW_PRIORITY_BE,
  2880. TX_FLOW_PRIORITY_HIGH,
  2881. TX_FLOW_PRIORITY_LOW,
  2882. } htt_tx_flow_priority_t;
  2883. typedef enum {
  2884. TX_FLOW_LATENCY_SENSITIVE,
  2885. TX_FLOW_LATENCY_INSENSITIVE,
  2886. } htt_tx_flow_latency_t;
  2887. typedef enum {
  2888. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2889. TX_FLOW_INTERACTIVE_TRAFFIC,
  2890. TX_FLOW_PERIODIC_TRAFFIC,
  2891. TX_FLOW_BURSTY_TRAFFIC,
  2892. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2893. } htt_tx_flow_traffic_pattern_t;
  2894. /**
  2895. * @brief HTT TX Flow search metadata format
  2896. * @details
  2897. * Host will set this metadata in flow table's flow search entry along with
  2898. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2899. * firmware and TQM ring if the flow search entry wins.
  2900. * This metadata is available to firmware in that first MSDU's
  2901. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2902. * to one of the available flows for specific tid and returns the tqm flow
  2903. * pointer as part of htt_tx_map_flow_info message.
  2904. */
  2905. PREPACK struct htt_tx_flow_metadata {
  2906. A_UINT32
  2907. rsvd0_1_0: 2,
  2908. tid: 4,
  2909. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2910. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2911. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2912. * Else choose final tid based on latency, priority.
  2913. */
  2914. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2915. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2916. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2917. } POSTPACK;
  2918. /* DWORD 0 */
  2919. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2920. #define HTT_TX_FLOW_METADATA_TID_S 2
  2921. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2922. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2923. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2924. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2925. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2926. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2927. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2928. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2929. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2930. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2931. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2932. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2933. /* DWORD 0 */
  2934. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2935. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2936. HTT_TX_FLOW_METADATA_TID_S)
  2937. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2940. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2941. } while (0)
  2942. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2943. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2944. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2945. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2948. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2949. } while (0)
  2950. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2951. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2952. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2953. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2956. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2957. } while (0)
  2958. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2959. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2960. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2961. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2964. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2965. } while (0)
  2966. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2967. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2968. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2969. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2972. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2973. } while (0)
  2974. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2975. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2976. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2977. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2980. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2981. } while (0)
  2982. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2983. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2984. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2985. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2988. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2989. } while (0)
  2990. /**
  2991. * @brief host -> target ADD WDS Entry
  2992. *
  2993. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2994. *
  2995. * @brief host -> target DELETE WDS Entry
  2996. *
  2997. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2998. *
  2999. * @details
  3000. * HTT wds entry from source port learning
  3001. * Host will learn wds entries from rx and send this message to firmware
  3002. * to enable firmware to configure/delete AST entries for wds clients.
  3003. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3004. * and when SA's entry is deleted, firmware removes this AST entry
  3005. *
  3006. * The message would appear as follows:
  3007. *
  3008. * |31 30|29 |17 16|15 8|7 0|
  3009. * |----------------+----------------+----------------+----------------|
  3010. * | rsvd0 |PDVID| vdev_id | msg_type |
  3011. * |-------------------------------------------------------------------|
  3012. * | sa_addr_31_0 |
  3013. * |-------------------------------------------------------------------|
  3014. * | | ta_peer_id | sa_addr_47_32 |
  3015. * |-------------------------------------------------------------------|
  3016. * Where PDVID = pdev_id
  3017. *
  3018. * The message is interpreted as follows:
  3019. *
  3020. * dword0 - b'0:7 - msg_type: This will be set to
  3021. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3022. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3023. *
  3024. * dword0 - b'8:15 - vdev_id
  3025. *
  3026. * dword0 - b'16:17 - pdev_id
  3027. *
  3028. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3029. *
  3030. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3031. *
  3032. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3033. *
  3034. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3035. */
  3036. PREPACK struct htt_wds_entry {
  3037. A_UINT32
  3038. msg_type: 8,
  3039. vdev_id: 8,
  3040. pdev_id: 2,
  3041. rsvd0: 14;
  3042. A_UINT32 sa_addr_31_0;
  3043. A_UINT32
  3044. sa_addr_47_32: 16,
  3045. ta_peer_id: 14,
  3046. rsvd2: 2;
  3047. } POSTPACK;
  3048. /* DWORD 0 */
  3049. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3050. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3051. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3052. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3053. /* DWORD 2 */
  3054. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3055. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3056. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3057. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3058. /* DWORD 0 */
  3059. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3060. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3061. HTT_WDS_ENTRY_VDEV_ID_S)
  3062. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3063. do { \
  3064. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3065. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3066. } while (0)
  3067. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3068. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3069. HTT_WDS_ENTRY_PDEV_ID_S)
  3070. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3071. do { \
  3072. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3073. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3074. } while (0)
  3075. /* DWORD 2 */
  3076. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3077. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3078. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3079. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3080. do { \
  3081. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3082. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3083. } while (0)
  3084. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3085. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3086. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3087. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3088. do { \
  3089. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3090. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3091. } while (0)
  3092. /**
  3093. * @brief MAC DMA rx ring setup specification
  3094. *
  3095. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3096. *
  3097. * @details
  3098. * To allow for dynamic rx ring reconfiguration and to avoid race
  3099. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3100. * it uses. Instead, it sends this message to the target, indicating how
  3101. * the rx ring used by the host should be set up and maintained.
  3102. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3103. * specifications.
  3104. *
  3105. * |31 16|15 8|7 0|
  3106. * |---------------------------------------------------------------|
  3107. * header: | reserved | num rings | msg type |
  3108. * |---------------------------------------------------------------|
  3109. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3110. #if HTT_PADDR64
  3111. * | FW_IDX shadow register physical address (bits 63:32) |
  3112. #endif
  3113. * |---------------------------------------------------------------|
  3114. * | rx ring base physical address (bits 31:0) |
  3115. #if HTT_PADDR64
  3116. * | rx ring base physical address (bits 63:32) |
  3117. #endif
  3118. * |---------------------------------------------------------------|
  3119. * | rx ring buffer size | rx ring length |
  3120. * |---------------------------------------------------------------|
  3121. * | FW_IDX initial value | enabled flags |
  3122. * |---------------------------------------------------------------|
  3123. * | MSDU payload offset | 802.11 header offset |
  3124. * |---------------------------------------------------------------|
  3125. * | PPDU end offset | PPDU start offset |
  3126. * |---------------------------------------------------------------|
  3127. * | MPDU end offset | MPDU start offset |
  3128. * |---------------------------------------------------------------|
  3129. * | MSDU end offset | MSDU start offset |
  3130. * |---------------------------------------------------------------|
  3131. * | frag info offset | rx attention offset |
  3132. * |---------------------------------------------------------------|
  3133. * payload 2, if present, has the same format as payload 1
  3134. * Header fields:
  3135. * - MSG_TYPE
  3136. * Bits 7:0
  3137. * Purpose: identifies this as an rx ring configuration message
  3138. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3139. * - NUM_RINGS
  3140. * Bits 15:8
  3141. * Purpose: indicates whether the host is setting up one rx ring or two
  3142. * Value: 1 or 2
  3143. * Payload:
  3144. * for systems using 64-bit format for bus addresses:
  3145. * - IDX_SHADOW_REG_PADDR_LO
  3146. * Bits 31:0
  3147. * Value: lower 4 bytes of physical address of the host's
  3148. * FW_IDX shadow register
  3149. * - IDX_SHADOW_REG_PADDR_HI
  3150. * Bits 31:0
  3151. * Value: upper 4 bytes of physical address of the host's
  3152. * FW_IDX shadow register
  3153. * - RING_BASE_PADDR_LO
  3154. * Bits 31:0
  3155. * Value: lower 4 bytes of physical address of the host's rx ring
  3156. * - RING_BASE_PADDR_HI
  3157. * Bits 31:0
  3158. * Value: uppper 4 bytes of physical address of the host's rx ring
  3159. * for systems using 32-bit format for bus addresses:
  3160. * - IDX_SHADOW_REG_PADDR
  3161. * Bits 31:0
  3162. * Value: physical address of the host's FW_IDX shadow register
  3163. * - RING_BASE_PADDR
  3164. * Bits 31:0
  3165. * Value: physical address of the host's rx ring
  3166. * - RING_LEN
  3167. * Bits 15:0
  3168. * Value: number of elements in the rx ring
  3169. * - RING_BUF_SZ
  3170. * Bits 31:16
  3171. * Value: size of the buffers referenced by the rx ring, in byte units
  3172. * - ENABLED_FLAGS
  3173. * Bits 15:0
  3174. * Value: 1-bit flags to show whether different rx fields are enabled
  3175. * bit 0: 802.11 header enabled (1) or disabled (0)
  3176. * bit 1: MSDU payload enabled (1) or disabled (0)
  3177. * bit 2: PPDU start enabled (1) or disabled (0)
  3178. * bit 3: PPDU end enabled (1) or disabled (0)
  3179. * bit 4: MPDU start enabled (1) or disabled (0)
  3180. * bit 5: MPDU end enabled (1) or disabled (0)
  3181. * bit 6: MSDU start enabled (1) or disabled (0)
  3182. * bit 7: MSDU end enabled (1) or disabled (0)
  3183. * bit 8: rx attention enabled (1) or disabled (0)
  3184. * bit 9: frag info enabled (1) or disabled (0)
  3185. * bit 10: unicast rx enabled (1) or disabled (0)
  3186. * bit 11: multicast rx enabled (1) or disabled (0)
  3187. * bit 12: ctrl rx enabled (1) or disabled (0)
  3188. * bit 13: mgmt rx enabled (1) or disabled (0)
  3189. * bit 14: null rx enabled (1) or disabled (0)
  3190. * bit 15: phy data rx enabled (1) or disabled (0)
  3191. * - IDX_INIT_VAL
  3192. * Bits 31:16
  3193. * Purpose: Specify the initial value for the FW_IDX.
  3194. * Value: the number of buffers initially present in the host's rx ring
  3195. * - OFFSET_802_11_HDR
  3196. * Bits 15:0
  3197. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3198. * - OFFSET_MSDU_PAYLOAD
  3199. * Bits 31:16
  3200. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3201. * - OFFSET_PPDU_START
  3202. * Bits 15:0
  3203. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3204. * - OFFSET_PPDU_END
  3205. * Bits 31:16
  3206. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3207. * - OFFSET_MPDU_START
  3208. * Bits 15:0
  3209. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3210. * - OFFSET_MPDU_END
  3211. * Bits 31:16
  3212. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3213. * - OFFSET_MSDU_START
  3214. * Bits 15:0
  3215. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3216. * - OFFSET_MSDU_END
  3217. * Bits 31:16
  3218. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3219. * - OFFSET_RX_ATTN
  3220. * Bits 15:0
  3221. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3222. * - OFFSET_FRAG_INFO
  3223. * Bits 31:16
  3224. * Value: offset in QUAD-bytes of frag info table
  3225. */
  3226. /* header fields */
  3227. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3228. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3229. /* payload fields */
  3230. /* for systems using a 64-bit format for bus addresses */
  3231. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3232. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3233. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3234. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3235. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3236. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3237. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3238. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3239. /* for systems using a 32-bit format for bus addresses */
  3240. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3241. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3242. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3243. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3244. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3245. #define HTT_RX_RING_CFG_LEN_S 0
  3246. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3247. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3248. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3249. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3250. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3251. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3252. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3253. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3254. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3255. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3256. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3257. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3258. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3259. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3260. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3261. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3262. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3263. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3264. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3265. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3266. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3267. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3268. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3269. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3270. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3271. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3272. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3273. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3274. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3275. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3276. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3277. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3278. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3279. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3280. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3281. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3282. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3283. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3284. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3285. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3286. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3287. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3288. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3289. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3290. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3291. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3292. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3293. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3294. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3295. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3296. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3297. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3298. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3299. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3300. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3301. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3302. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3303. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3304. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3305. #if HTT_PADDR64
  3306. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3307. #else
  3308. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3309. #endif
  3310. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3311. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3312. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3313. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3314. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3315. do { \
  3316. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3317. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3318. } while (0)
  3319. /* degenerate case for 32-bit fields */
  3320. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3321. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3322. ((_var) = (_val))
  3323. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3324. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3325. ((_var) = (_val))
  3326. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3327. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3328. ((_var) = (_val))
  3329. /* degenerate case for 32-bit fields */
  3330. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3331. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3332. ((_var) = (_val))
  3333. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3334. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3335. ((_var) = (_val))
  3336. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3337. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3338. ((_var) = (_val))
  3339. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3340. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3341. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3342. do { \
  3343. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3344. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3345. } while (0)
  3346. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3347. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3348. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3349. do { \
  3350. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3351. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3352. } while (0)
  3353. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3354. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3355. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3356. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3357. do { \
  3358. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3359. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3360. } while (0)
  3361. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3362. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3363. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3364. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3365. do { \
  3366. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3367. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3368. } while (0)
  3369. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3370. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3371. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3372. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3373. do { \
  3374. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3375. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3376. } while (0)
  3377. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3378. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3379. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3380. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3381. do { \
  3382. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3383. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3384. } while (0)
  3385. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3386. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3387. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3388. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3391. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3392. } while (0)
  3393. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3394. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3395. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3396. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3397. do { \
  3398. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3399. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3400. } while (0)
  3401. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3402. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3403. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3404. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3405. do { \
  3406. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3407. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3408. } while (0)
  3409. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3410. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3411. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3412. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3413. do { \
  3414. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3415. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3416. } while (0)
  3417. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3418. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3419. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3420. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3421. do { \
  3422. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3423. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3424. } while (0)
  3425. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3426. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3427. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3428. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3429. do { \
  3430. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3431. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3432. } while (0)
  3433. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3434. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3435. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3436. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3437. do { \
  3438. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3439. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3440. } while (0)
  3441. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3442. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3443. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3444. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3447. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3448. } while (0)
  3449. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3450. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3451. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3452. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3455. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3456. } while (0)
  3457. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3458. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3459. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3460. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3463. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3464. } while (0)
  3465. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3466. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3467. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3468. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3469. do { \
  3470. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3471. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3472. } while (0)
  3473. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3474. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3475. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3476. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3479. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3480. } while (0)
  3481. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3482. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3483. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3484. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3487. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3488. } while (0)
  3489. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3490. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3491. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3492. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3495. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3496. } while (0)
  3497. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3498. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3499. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3500. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3503. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3504. } while (0)
  3505. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3506. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3507. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3508. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3511. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3512. } while (0)
  3513. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3514. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3515. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3516. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3519. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3520. } while (0)
  3521. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3522. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3523. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3524. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3527. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3528. } while (0)
  3529. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3530. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3531. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3532. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3535. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3536. } while (0)
  3537. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3538. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3539. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3540. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3543. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3544. } while (0)
  3545. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3546. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3547. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3548. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3551. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3552. } while (0)
  3553. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3554. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3555. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3556. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3559. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3560. } while (0)
  3561. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3562. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3563. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3564. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3567. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3568. } while (0)
  3569. /**
  3570. * @brief host -> target FW statistics retrieve
  3571. *
  3572. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3573. *
  3574. * @details
  3575. * The following field definitions describe the format of the HTT host
  3576. * to target FW stats retrieve message. The message specifies the type of
  3577. * stats host wants to retrieve.
  3578. *
  3579. * |31 24|23 16|15 8|7 0|
  3580. * |-----------------------------------------------------------|
  3581. * | stats types request bitmask | msg type |
  3582. * |-----------------------------------------------------------|
  3583. * | stats types reset bitmask | reserved |
  3584. * |-----------------------------------------------------------|
  3585. * | stats type | config value |
  3586. * |-----------------------------------------------------------|
  3587. * | cookie LSBs |
  3588. * |-----------------------------------------------------------|
  3589. * | cookie MSBs |
  3590. * |-----------------------------------------------------------|
  3591. * Header fields:
  3592. * - MSG_TYPE
  3593. * Bits 7:0
  3594. * Purpose: identifies this is a stats upload request message
  3595. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3596. * - UPLOAD_TYPES
  3597. * Bits 31:8
  3598. * Purpose: identifies which types of FW statistics to upload
  3599. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3600. * - RESET_TYPES
  3601. * Bits 31:8
  3602. * Purpose: identifies which types of FW statistics to reset
  3603. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3604. * - CFG_VAL
  3605. * Bits 23:0
  3606. * Purpose: give an opaque configuration value to the specified stats type
  3607. * Value: stats-type specific configuration value
  3608. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3609. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3610. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3611. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3612. * - CFG_STAT_TYPE
  3613. * Bits 31:24
  3614. * Purpose: specify which stats type (if any) the config value applies to
  3615. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3616. * a valid configuration specification
  3617. * - COOKIE_LSBS
  3618. * Bits 31:0
  3619. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3620. * message with its preceding host->target stats request message.
  3621. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3622. * - COOKIE_MSBS
  3623. * Bits 31:0
  3624. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3625. * message with its preceding host->target stats request message.
  3626. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3627. */
  3628. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3629. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3630. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3631. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3632. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3633. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3634. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3635. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3636. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3637. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3638. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3639. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3640. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3641. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3642. do { \
  3643. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3644. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3645. } while (0)
  3646. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3647. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3648. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3649. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3652. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3653. } while (0)
  3654. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3655. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3656. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3657. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3660. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3661. } while (0)
  3662. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3663. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3664. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3665. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3668. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3669. } while (0)
  3670. /**
  3671. * @brief host -> target HTT out-of-band sync request
  3672. *
  3673. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3674. *
  3675. * @details
  3676. * The HTT SYNC tells the target to suspend processing of subsequent
  3677. * HTT host-to-target messages until some other target agent locally
  3678. * informs the target HTT FW that the current sync counter is equal to
  3679. * or greater than (in a modulo sense) the sync counter specified in
  3680. * the SYNC message.
  3681. * This allows other host-target components to synchronize their operation
  3682. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3683. * security key has been downloaded to and activated by the target.
  3684. * In the absence of any explicit synchronization counter value
  3685. * specification, the target HTT FW will use zero as the default current
  3686. * sync value.
  3687. *
  3688. * |31 24|23 16|15 8|7 0|
  3689. * |-----------------------------------------------------------|
  3690. * | reserved | sync count | msg type |
  3691. * |-----------------------------------------------------------|
  3692. * Header fields:
  3693. * - MSG_TYPE
  3694. * Bits 7:0
  3695. * Purpose: identifies this as a sync message
  3696. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3697. * - SYNC_COUNT
  3698. * Bits 15:8
  3699. * Purpose: specifies what sync value the HTT FW will wait for from
  3700. * an out-of-band specification to resume its operation
  3701. * Value: in-band sync counter value to compare against the out-of-band
  3702. * counter spec.
  3703. * The HTT target FW will suspend its host->target message processing
  3704. * as long as
  3705. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3706. */
  3707. #define HTT_H2T_SYNC_MSG_SZ 4
  3708. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3709. #define HTT_H2T_SYNC_COUNT_S 8
  3710. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3711. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3712. HTT_H2T_SYNC_COUNT_S)
  3713. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3714. do { \
  3715. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3716. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3717. } while (0)
  3718. /**
  3719. * @brief host -> target HTT aggregation configuration
  3720. *
  3721. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3722. */
  3723. #define HTT_AGGR_CFG_MSG_SZ 4
  3724. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3725. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3726. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3727. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3728. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3729. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3730. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3731. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3732. do { \
  3733. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3734. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3735. } while (0)
  3736. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3737. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3738. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3739. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3740. do { \
  3741. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3742. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3743. } while (0)
  3744. /**
  3745. * @brief host -> target HTT configure max amsdu info per vdev
  3746. *
  3747. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3748. *
  3749. * @details
  3750. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3751. *
  3752. * |31 21|20 16|15 8|7 0|
  3753. * |-----------------------------------------------------------|
  3754. * | reserved | vdev id | max amsdu | msg type |
  3755. * |-----------------------------------------------------------|
  3756. * Header fields:
  3757. * - MSG_TYPE
  3758. * Bits 7:0
  3759. * Purpose: identifies this as a aggr cfg ex message
  3760. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3761. * - MAX_NUM_AMSDU_SUBFRM
  3762. * Bits 15:8
  3763. * Purpose: max MSDUs per A-MSDU
  3764. * - VDEV_ID
  3765. * Bits 20:16
  3766. * Purpose: ID of the vdev to which this limit is applied
  3767. */
  3768. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3769. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3770. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3771. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3772. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3773. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3774. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3775. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3776. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3779. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3780. } while (0)
  3781. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3782. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3783. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3784. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3785. do { \
  3786. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3787. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3788. } while (0)
  3789. /**
  3790. * @brief HTT WDI_IPA Config Message
  3791. *
  3792. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3793. *
  3794. * @details
  3795. * The HTT WDI_IPA config message is created/sent by host at driver
  3796. * init time. It contains information about data structures used on
  3797. * WDI_IPA TX and RX path.
  3798. * TX CE ring is used for pushing packet metadata from IPA uC
  3799. * to WLAN FW
  3800. * TX Completion ring is used for generating TX completions from
  3801. * WLAN FW to IPA uC
  3802. * RX Indication ring is used for indicating RX packets from FW
  3803. * to IPA uC
  3804. * RX Ring2 is used as either completion ring or as second
  3805. * indication ring. when Ring2 is used as completion ring, IPA uC
  3806. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3807. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3808. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3809. * indicated in RX Indication ring. Please see WDI_IPA specification
  3810. * for more details.
  3811. * |31 24|23 16|15 8|7 0|
  3812. * |----------------+----------------+----------------+----------------|
  3813. * | tx pkt pool size | Rsvd | msg_type |
  3814. * |-------------------------------------------------------------------|
  3815. * | tx comp ring base (bits 31:0) |
  3816. #if HTT_PADDR64
  3817. * | tx comp ring base (bits 63:32) |
  3818. #endif
  3819. * |-------------------------------------------------------------------|
  3820. * | tx comp ring size |
  3821. * |-------------------------------------------------------------------|
  3822. * | tx comp WR_IDX physical address (bits 31:0) |
  3823. #if HTT_PADDR64
  3824. * | tx comp WR_IDX physical address (bits 63:32) |
  3825. #endif
  3826. * |-------------------------------------------------------------------|
  3827. * | tx CE WR_IDX physical address (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | tx CE WR_IDX physical address (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | rx indication ring base (bits 31:0) |
  3833. #if HTT_PADDR64
  3834. * | rx indication ring base (bits 63:32) |
  3835. #endif
  3836. * |-------------------------------------------------------------------|
  3837. * | rx indication ring size |
  3838. * |-------------------------------------------------------------------|
  3839. * | rx ind RD_IDX physical address (bits 31:0) |
  3840. #if HTT_PADDR64
  3841. * | rx ind RD_IDX physical address (bits 63:32) |
  3842. #endif
  3843. * |-------------------------------------------------------------------|
  3844. * | rx ind WR_IDX physical address (bits 31:0) |
  3845. #if HTT_PADDR64
  3846. * | rx ind WR_IDX physical address (bits 63:32) |
  3847. #endif
  3848. * |-------------------------------------------------------------------|
  3849. * |-------------------------------------------------------------------|
  3850. * | rx ring2 base (bits 31:0) |
  3851. #if HTT_PADDR64
  3852. * | rx ring2 base (bits 63:32) |
  3853. #endif
  3854. * |-------------------------------------------------------------------|
  3855. * | rx ring2 size |
  3856. * |-------------------------------------------------------------------|
  3857. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3858. #if HTT_PADDR64
  3859. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3860. #endif
  3861. * |-------------------------------------------------------------------|
  3862. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3863. #if HTT_PADDR64
  3864. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3865. #endif
  3866. * |-------------------------------------------------------------------|
  3867. *
  3868. * Header fields:
  3869. * Header fields:
  3870. * - MSG_TYPE
  3871. * Bits 7:0
  3872. * Purpose: Identifies this as WDI_IPA config message
  3873. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3874. * - TX_PKT_POOL_SIZE
  3875. * Bits 15:0
  3876. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3877. * WDI_IPA TX path
  3878. * For systems using 32-bit format for bus addresses:
  3879. * - TX_COMP_RING_BASE_ADDR
  3880. * Bits 31:0
  3881. * Purpose: TX Completion Ring base address in DDR
  3882. * - TX_COMP_RING_SIZE
  3883. * Bits 31:0
  3884. * Purpose: TX Completion Ring size (must be power of 2)
  3885. * - TX_COMP_WR_IDX_ADDR
  3886. * Bits 31:0
  3887. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3888. * updates the Write Index for WDI_IPA TX completion ring
  3889. * - TX_CE_WR_IDX_ADDR
  3890. * Bits 31:0
  3891. * Purpose: DDR address where IPA uC
  3892. * updates the WR Index for TX CE ring
  3893. * (needed for fusion platforms)
  3894. * - RX_IND_RING_BASE_ADDR
  3895. * Bits 31:0
  3896. * Purpose: RX Indication Ring base address in DDR
  3897. * - RX_IND_RING_SIZE
  3898. * Bits 31:0
  3899. * Purpose: RX Indication Ring size
  3900. * - RX_IND_RD_IDX_ADDR
  3901. * Bits 31:0
  3902. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3903. * RX indication ring
  3904. * - RX_IND_WR_IDX_ADDR
  3905. * Bits 31:0
  3906. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3907. * updates the Write Index for WDI_IPA RX indication ring
  3908. * - RX_RING2_BASE_ADDR
  3909. * Bits 31:0
  3910. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3911. * - RX_RING2_SIZE
  3912. * Bits 31:0
  3913. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3914. * - RX_RING2_RD_IDX_ADDR
  3915. * Bits 31:0
  3916. * Purpose: If Second RX ring is Indication ring, DDR address where
  3917. * IPA uC updates the Read Index for Ring2.
  3918. * If Second RX ring is completion ring, this is NOT used
  3919. * - RX_RING2_WR_IDX_ADDR
  3920. * Bits 31:0
  3921. * Purpose: If Second RX ring is Indication ring, DDR address where
  3922. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3923. * If second RX ring is completion ring, DDR address where
  3924. * IPA uC updates the Write Index for Ring 2.
  3925. * For systems using 64-bit format for bus addresses:
  3926. * - TX_COMP_RING_BASE_ADDR_LO
  3927. * Bits 31:0
  3928. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3929. * - TX_COMP_RING_BASE_ADDR_HI
  3930. * Bits 31:0
  3931. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3932. * - TX_COMP_RING_SIZE
  3933. * Bits 31:0
  3934. * Purpose: TX Completion Ring size (must be power of 2)
  3935. * - TX_COMP_WR_IDX_ADDR_LO
  3936. * Bits 31:0
  3937. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3938. * Lower 4 bytes of DDR address where WIFI FW
  3939. * updates the Write Index for WDI_IPA TX completion ring
  3940. * - TX_COMP_WR_IDX_ADDR_HI
  3941. * Bits 31:0
  3942. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3943. * Higher 4 bytes of DDR address where WIFI FW
  3944. * updates the Write Index for WDI_IPA TX completion ring
  3945. * - TX_CE_WR_IDX_ADDR_LO
  3946. * Bits 31:0
  3947. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3948. * updates the WR Index for TX CE ring
  3949. * (needed for fusion platforms)
  3950. * - TX_CE_WR_IDX_ADDR_HI
  3951. * Bits 31:0
  3952. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3953. * updates the WR Index for TX CE ring
  3954. * (needed for fusion platforms)
  3955. * - RX_IND_RING_BASE_ADDR_LO
  3956. * Bits 31:0
  3957. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3958. * - RX_IND_RING_BASE_ADDR_HI
  3959. * Bits 31:0
  3960. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3961. * - RX_IND_RING_SIZE
  3962. * Bits 31:0
  3963. * Purpose: RX Indication Ring size
  3964. * - RX_IND_RD_IDX_ADDR_LO
  3965. * Bits 31:0
  3966. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3967. * for WDI_IPA RX indication ring
  3968. * - RX_IND_RD_IDX_ADDR_HI
  3969. * Bits 31:0
  3970. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3971. * for WDI_IPA RX indication ring
  3972. * - RX_IND_WR_IDX_ADDR_LO
  3973. * Bits 31:0
  3974. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3975. * Lower 4 bytes of DDR address where WIFI FW
  3976. * updates the Write Index for WDI_IPA RX indication ring
  3977. * - RX_IND_WR_IDX_ADDR_HI
  3978. * Bits 31:0
  3979. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3980. * Higher 4 bytes of DDR address where WIFI FW
  3981. * updates the Write Index for WDI_IPA RX indication ring
  3982. * - RX_RING2_BASE_ADDR_LO
  3983. * Bits 31:0
  3984. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3985. * - RX_RING2_BASE_ADDR_HI
  3986. * Bits 31:0
  3987. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3988. * - RX_RING2_SIZE
  3989. * Bits 31:0
  3990. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3991. * - RX_RING2_RD_IDX_ADDR_LO
  3992. * Bits 31:0
  3993. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3994. * DDR address where IPA uC updates the Read Index for Ring2.
  3995. * If Second RX ring is completion ring, this is NOT used
  3996. * - RX_RING2_RD_IDX_ADDR_HI
  3997. * Bits 31:0
  3998. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3999. * DDR address where IPA uC updates the Read Index for Ring2.
  4000. * If Second RX ring is completion ring, this is NOT used
  4001. * - RX_RING2_WR_IDX_ADDR_LO
  4002. * Bits 31:0
  4003. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4004. * DDR address where WIFI FW updates the Write Index
  4005. * for WDI_IPA RX ring2
  4006. * If second RX ring is completion ring, lower 4 bytes of
  4007. * DDR address where IPA uC updates the Write Index for Ring 2.
  4008. * - RX_RING2_WR_IDX_ADDR_HI
  4009. * Bits 31:0
  4010. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4011. * DDR address where WIFI FW updates the Write Index
  4012. * for WDI_IPA RX ring2
  4013. * If second RX ring is completion ring, higher 4 bytes of
  4014. * DDR address where IPA uC updates the Write Index for Ring 2.
  4015. */
  4016. #if HTT_PADDR64
  4017. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4018. #else
  4019. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4020. #endif
  4021. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4022. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4023. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4027. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4029. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4031. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4033. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4035. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4037. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4039. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4041. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4083. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4084. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4085. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4086. do { \
  4087. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4088. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4089. } while (0)
  4090. /* for systems using 32-bit format for bus addr */
  4091. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4092. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4096. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_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_HI_GET(_var) \
  4100. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4101. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4104. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4105. } while (0)
  4106. /* for systems using 64-bit format for bus addr */
  4107. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4108. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4109. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4112. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4113. } while (0)
  4114. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4115. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4117. do { \
  4118. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4119. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4120. } while (0)
  4121. /* for systems using 32-bit format for bus addr */
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4123. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4125. do { \
  4126. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4127. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_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_HI_GET(_var) \
  4131. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4135. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4136. } while (0)
  4137. /* for systems using 64-bit format for bus addr */
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4139. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4140. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4143. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4144. } while (0)
  4145. /* for systems using 32-bit format for bus addr */
  4146. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4147. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4148. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4151. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_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_HI_GET(_var) \
  4155. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4156. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4159. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4160. } while (0)
  4161. /* for systems using 64-bit format for bus addr */
  4162. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4163. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4164. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4167. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4168. } while (0)
  4169. /* for systems using 32-bit format for bus addr */
  4170. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4172. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_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_HI_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4180. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4184. } while (0)
  4185. /* for systems using 64-bit format for bus addr */
  4186. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4187. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4188. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4191. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4192. } while (0)
  4193. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4194. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4198. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4199. } while (0)
  4200. /* for systems using 32-bit format for bus addr */
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4202. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4206. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_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_HI_GET(_var) \
  4210. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4214. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4215. } while (0)
  4216. /* for systems using 64-bit format for bus addr */
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4218. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4223. } while (0)
  4224. /* for systems using 32-bit format for bus addr */
  4225. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4226. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4227. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_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_HI_GET(_var) \
  4234. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4235. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4238. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4239. } while (0)
  4240. /* for systems using 64-bit format for bus addr */
  4241. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4242. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4243. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4246. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4247. } while (0)
  4248. /* for systems using 32-bit format for bus addr */
  4249. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4255. } while (0)
  4256. /* for systems using 64-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4259. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4263. } while (0)
  4264. /* for systems using 64-bit format for bus addr */
  4265. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4266. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4267. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4270. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4271. } while (0)
  4272. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4273. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4275. do { \
  4276. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4277. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4278. } while (0)
  4279. /* for systems using 32-bit format for bus addr */
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4281. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4283. do { \
  4284. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4285. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_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_HI_GET(_var) \
  4289. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4294. } while (0)
  4295. /* for systems using 64-bit format for bus addr */
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4297. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4301. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4302. } while (0)
  4303. /* for systems using 32-bit format for bus addr */
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4305. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4309. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_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_HI_GET(_var) \
  4313. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4317. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4318. } while (0)
  4319. /* for systems using 64-bit format for bus addr */
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4321. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4322. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4325. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4326. } while (0)
  4327. /*
  4328. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4329. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4330. * addresses are stored in a XXX-bit field.
  4331. * This macro is used to define both htt_wdi_ipa_config32_t and
  4332. * htt_wdi_ipa_config64_t structs.
  4333. */
  4334. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4335. _paddr__tx_comp_ring_base_addr_, \
  4336. _paddr__tx_comp_wr_idx_addr_, \
  4337. _paddr__tx_ce_wr_idx_addr_, \
  4338. _paddr__rx_ind_ring_base_addr_, \
  4339. _paddr__rx_ind_rd_idx_addr_, \
  4340. _paddr__rx_ind_wr_idx_addr_, \
  4341. _paddr__rx_ring2_base_addr_,\
  4342. _paddr__rx_ring2_rd_idx_addr_,\
  4343. _paddr__rx_ring2_wr_idx_addr_) \
  4344. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4345. { \
  4346. /* DWORD 0: flags and meta-data */ \
  4347. A_UINT32 \
  4348. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4349. reserved: 8, \
  4350. tx_pkt_pool_size: 16;\
  4351. /* DWORD 1 */\
  4352. _paddr__tx_comp_ring_base_addr_;\
  4353. /* DWORD 2 (or 3)*/\
  4354. A_UINT32 tx_comp_ring_size;\
  4355. /* DWORD 3 (or 4)*/\
  4356. _paddr__tx_comp_wr_idx_addr_;\
  4357. /* DWORD 4 (or 6)*/\
  4358. _paddr__tx_ce_wr_idx_addr_;\
  4359. /* DWORD 5 (or 8)*/\
  4360. _paddr__rx_ind_ring_base_addr_;\
  4361. /* DWORD 6 (or 10)*/\
  4362. A_UINT32 rx_ind_ring_size;\
  4363. /* DWORD 7 (or 11)*/\
  4364. _paddr__rx_ind_rd_idx_addr_;\
  4365. /* DWORD 8 (or 13)*/\
  4366. _paddr__rx_ind_wr_idx_addr_;\
  4367. /* DWORD 9 (or 15)*/\
  4368. _paddr__rx_ring2_base_addr_;\
  4369. /* DWORD 10 (or 17) */\
  4370. A_UINT32 rx_ring2_size;\
  4371. /* DWORD 11 (or 18) */\
  4372. _paddr__rx_ring2_rd_idx_addr_;\
  4373. /* DWORD 12 (or 20) */\
  4374. _paddr__rx_ring2_wr_idx_addr_;\
  4375. } POSTPACK
  4376. /* define a htt_wdi_ipa_config32_t type */
  4377. 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));
  4378. /* define a htt_wdi_ipa_config64_t type */
  4379. 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));
  4380. #if HTT_PADDR64
  4381. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4382. #else
  4383. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4384. #endif
  4385. enum htt_wdi_ipa_op_code {
  4386. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4387. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4388. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4389. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4390. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4391. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4392. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4393. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4394. /* keep this last */
  4395. HTT_WDI_IPA_OPCODE_MAX
  4396. };
  4397. /**
  4398. * @brief HTT WDI_IPA Operation Request Message
  4399. *
  4400. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4401. *
  4402. * @details
  4403. * HTT WDI_IPA Operation Request message is sent by host
  4404. * to either suspend or resume WDI_IPA TX or RX path.
  4405. * |31 24|23 16|15 8|7 0|
  4406. * |----------------+----------------+----------------+----------------|
  4407. * | op_code | Rsvd | msg_type |
  4408. * |-------------------------------------------------------------------|
  4409. *
  4410. * Header fields:
  4411. * - MSG_TYPE
  4412. * Bits 7:0
  4413. * Purpose: Identifies this as WDI_IPA Operation Request message
  4414. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4415. * - OP_CODE
  4416. * Bits 31:16
  4417. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4418. * value: = enum htt_wdi_ipa_op_code
  4419. */
  4420. PREPACK struct htt_wdi_ipa_op_request_t
  4421. {
  4422. /* DWORD 0: flags and meta-data */
  4423. A_UINT32
  4424. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4425. reserved: 8,
  4426. op_code: 16;
  4427. } POSTPACK;
  4428. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4429. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4430. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4431. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4432. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4433. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4434. do { \
  4435. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4436. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4437. } while (0)
  4438. /*
  4439. * @brief host -> target HTT_MSI_SETUP message
  4440. *
  4441. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4442. *
  4443. * @details
  4444. * After target is booted up, host can send MSI setup message so that
  4445. * target sets up HW registers based on setup message.
  4446. *
  4447. * The message would appear as follows:
  4448. * |31 24|23 16|15|14 8|7 0|
  4449. * |---------------+-----------------+-----------------+-----------------|
  4450. * | reserved | msi_type | pdev_id | msg_type |
  4451. * |---------------------------------------------------------------------|
  4452. * | msi_addr_lo |
  4453. * |---------------------------------------------------------------------|
  4454. * | msi_addr_hi |
  4455. * |---------------------------------------------------------------------|
  4456. * | msi_data |
  4457. * |---------------------------------------------------------------------|
  4458. *
  4459. * The message is interpreted as follows:
  4460. * dword0 - b'0:7 - msg_type: This will be set to
  4461. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4462. * b'8:15 - pdev_id:
  4463. * 0 (for rings at SOC/UMAC level),
  4464. * 1/2/3 mac id (for rings at LMAC level)
  4465. * b'16:23 - msi_type: identify which msi registers need to be setup
  4466. * more details can be got from enum htt_msi_setup_type
  4467. * b'24:31 - reserved
  4468. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4469. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4470. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4471. */
  4472. PREPACK struct htt_msi_setup_t {
  4473. A_UINT32 msg_type: 8,
  4474. pdev_id: 8,
  4475. msi_type: 8,
  4476. reserved: 8;
  4477. A_UINT32 msi_addr_lo;
  4478. A_UINT32 msi_addr_hi;
  4479. A_UINT32 msi_data;
  4480. } POSTPACK;
  4481. enum htt_msi_setup_type {
  4482. HTT_PPDU_END_MSI_SETUP_TYPE,
  4483. /* Insert new types here*/
  4484. };
  4485. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4486. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4487. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4488. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4489. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4490. HTT_MSI_SETUP_PDEV_ID_S)
  4491. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4494. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4495. } while (0)
  4496. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4497. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4498. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4499. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4500. HTT_MSI_SETUP_MSI_TYPE_S)
  4501. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4502. do { \
  4503. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4504. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4505. } while (0)
  4506. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4507. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4508. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4509. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4510. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4511. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4514. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4515. } while (0)
  4516. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4517. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4518. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4519. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4520. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4521. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4522. do { \
  4523. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4524. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4525. } while (0)
  4526. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4527. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4528. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4529. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4530. HTT_MSI_SETUP_MSI_DATA_S)
  4531. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4534. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4535. } while (0)
  4536. /*
  4537. * @brief host -> target HTT_SRING_SETUP message
  4538. *
  4539. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4540. *
  4541. * @details
  4542. * After target is booted up, Host can send SRING setup message for
  4543. * each host facing LMAC SRING. Target setups up HW registers based
  4544. * on setup message and confirms back to Host if response_required is set.
  4545. * Host should wait for confirmation message before sending new SRING
  4546. * setup message
  4547. *
  4548. * The message would appear as follows:
  4549. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4550. * |--------------- +-----------------+-----------------+-----------------|
  4551. * | ring_type | ring_id | pdev_id | msg_type |
  4552. * |----------------------------------------------------------------------|
  4553. * | ring_base_addr_lo |
  4554. * |----------------------------------------------------------------------|
  4555. * | ring_base_addr_hi |
  4556. * |----------------------------------------------------------------------|
  4557. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4558. * |----------------------------------------------------------------------|
  4559. * | ring_head_offset32_remote_addr_lo |
  4560. * |----------------------------------------------------------------------|
  4561. * | ring_head_offset32_remote_addr_hi |
  4562. * |----------------------------------------------------------------------|
  4563. * | ring_tail_offset32_remote_addr_lo |
  4564. * |----------------------------------------------------------------------|
  4565. * | ring_tail_offset32_remote_addr_hi |
  4566. * |----------------------------------------------------------------------|
  4567. * | ring_msi_addr_lo |
  4568. * |----------------------------------------------------------------------|
  4569. * | ring_msi_addr_hi |
  4570. * |----------------------------------------------------------------------|
  4571. * | ring_msi_data |
  4572. * |----------------------------------------------------------------------|
  4573. * | intr_timer_th |IM| intr_batch_counter_th |
  4574. * |----------------------------------------------------------------------|
  4575. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4576. * |----------------------------------------------------------------------|
  4577. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4578. * |----------------------------------------------------------------------|
  4579. * Where
  4580. * IM = sw_intr_mode
  4581. * RR = response_required
  4582. * PTCF = prefetch_timer_cfg
  4583. * IP = IPA drop flag
  4584. *
  4585. * The message is interpreted as follows:
  4586. * dword0 - b'0:7 - msg_type: This will be set to
  4587. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4588. * b'8:15 - pdev_id:
  4589. * 0 (for rings at SOC/UMAC level),
  4590. * 1/2/3 mac id (for rings at LMAC level)
  4591. * b'16:23 - ring_id: identify which ring is to setup,
  4592. * more details can be got from enum htt_srng_ring_id
  4593. * b'24:31 - ring_type: identify type of host rings,
  4594. * more details can be got from enum htt_srng_ring_type
  4595. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4596. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4597. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4598. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4599. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4600. * SW_TO_HW_RING.
  4601. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4602. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4603. * Lower 32 bits of memory address of the remote variable
  4604. * storing the 4-byte word offset that identifies the head
  4605. * element within the ring.
  4606. * (The head offset variable has type A_UINT32.)
  4607. * Valid for HW_TO_SW and SW_TO_SW rings.
  4608. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4609. * Upper 32 bits of memory address of the remote variable
  4610. * storing the 4-byte word offset that identifies the head
  4611. * element within the ring.
  4612. * (The head offset variable has type A_UINT32.)
  4613. * Valid for HW_TO_SW and SW_TO_SW rings.
  4614. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4615. * Lower 32 bits of memory address of the remote variable
  4616. * storing the 4-byte word offset that identifies the tail
  4617. * element within the ring.
  4618. * (The tail offset variable has type A_UINT32.)
  4619. * Valid for HW_TO_SW and SW_TO_SW rings.
  4620. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4621. * Upper 32 bits of memory address of the remote variable
  4622. * storing the 4-byte word offset that identifies the tail
  4623. * element within the ring.
  4624. * (The tail offset variable has type A_UINT32.)
  4625. * Valid for HW_TO_SW and SW_TO_SW rings.
  4626. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4627. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4628. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4629. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4630. * dword10 - b'0:31 - ring_msi_data: MSI data
  4631. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4632. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4633. * dword11 - b'0:14 - intr_batch_counter_th:
  4634. * batch counter threshold is in units of 4-byte words.
  4635. * HW internally maintains and increments batch count.
  4636. * (see SRING spec for detail description).
  4637. * When batch count reaches threshold value, an interrupt
  4638. * is generated by HW.
  4639. * b'15 - sw_intr_mode:
  4640. * This configuration shall be static.
  4641. * Only programmed at power up.
  4642. * 0: generate pulse style sw interrupts
  4643. * 1: generate level style sw interrupts
  4644. * b'16:31 - intr_timer_th:
  4645. * The timer init value when timer is idle or is
  4646. * initialized to start downcounting.
  4647. * In 8us units (to cover a range of 0 to 524 ms)
  4648. * dword12 - b'0:15 - intr_low_threshold:
  4649. * Used only by Consumer ring to generate ring_sw_int_p.
  4650. * Ring entries low threshold water mark, that is used
  4651. * in combination with the interrupt timer as well as
  4652. * the the clearing of the level interrupt.
  4653. * b'16:18 - prefetch_timer_cfg:
  4654. * Used only by Consumer ring to set timer mode to
  4655. * support Application prefetch handling.
  4656. * The external tail offset/pointer will be updated
  4657. * at following intervals:
  4658. * 3'b000: (Prefetch feature disabled; used only for debug)
  4659. * 3'b001: 1 usec
  4660. * 3'b010: 4 usec
  4661. * 3'b011: 8 usec (default)
  4662. * 3'b100: 16 usec
  4663. * Others: Reserverd
  4664. * b'19 - response_required:
  4665. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4666. * b'20 - ipa_drop_flag:
  4667. Indicates that host will config ipa drop threshold percentage
  4668. * b'21:31 - reserved: reserved for future use
  4669. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4670. * b'8:15 - ipa drop high threshold percentage:
  4671. * b'16:31 - Reserved
  4672. */
  4673. PREPACK struct htt_sring_setup_t {
  4674. A_UINT32 msg_type: 8,
  4675. pdev_id: 8,
  4676. ring_id: 8,
  4677. ring_type: 8;
  4678. A_UINT32 ring_base_addr_lo;
  4679. A_UINT32 ring_base_addr_hi;
  4680. A_UINT32 ring_size: 16,
  4681. ring_entry_size: 8,
  4682. ring_misc_cfg_flag: 8;
  4683. A_UINT32 ring_head_offset32_remote_addr_lo;
  4684. A_UINT32 ring_head_offset32_remote_addr_hi;
  4685. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4686. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4687. A_UINT32 ring_msi_addr_lo;
  4688. A_UINT32 ring_msi_addr_hi;
  4689. A_UINT32 ring_msi_data;
  4690. A_UINT32 intr_batch_counter_th: 15,
  4691. sw_intr_mode: 1,
  4692. intr_timer_th: 16;
  4693. A_UINT32 intr_low_threshold: 16,
  4694. prefetch_timer_cfg: 3,
  4695. response_required: 1,
  4696. ipa_drop_flag: 1,
  4697. reserved1: 11;
  4698. A_UINT32 ipa_drop_low_threshold: 8,
  4699. ipa_drop_high_threshold: 8,
  4700. reserved: 16;
  4701. } POSTPACK;
  4702. enum htt_srng_ring_type {
  4703. HTT_HW_TO_SW_RING = 0,
  4704. HTT_SW_TO_HW_RING,
  4705. HTT_SW_TO_SW_RING,
  4706. /* Insert new ring types above this line */
  4707. };
  4708. enum htt_srng_ring_id {
  4709. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4710. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4711. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4712. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4713. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4714. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4715. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4716. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4717. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4718. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4719. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4720. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4721. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4722. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4723. /* Add Other SRING which can't be directly configured by host software above this line */
  4724. };
  4725. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4726. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4727. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4728. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4729. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4730. HTT_SRING_SETUP_PDEV_ID_S)
  4731. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4732. do { \
  4733. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4734. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4735. } while (0)
  4736. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4737. #define HTT_SRING_SETUP_RING_ID_S 16
  4738. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4739. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4740. HTT_SRING_SETUP_RING_ID_S)
  4741. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4742. do { \
  4743. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4744. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4745. } while (0)
  4746. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4747. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4748. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4749. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4750. HTT_SRING_SETUP_RING_TYPE_S)
  4751. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4752. do { \
  4753. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4754. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4755. } while (0)
  4756. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4757. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4758. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4759. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4760. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4761. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4762. do { \
  4763. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4764. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4765. } while (0)
  4766. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4767. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4768. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4769. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4770. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4771. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4774. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4775. } while (0)
  4776. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4777. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4778. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4779. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4780. HTT_SRING_SETUP_RING_SIZE_S)
  4781. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4782. do { \
  4783. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4784. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4785. } while (0)
  4786. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4787. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4788. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4789. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4790. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4791. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4792. do { \
  4793. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4794. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4795. } while (0)
  4796. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4797. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4798. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4799. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4800. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4801. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4802. do { \
  4803. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4804. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4805. } while (0)
  4806. /* This control bit is applicable to only Producer, which updates Ring ID field
  4807. * of each descriptor before pushing into the ring.
  4808. * 0: updates ring_id(default)
  4809. * 1: ring_id updating disabled */
  4810. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4811. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4812. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4813. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4814. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4815. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4816. do { \
  4817. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4818. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4819. } while (0)
  4820. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4821. * of each descriptor before pushing into the ring.
  4822. * 0: updates Loopcnt(default)
  4823. * 1: Loopcnt updating disabled */
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4827. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4828. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4830. do { \
  4831. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4832. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4833. } while (0)
  4834. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4835. * into security_id port of GXI/AXI. */
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4839. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4840. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4842. do { \
  4843. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4844. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4845. } while (0)
  4846. /* During MSI write operation, SRNG drives value of this register bit into
  4847. * swap bit of GXI/AXI. */
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4851. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4852. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4854. do { \
  4855. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4856. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4857. } while (0)
  4858. /* During Pointer write operation, SRNG drives value of this register bit into
  4859. * swap bit of GXI/AXI. */
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4863. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4864. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4866. do { \
  4867. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4868. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4869. } while (0)
  4870. /* During any data or TLV write operation, SRNG drives value of this register
  4871. * bit into swap bit of GXI/AXI. */
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4875. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4876. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4878. do { \
  4879. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4880. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4881. } while (0)
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4884. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4885. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4886. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4887. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4888. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4889. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4890. do { \
  4891. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4892. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4893. } while (0)
  4894. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4895. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4896. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4897. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4898. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4899. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4900. do { \
  4901. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4902. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4903. } while (0)
  4904. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4905. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4906. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4907. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4908. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4909. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4910. do { \
  4911. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4912. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4913. } while (0)
  4914. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4915. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4916. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4917. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4918. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4919. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4920. do { \
  4921. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4922. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4923. } while (0)
  4924. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4925. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4926. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4927. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4928. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4929. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4930. do { \
  4931. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4932. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4933. } while (0)
  4934. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4935. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4936. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4937. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4938. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4939. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4940. do { \
  4941. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4942. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4943. } while (0)
  4944. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4945. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4946. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4947. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4948. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4949. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4950. do { \
  4951. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4952. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4953. } while (0)
  4954. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4955. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4956. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4957. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4958. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4959. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4960. do { \
  4961. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4962. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4963. } while (0)
  4964. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4965. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4966. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4967. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4968. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4969. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4970. do { \
  4971. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4972. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4973. } while (0)
  4974. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4975. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4976. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4977. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4978. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4979. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4980. do { \
  4981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4982. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4983. } while (0)
  4984. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4985. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4986. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4987. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4988. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4989. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4990. do { \
  4991. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4992. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4993. } while (0)
  4994. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4995. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4996. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4997. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4998. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4999. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5002. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5003. } while (0)
  5004. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5005. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5006. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5007. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5008. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5009. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5010. do { \
  5011. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5012. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5013. } while (0)
  5014. /**
  5015. * @brief host -> target RX ring selection config message
  5016. *
  5017. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5018. *
  5019. * @details
  5020. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5021. * configure RXDMA rings.
  5022. * The configuration is per ring based and includes both packet subtypes
  5023. * and PPDU/MPDU TLVs.
  5024. *
  5025. * The message would appear as follows:
  5026. *
  5027. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5028. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5029. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5030. * |-------------------------------------------------------------------|
  5031. * | rsvd2 | ring_buffer_size |
  5032. * |-------------------------------------------------------------------|
  5033. * | packet_type_enable_flags_0 |
  5034. * |-------------------------------------------------------------------|
  5035. * | packet_type_enable_flags_1 |
  5036. * |-------------------------------------------------------------------|
  5037. * | packet_type_enable_flags_2 |
  5038. * |-------------------------------------------------------------------|
  5039. * | packet_type_enable_flags_3 |
  5040. * |-------------------------------------------------------------------|
  5041. * | tlv_filter_in_flags |
  5042. * |-------------------------------------------------------------------|
  5043. * | rx_header_offset | rx_packet_offset |
  5044. * |-------------------------------------------------------------------|
  5045. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5046. * |-------------------------------------------------------------------|
  5047. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5048. * |-------------------------------------------------------------------|
  5049. * | rsvd3 | rx_attention_offset |
  5050. * |-------------------------------------------------------------------|
  5051. * | rsvd4 | mo| fp| rx_drop_threshold |
  5052. * | |ndp|ndp| |
  5053. * |-------------------------------------------------------------------|
  5054. * Where:
  5055. * PS = pkt_swap
  5056. * SS = status_swap
  5057. * OV = rx_offsets_valid
  5058. * DT = drop_thresh_valid
  5059. * The message is interpreted as follows:
  5060. * dword0 - b'0:7 - msg_type: This will be set to
  5061. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5062. * b'8:15 - pdev_id:
  5063. * 0 (for rings at SOC/UMAC level),
  5064. * 1/2/3 mac id (for rings at LMAC level)
  5065. * b'16:23 - ring_id : Identify the ring to configure.
  5066. * More details can be got from enum htt_srng_ring_id
  5067. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5068. * BUF_RING_CFG_0 defs within HW .h files,
  5069. * e.g. wmac_top_reg_seq_hwioreg.h
  5070. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5071. * BUF_RING_CFG_0 defs within HW .h files,
  5072. * e.g. wmac_top_reg_seq_hwioreg.h
  5073. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5074. * configuration fields are valid
  5075. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5076. * rx_drop_threshold field is valid
  5077. * b'28 - rx_mon_global_en: Enable/Disable global register
  5078. 8 configuration in Rx monitor module.
  5079. * b'29:31 - rsvd1: reserved for future use
  5080. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5081. * in byte units.
  5082. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5083. * b'16:18 - config_length_mgmt (MGMT):
  5084. * Represents the length of mpdu bytes for mgmt pkt.
  5085. * valid values:
  5086. * 001 - 64bytes
  5087. * 010 - 128bytes
  5088. * 100 - 256bytes
  5089. * 111 - Full mpdu bytes
  5090. * b'19:21 - config_length_ctrl (CTRL):
  5091. * Represents the length of mpdu bytes for ctrl pkt.
  5092. * valid values:
  5093. * 001 - 64bytes
  5094. * 010 - 128bytes
  5095. * 100 - 256bytes
  5096. * 111 - Full mpdu bytes
  5097. * b'22:24 - config_length_data (DATA):
  5098. * Represents the length of mpdu bytes for data pkt.
  5099. * valid values:
  5100. * 001 - 64bytes
  5101. * 010 - 128bytes
  5102. * 100 - 256bytes
  5103. * 111 - Full mpdu bytes
  5104. * b'25:26 - rx_hdr_len:
  5105. * Specifies the number of bytes of recvd packet to copy
  5106. * into the rx_hdr tlv.
  5107. * supported values for now by host:
  5108. * 01 - 64bytes
  5109. * 10 - 128bytes
  5110. * 11 - 256bytes
  5111. * default - 128 bytes
  5112. * b'27:31 - rsvd2: Reserved for future use
  5113. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5114. * Enable MGMT packet from 0b0000 to 0b1001
  5115. * bits from low to high: FP, MD, MO - 3 bits
  5116. * FP: Filter_Pass
  5117. * MD: Monitor_Direct
  5118. * MO: Monitor_Other
  5119. * 10 mgmt subtypes * 3 bits -> 30 bits
  5120. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5121. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5122. * Enable MGMT packet from 0b1010 to 0b1111
  5123. * bits from low to high: FP, MD, MO - 3 bits
  5124. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5125. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5126. * Enable CTRL packet from 0b0000 to 0b1001
  5127. * bits from low to high: FP, MD, MO - 3 bits
  5128. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5129. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5130. * Enable CTRL packet from 0b1010 to 0b1111,
  5131. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5132. * bits from low to high: FP, MD, MO - 3 bits
  5133. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5134. * dword6 - b'0:31 - tlv_filter_in_flags:
  5135. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5136. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5137. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5138. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5139. * A value of 0 will be considered as ignore this config.
  5140. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5141. * e.g. wmac_top_reg_seq_hwioreg.h
  5142. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5143. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5144. * A value of 0 will be considered as ignore this config.
  5145. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5146. * e.g. wmac_top_reg_seq_hwioreg.h
  5147. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5148. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5149. * A value of 0 will be considered as ignore this config.
  5150. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5151. * e.g. wmac_top_reg_seq_hwioreg.h
  5152. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5153. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5154. * A value of 0 will be considered as ignore this config.
  5155. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5156. * e.g. wmac_top_reg_seq_hwioreg.h
  5157. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5158. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5159. * A value of 0 will be considered as ignore this config.
  5160. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5161. * e.g. wmac_top_reg_seq_hwioreg.h
  5162. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5163. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5164. * A value of 0 will be considered as ignore this config.
  5165. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5166. * e.g. wmac_top_reg_seq_hwioreg.h
  5167. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5168. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5169. * A value of 0 will be considered as ignore this config.
  5170. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5171. * e.g. wmac_top_reg_seq_hwioreg.h
  5172. * - b'16:31 - rsvd3 for future use
  5173. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5174. * to source rings. Consumer drops packets if the available
  5175. * words in the ring falls below the configured threshold
  5176. * value.
  5177. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5178. * by host. 1 -> subscribed
  5179. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5180. * by host. 1 -> subscribed
  5181. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5182. * subscribed by host. 1 -> subscribed
  5183. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5184. * selection for the FP PHY ERR status tlv.
  5185. * 0 - wbm2rxdma_buf_source_ring
  5186. * 1 - fw2rxdma_buf_source_ring
  5187. * 2 - sw2rxdma_buf_source_ring
  5188. * 3 - no_buffer_ring
  5189. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5190. * selection for the FP PHY ERR status tlv.
  5191. * 0 - rxdma_release_ring
  5192. * 1 - rxdma2fw_ring
  5193. * 2 - rxdma2sw_ring
  5194. * 3 - rxdma2reo_ring
  5195. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5196. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5197. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5198. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5199. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5200. * 0: MSDU level logging
  5201. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5202. * 0: MSDU level logging
  5203. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5204. * 0: MSDU level logging
  5205. * - b'23 - word_mask_compaction: enable/disable word mask for
  5206. * mpdu/msdu start/end tlvs
  5207. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5208. * manager override
  5209. * - b'25:28 - rbm_override_val: return buffer manager override value
  5210. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5211. * which have to be posted to host from phy.
  5212. * Corresponding to errors defined in
  5213. * phyrx_abort_request_reason enums 0 to 31.
  5214. * Refer to RXPCU register definition header files for the
  5215. * phyrx_abort_request_reason enum definition.
  5216. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5217. * errors which have to be posted to host from phy.
  5218. * Corresponding to errors defined in
  5219. * phyrx_abort_request_reason enums 32 to 63.
  5220. * Refer to RXPCU register definition header files for the
  5221. * phyrx_abort_request_reason enum definition.
  5222. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5223. * applicable if word mask enabled
  5224. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5225. * applicable if word mask enabled
  5226. * - b'19:31 - rsvd7
  5227. * dword15- b'0:16 - rx_msdu_end_word_mask
  5228. * - b'17:31 - rsvd5
  5229. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5230. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5231. * buffer
  5232. * 1: RX_PKT TLV logging at specified offset for the
  5233. * subsequent buffer
  5234. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5235. */
  5236. PREPACK struct htt_rx_ring_selection_cfg_t {
  5237. A_UINT32 msg_type: 8,
  5238. pdev_id: 8,
  5239. ring_id: 8,
  5240. status_swap: 1,
  5241. pkt_swap: 1,
  5242. rx_offsets_valid: 1,
  5243. drop_thresh_valid: 1,
  5244. rx_mon_global_en: 1,
  5245. rsvd1: 3;
  5246. A_UINT32 ring_buffer_size: 16,
  5247. config_length_mgmt:3,
  5248. config_length_ctrl:3,
  5249. config_length_data:3,
  5250. rx_hdr_len: 2,
  5251. rsvd2: 5;
  5252. A_UINT32 packet_type_enable_flags_0;
  5253. A_UINT32 packet_type_enable_flags_1;
  5254. A_UINT32 packet_type_enable_flags_2;
  5255. A_UINT32 packet_type_enable_flags_3;
  5256. A_UINT32 tlv_filter_in_flags;
  5257. A_UINT32 rx_packet_offset: 16,
  5258. rx_header_offset: 16;
  5259. A_UINT32 rx_mpdu_end_offset: 16,
  5260. rx_mpdu_start_offset: 16;
  5261. A_UINT32 rx_msdu_end_offset: 16,
  5262. rx_msdu_start_offset: 16;
  5263. A_UINT32 rx_attn_offset: 16,
  5264. rsvd3: 16;
  5265. A_UINT32 rx_drop_threshold: 10,
  5266. fp_ndp: 1,
  5267. mo_ndp: 1,
  5268. fp_phy_err: 1,
  5269. fp_phy_err_buf_src: 2,
  5270. fp_phy_err_buf_dest: 2,
  5271. pkt_type_enable_msdu_or_mpdu_logging:3,
  5272. dma_mpdu_mgmt: 1,
  5273. dma_mpdu_ctrl: 1,
  5274. dma_mpdu_data: 1,
  5275. word_mask_compaction_enable:1,
  5276. rbm_override_enable: 1,
  5277. rbm_override_val: 4,
  5278. rsvd4: 3;
  5279. A_UINT32 phy_err_mask;
  5280. A_UINT32 phy_err_mask_cont;
  5281. A_UINT32 rx_mpdu_start_word_mask:16,
  5282. rx_mpdu_end_word_mask: 3,
  5283. rsvd7: 13;
  5284. A_UINT32 rx_msdu_end_word_mask: 17,
  5285. rsvd5: 15;
  5286. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5287. rx_pkt_tlv_offset: 15,
  5288. rsvd6: 16;
  5289. } POSTPACK;
  5290. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5291. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5292. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5293. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5294. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5295. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5296. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5297. do { \
  5298. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5299. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5300. } while (0)
  5301. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5302. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5303. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5304. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5305. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5306. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5307. do { \
  5308. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5309. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5310. } while (0)
  5311. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5312. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5313. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5314. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5315. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5316. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5317. do { \
  5318. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5319. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5320. } while (0)
  5321. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5322. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5323. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5324. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5325. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5326. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5327. do { \
  5328. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5329. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5330. } while (0)
  5331. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5332. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5333. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5334. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5335. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5336. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5337. do { \
  5338. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5339. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5340. } while (0)
  5341. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5342. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5343. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5344. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5345. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5346. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5347. do { \
  5348. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5349. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5350. } while (0)
  5351. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5352. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5353. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5354. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5355. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5356. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5357. do { \
  5358. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5359. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5360. } while (0)
  5361. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5362. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5363. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5364. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5365. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5366. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5367. do { \
  5368. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5369. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5370. } while (0)
  5371. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5372. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5373. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5374. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5375. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5376. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5377. do { \
  5378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5380. } while (0)
  5381. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5382. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5383. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5384. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5385. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5387. do { \
  5388. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5389. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5390. } while (0)
  5391. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5392. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5393. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5394. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5395. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5396. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5397. do { \
  5398. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5399. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5400. } while (0)
  5401. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5402. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5403. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5404. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5405. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5406. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5407. do { \
  5408. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5409. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5410. } while(0)
  5411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5414. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5415. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5417. do { \
  5418. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5419. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5420. } while (0)
  5421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5424. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5425. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5427. do { \
  5428. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5429. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5430. } while (0)
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5434. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5435. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5437. do { \
  5438. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5439. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5440. } while (0)
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5444. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5445. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5447. do { \
  5448. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5449. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5450. } while (0)
  5451. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5452. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5453. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5454. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5455. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5456. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5457. do { \
  5458. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5459. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5460. } while (0)
  5461. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5462. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5463. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5464. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5465. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5466. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5467. do { \
  5468. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5469. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5470. } while (0)
  5471. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5472. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5474. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5475. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5477. do { \
  5478. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5479. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5480. } while (0)
  5481. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5482. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5484. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5485. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5489. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5490. } while (0)
  5491. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5492. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5493. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5494. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5495. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5497. do { \
  5498. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5499. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5500. } while (0)
  5501. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5502. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5504. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5505. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5507. do { \
  5508. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5509. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5510. } while (0)
  5511. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5512. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5514. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5515. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5517. do { \
  5518. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5519. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5520. } while (0)
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5522. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5524. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5525. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5527. do { \
  5528. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5529. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5530. } while (0)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5532. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5534. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5535. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5537. do { \
  5538. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5539. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5540. } while (0)
  5541. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5542. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5543. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5544. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5545. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5546. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5549. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5550. } while (0)
  5551. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5552. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5553. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5554. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5555. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5556. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5557. do { \
  5558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5560. } while (0)
  5561. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5562. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5563. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5564. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5565. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5566. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5567. do { \
  5568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5570. } while (0)
  5571. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5572. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5573. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5574. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5575. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5577. do { \
  5578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5580. } while (0)
  5581. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5582. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5583. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5584. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5585. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5586. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5587. do { \
  5588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5590. } while (0)
  5591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5594. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5595. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5597. do { \
  5598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5600. } while (0)
  5601. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5602. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5603. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5604. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5605. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5606. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5607. do { \
  5608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5610. } while (0)
  5611. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5612. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5613. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5614. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5615. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5617. do { \
  5618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5620. } while (0)
  5621. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5622. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5623. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5624. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5625. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5626. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5627. do { \
  5628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5630. } while (0)
  5631. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5632. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5633. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5634. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5635. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5636. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5637. do { \
  5638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5640. } while (0)
  5641. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5642. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5643. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5644. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5645. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5646. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5647. do { \
  5648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5650. } while (0)
  5651. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5652. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5653. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5654. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5655. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5656. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5657. do { \
  5658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5660. } while (0)
  5661. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5662. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5663. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5664. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5665. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5666. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5667. do { \
  5668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5670. } while (0)
  5671. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5672. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5673. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5674. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5675. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5676. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5677. do { \
  5678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5680. } while (0)
  5681. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5682. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5683. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5684. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5685. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5686. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5687. do { \
  5688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5690. } while (0)
  5691. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5692. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5694. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5695. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5697. do { \
  5698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5700. } while (0)
  5701. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5702. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5703. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5704. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5705. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5706. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5707. do { \
  5708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5710. } while (0)
  5711. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5712. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5713. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5714. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5715. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5716. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5717. do { \
  5718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5720. } while (0)
  5721. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5722. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5723. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5724. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5725. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5726. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5727. do { \
  5728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5730. } while (0)
  5731. /*
  5732. * Subtype based MGMT frames enable bits.
  5733. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5734. */
  5735. /* association request */
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5742. /* association response */
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5749. /* Reassociation request */
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5756. /* Reassociation response */
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5763. /* Probe request */
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5770. /* Probe response */
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5777. /* Timing Advertisement */
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5784. /* Reserved */
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5791. /* Beacon */
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5798. /* ATIM */
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5805. /* Disassociation */
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5812. /* Authentication */
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5819. /* Deauthentication */
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5826. /* Action */
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5833. /* Action No Ack */
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5840. /* Reserved */
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5847. /*
  5848. * Subtype based CTRL frames enable bits.
  5849. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5850. */
  5851. /* Reserved */
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5858. /* Reserved */
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5865. /* Reserved */
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5872. /* Reserved */
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5879. /* Reserved */
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5886. /* Reserved */
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5893. /* Reserved */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5900. /* Control Wrapper */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5907. /* Block Ack Request */
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5914. /* Block Ack*/
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5921. /* PS-POLL */
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5928. /* RTS */
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5935. /* CTS */
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5942. /* ACK */
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5949. /* CF-END */
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5956. /* CF-END + CF-ACK */
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5963. /* Multicast data */
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5970. /* Unicast data */
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5977. /* NULL data */
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(httsym, value); \
  5987. (word) |= (value) << httsym##_S; \
  5988. } while (0)
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5990. (((word) & httsym##_M) >> httsym##_S)
  5991. #define htt_rx_ring_pkt_enable_subtype_set( \
  5992. word, flag, mode, type, subtype, val) \
  5993. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5994. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5995. #define htt_rx_ring_pkt_enable_subtype_get( \
  5996. word, flag, mode, type, subtype) \
  5997. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5998. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5999. /* Definition to filter in TLVs */
  6000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6028. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6029. do { \
  6030. HTT_CHECK_SET_VAL(httsym, enable); \
  6031. (word) |= (enable) << httsym##_S; \
  6032. } while (0)
  6033. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6034. (((word) & httsym##_M) >> httsym##_S)
  6035. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6036. HTT_RX_RING_TLV_ENABLE_SET( \
  6037. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6038. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6039. HTT_RX_RING_TLV_ENABLE_GET( \
  6040. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6041. /**
  6042. * @brief host -> target TX monitor config message
  6043. *
  6044. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6045. *
  6046. * @details
  6047. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6048. * configure RXDMA rings.
  6049. * The configuration is per ring based and includes both packet types
  6050. * and PPDU/MPDU TLVs.
  6051. *
  6052. * The message would appear as follows:
  6053. *
  6054. * |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|
  6055. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6056. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6057. * |-----------+--------+--------+-----+------------------------------------|
  6058. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6059. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6060. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6061. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6062. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6063. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6064. * |------------------------------------------------------------------------|
  6065. * | tlv_filter_mask_in0 |
  6066. * |------------------------------------------------------------------------|
  6067. * | tlv_filter_mask_in1 |
  6068. * |------------------------------------------------------------------------|
  6069. * | tlv_filter_mask_in2 |
  6070. * |------------------------------------------------------------------------|
  6071. * | tlv_filter_mask_in3 |
  6072. * |-----------------+-----------------+---------------------+--------------|
  6073. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6074. * |------------------------------------------------------------------------|
  6075. * | pcu_ppdu_setup_word_mask |
  6076. * |--------------------+--+--+--+-----+---------------------+--------------|
  6077. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6078. * |------------------------------------------------------------------------|
  6079. *
  6080. * Where:
  6081. * PS = pkt_swap
  6082. * SS = status_swap
  6083. * The message is interpreted as follows:
  6084. * dword0 - b'0:7 - msg_type: This will be set to
  6085. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6086. * b'8:15 - pdev_id:
  6087. * 0 (for rings at SOC level),
  6088. * 1/2/3 mac id (for rings at LMAC level)
  6089. * b'16:23 - ring_id : Identify the ring to configure.
  6090. * More details can be got from enum htt_srng_ring_id
  6091. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6092. * BUF_RING_CFG_0 defs within HW .h files,
  6093. * e.g. wmac_top_reg_seq_hwioreg.h
  6094. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6095. * BUF_RING_CFG_0 defs within HW .h files,
  6096. * e.g. wmac_top_reg_seq_hwioreg.h
  6097. * b'26 - tx_mon_global_en: Enable/Disable global register
  6098. * configuration in Tx monitor module.
  6099. * b'27:31 - rsvd1: reserved for future use
  6100. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6101. * in byte units.
  6102. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6103. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6104. * 64, 128, 256.
  6105. * If all 3 bits are set config length is > 256.
  6106. * if val is '0', then ignore this field.
  6107. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6108. * 64, 128, 256.
  6109. * If all 3 bits are set config length is > 256.
  6110. * if val is '0', then ignore this field.
  6111. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6112. * 64, 128, 256.
  6113. * If all 3 bits are set config length is > 256.
  6114. * If val is '0', then ignore this field.
  6115. * - b'25:31 - rsvd2: Reserved for future use
  6116. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6117. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6118. * If packet_type_enable_flags is '1' for MGMT type,
  6119. * monitor will ignore this bit and allow this TLV.
  6120. * If packet_type_enable_flags is '0' for MGMT type,
  6121. * monitor will use this bit to enable/disable logging
  6122. * of this TLV.
  6123. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6124. * If packet_type_enable_flags is '1' for CTRL type,
  6125. * monitor will ignore this bit and allow this TLV.
  6126. * If packet_type_enable_flags is '0' for CTRL type,
  6127. * monitor will use this bit to enable/disable logging
  6128. * of this TLV.
  6129. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6130. * If packet_type_enable_flags is '1' for DATA type,
  6131. * monitor will ignore this bit and allow this TLV.
  6132. * If packet_type_enable_flags is '0' for DATA type,
  6133. * monitor will use this bit to enable/disable logging
  6134. * of this TLV.
  6135. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6136. * If packet_type_enable_flags is '1' for MGMT type,
  6137. * monitor will ignore this bit and allow this TLV.
  6138. * If packet_type_enable_flags is '0' for MGMT type,
  6139. * monitor will use this bit to enable/disable logging
  6140. * of this TLV.
  6141. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6142. * If packet_type_enable_flags is '1' for CTRL type,
  6143. * monitor will ignore this bit and allow this TLV.
  6144. * If packet_type_enable_flags is '0' for CTRL type,
  6145. * monitor will use this bit to enable/disable logging
  6146. * of this TLV.
  6147. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6148. * If packet_type_enable_flags is '1' for DATA type,
  6149. * monitor will ignore this bit and allow this TLV.
  6150. * If packet_type_enable_flags is '0' for DATA type,
  6151. * monitor will use this bit to enable/disable logging
  6152. * of this TLV.
  6153. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6154. * If packet_type_enable_flags is '1' for MGMT type,
  6155. * monitor will ignore this bit and allow this TLV.
  6156. * If packet_type_enable_flags is '0' for MGMT type,
  6157. * monitor will use this bit to enable/disable logging
  6158. * of this TLV.
  6159. * If filter_in_TX_MPDU_START = 1 it is recommended
  6160. * to set this bit.
  6161. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6162. * If packet_type_enable_flags is '1' for CTRL type,
  6163. * monitor will ignore this bit and allow this TLV.
  6164. * If packet_type_enable_flags is '0' for CTRL type,
  6165. * monitor will use this bit to enable/disable logging
  6166. * of this TLV.
  6167. * If filter_in_TX_MPDU_START = 1 it is recommended
  6168. * to set this bit.
  6169. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6170. * If packet_type_enable_flags is '1' for DATA type,
  6171. * monitor will ignore this bit and allow this TLV.
  6172. * If packet_type_enable_flags is '0' for DATA type,
  6173. * monitor will use this bit to enable/disable logging
  6174. * of this TLV.
  6175. * If filter_in_TX_MPDU_START = 1 it is recommended
  6176. * to set this bit.
  6177. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6178. * If packet_type_enable_flags is '1' for MGMT type,
  6179. * monitor will ignore this bit and allow this TLV.
  6180. * If packet_type_enable_flags is '0' for MGMT type,
  6181. * monitor will use this bit to enable/disable logging
  6182. * of this TLV.
  6183. * If filter_in_TX_MSDU_START = 1 it is recommended
  6184. * to set this bit.
  6185. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6186. * If packet_type_enable_flags is '1' for CTRL type,
  6187. * monitor will ignore this bit and allow this TLV.
  6188. * If packet_type_enable_flags is '0' for CTRL type,
  6189. * monitor will use this bit to enable/disable logging
  6190. * of this TLV.
  6191. * If filter_in_TX_MSDU_START = 1 it is recommended
  6192. * to set this bit.
  6193. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6194. * If packet_type_enable_flags is '1' for DATA type,
  6195. * monitor will ignore this bit and allow this TLV.
  6196. * If packet_type_enable_flags is '0' for DATA type,
  6197. * monitor will use this bit to enable/disable logging
  6198. * of this TLV.
  6199. * If filter_in_TX_MSDU_START = 1 it is recommended
  6200. * to set this bit.
  6201. * b'15:31 - rsvd3: Reserved for future use
  6202. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6203. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6204. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6205. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6206. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6207. * - b'8:15 - tx_peer_entry_word_mask:
  6208. * - b'16:23 - tx_queue_ext_word_mask:
  6209. * - b'24:31 - tx_msdu_start_word_mask:
  6210. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6211. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6212. * - b'8:15 - rxpcu_user_setup_word_mask:
  6213. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6214. * MGMT, CTRL, DATA
  6215. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6216. * 0 -> MSDU level logging is enabled
  6217. * (valid only if bit is set in
  6218. * pkt_type_enable_msdu_or_mpdu_logging)
  6219. * 1 -> MPDU level logging is enabled
  6220. * (valid only if bit is set in
  6221. * pkt_type_enable_msdu_or_mpdu_logging)
  6222. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6223. * 0 -> MSDU level logging is enabled
  6224. * (valid only if bit is set in
  6225. * pkt_type_enable_msdu_or_mpdu_logging)
  6226. * 1 -> MPDU level logging is enabled
  6227. * (valid only if bit is set in
  6228. * pkt_type_enable_msdu_or_mpdu_logging)
  6229. * - b'21 - dma_mpdu_data(D) : For DATA
  6230. * 0 -> MSDU level logging is enabled
  6231. * (valid only if bit is set in
  6232. * pkt_type_enable_msdu_or_mpdu_logging)
  6233. * 1 -> MPDU level logging is enabled
  6234. * (valid only if bit is set in
  6235. * pkt_type_enable_msdu_or_mpdu_logging)
  6236. * - b'22:31 - rsvd4 for future use
  6237. */
  6238. PREPACK struct htt_tx_monitor_cfg_t {
  6239. A_UINT32 msg_type: 8,
  6240. pdev_id: 8,
  6241. ring_id: 8,
  6242. status_swap: 1,
  6243. pkt_swap: 1,
  6244. tx_mon_global_en: 1,
  6245. rsvd1: 5;
  6246. A_UINT32 ring_buffer_size: 16,
  6247. config_length_mgmt: 3,
  6248. config_length_ctrl: 3,
  6249. config_length_data: 3,
  6250. rsvd2: 7;
  6251. A_UINT32 pkt_type_enable_flags: 3,
  6252. filter_in_tx_mpdu_start_mgmt: 1,
  6253. filter_in_tx_mpdu_start_ctrl: 1,
  6254. filter_in_tx_mpdu_start_data: 1,
  6255. filter_in_tx_msdu_start_mgmt: 1,
  6256. filter_in_tx_msdu_start_ctrl: 1,
  6257. filter_in_tx_msdu_start_data: 1,
  6258. filter_in_tx_mpdu_end_mgmt: 1,
  6259. filter_in_tx_mpdu_end_ctrl: 1,
  6260. filter_in_tx_mpdu_end_data: 1,
  6261. filter_in_tx_msdu_end_mgmt: 1,
  6262. filter_in_tx_msdu_end_ctrl: 1,
  6263. filter_in_tx_msdu_end_data: 1,
  6264. rsvd3: 17;
  6265. A_UINT32 tlv_filter_mask_in0;
  6266. A_UINT32 tlv_filter_mask_in1;
  6267. A_UINT32 tlv_filter_mask_in2;
  6268. A_UINT32 tlv_filter_mask_in3;
  6269. A_UINT32 tx_fes_setup_word_mask: 8,
  6270. tx_peer_entry_word_mask: 8,
  6271. tx_queue_ext_word_mask: 8,
  6272. tx_msdu_start_word_mask: 8;
  6273. A_UINT32 pcu_ppdu_setup_word_mask;
  6274. A_UINT32 tx_mpdu_start_word_mask: 8,
  6275. rxpcu_user_setup_word_mask: 8,
  6276. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6277. dma_mpdu_mgmt: 1,
  6278. dma_mpdu_ctrl: 1,
  6279. dma_mpdu_data: 1,
  6280. rsvd4: 10;
  6281. } POSTPACK;
  6282. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6283. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6284. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6285. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6286. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6287. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6288. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6289. do { \
  6290. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6291. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6292. } while (0)
  6293. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6294. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6295. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6296. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6297. HTT_TX_MONITOR_CFG_RING_ID_S)
  6298. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6299. do { \
  6300. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6301. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6302. } while (0)
  6303. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6304. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6305. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6306. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6307. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6308. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6309. do { \
  6310. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6311. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6312. } while (0)
  6313. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6314. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6315. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6316. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6317. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6318. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6321. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6322. } while (0)
  6323. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6324. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6325. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6326. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6327. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6328. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6329. do { \
  6330. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6331. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6332. } while (0)
  6333. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6334. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6335. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6336. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6337. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6338. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6339. do { \
  6340. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6341. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6342. } while (0)
  6343. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6344. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6345. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6346. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6347. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6348. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6349. do { \
  6350. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6351. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6352. } while (0)
  6353. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6354. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6355. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6356. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6357. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6358. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6359. do { \
  6360. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6361. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6362. } while (0)
  6363. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6364. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6365. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6366. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6367. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6368. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6369. do { \
  6370. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6371. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6372. } while (0)
  6373. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6374. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6375. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6376. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6377. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6378. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6379. do { \
  6380. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6381. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6382. } while (0)
  6383. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6384. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6385. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6386. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6387. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6388. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6389. do { \
  6390. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6391. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6392. } while (0)
  6393. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6394. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6396. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6397. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6399. do { \
  6400. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6401. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6402. } while (0)
  6403. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6404. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6406. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6407. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6409. do { \
  6410. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6411. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6412. } while (0)
  6413. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6414. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6416. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6417. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6419. do { \
  6420. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6421. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6422. } while (0)
  6423. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6424. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6426. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6427. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6429. do { \
  6430. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6431. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6432. } while (0)
  6433. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6434. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6436. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6437. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6441. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6442. } while (0)
  6443. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6444. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6446. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6447. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6449. do { \
  6450. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6451. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6452. } while (0)
  6453. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6454. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6456. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6457. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6459. do { \
  6460. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6461. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6462. } while (0)
  6463. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6464. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6466. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6467. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6469. do { \
  6470. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6471. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6472. } while (0)
  6473. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6474. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6476. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6477. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6479. do { \
  6480. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6481. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6482. } while (0)
  6483. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6484. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6486. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6487. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6489. do { \
  6490. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6491. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6492. } while (0)
  6493. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6494. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6495. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6496. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6497. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6498. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6499. do { \
  6500. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6501. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6502. } while (0)
  6503. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6504. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6505. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6506. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6507. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6508. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6511. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6512. } while (0)
  6513. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6514. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6515. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6516. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6517. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6518. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6519. do { \
  6520. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6521. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6522. } while (0)
  6523. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6524. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6525. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6526. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6527. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6528. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6529. do { \
  6530. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6531. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6532. } while (0)
  6533. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6534. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6535. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6536. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6537. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6538. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6539. do { \
  6540. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6541. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6542. } while (0)
  6543. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6544. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6545. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6546. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6547. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6548. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6551. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6552. } while (0)
  6553. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6554. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6555. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6556. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6557. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6558. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6559. do { \
  6560. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6561. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6562. } while (0)
  6563. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6564. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6565. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6566. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6567. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6568. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6571. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6572. } while (0)
  6573. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6574. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6575. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6576. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6577. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6578. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6579. do { \
  6580. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6581. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6582. } while (0)
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6586. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6587. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6589. do { \
  6590. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6591. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6592. } while (0)
  6593. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6594. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6595. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6596. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6597. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6598. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6599. do { \
  6600. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6601. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6602. } while (0)
  6603. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6604. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6605. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6606. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6607. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6608. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6609. do { \
  6610. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6611. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6612. } while (0)
  6613. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6614. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6615. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6616. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6617. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6618. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6621. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6622. } while (0)
  6623. /*
  6624. * pkt_type_enable_flags
  6625. */
  6626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6632. /*
  6633. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6634. */
  6635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6638. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6642. do { \
  6643. HTT_CHECK_SET_VAL(httsym, value); \
  6644. (word) |= (value) << httsym##_S; \
  6645. } while (0)
  6646. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6647. (((word) & httsym##_M) >> httsym##_S)
  6648. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6649. * type -> MGMT, CTRL, DATA*/
  6650. #define htt_tx_ring_pkt_type_set( \
  6651. word, mode, type, val) \
  6652. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6653. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6654. #define htt_tx_ring_pkt_type_get( \
  6655. word, mode, type) \
  6656. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6657. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6658. /* Definition to filter in TLVs */
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6723. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6724. do { \
  6725. HTT_CHECK_SET_VAL(httsym, enable); \
  6726. (word) |= (enable) << httsym##_S; \
  6727. } while (0)
  6728. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6729. (((word) & httsym##_M) >> httsym##_S)
  6730. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6731. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6732. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6733. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6734. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6735. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6800. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6801. do { \
  6802. HTT_CHECK_SET_VAL(httsym, enable); \
  6803. (word) |= (enable) << httsym##_S; \
  6804. } while (0)
  6805. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6806. (((word) & httsym##_M) >> httsym##_S)
  6807. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6808. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6809. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6810. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6811. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6812. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6877. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6878. do { \
  6879. HTT_CHECK_SET_VAL(httsym, enable); \
  6880. (word) |= (enable) << httsym##_S; \
  6881. } while (0)
  6882. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6883. (((word) & httsym##_M) >> httsym##_S)
  6884. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6885. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6886. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6887. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6888. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6889. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6934. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6935. do { \
  6936. HTT_CHECK_SET_VAL(httsym, enable); \
  6937. (word) |= (enable) << httsym##_S; \
  6938. } while (0)
  6939. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6940. (((word) & httsym##_M) >> httsym##_S)
  6941. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6942. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6943. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6944. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6945. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6946. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6947. /**
  6948. * @brief host --> target Receive Flow Steering configuration message definition
  6949. *
  6950. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6951. *
  6952. * host --> target Receive Flow Steering configuration message definition.
  6953. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6954. * The reason for this is we want RFS to be configured and ready before MAC
  6955. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6956. *
  6957. * |31 24|23 16|15 9|8|7 0|
  6958. * |----------------+----------------+----------------+----------------|
  6959. * | reserved |E| msg type |
  6960. * |-------------------------------------------------------------------|
  6961. * Where E = RFS enable flag
  6962. *
  6963. * The RFS_CONFIG message consists of a single 4-byte word.
  6964. *
  6965. * Header fields:
  6966. * - MSG_TYPE
  6967. * Bits 7:0
  6968. * Purpose: identifies this as a RFS config msg
  6969. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6970. * - RFS_CONFIG
  6971. * Bit 8
  6972. * Purpose: Tells target whether to enable (1) or disable (0)
  6973. * flow steering feature when sending rx indication messages to host
  6974. */
  6975. #define HTT_H2T_RFS_CONFIG_M 0x100
  6976. #define HTT_H2T_RFS_CONFIG_S 8
  6977. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6978. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6979. HTT_H2T_RFS_CONFIG_S)
  6980. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6981. do { \
  6982. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6983. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6984. } while (0)
  6985. #define HTT_RFS_CFG_REQ_BYTES 4
  6986. /**
  6987. * @brief host -> target FW extended statistics request
  6988. *
  6989. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6990. *
  6991. * @details
  6992. * The following field definitions describe the format of the HTT host
  6993. * to target FW extended stats retrieve message.
  6994. * The message specifies the type of stats the host wants to retrieve.
  6995. *
  6996. * |31 24|23 16|15 8|7 0|
  6997. * |-----------------------------------------------------------|
  6998. * | reserved | stats type | pdev_mask | msg type |
  6999. * |-----------------------------------------------------------|
  7000. * | config param [0] |
  7001. * |-----------------------------------------------------------|
  7002. * | config param [1] |
  7003. * |-----------------------------------------------------------|
  7004. * | config param [2] |
  7005. * |-----------------------------------------------------------|
  7006. * | config param [3] |
  7007. * |-----------------------------------------------------------|
  7008. * | reserved |
  7009. * |-----------------------------------------------------------|
  7010. * | cookie LSBs |
  7011. * |-----------------------------------------------------------|
  7012. * | cookie MSBs |
  7013. * |-----------------------------------------------------------|
  7014. * Header fields:
  7015. * - MSG_TYPE
  7016. * Bits 7:0
  7017. * Purpose: identifies this is a extended stats upload request message
  7018. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7019. * - PDEV_MASK
  7020. * Bits 8:15
  7021. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7022. * Value: This is a overloaded field, refer to usage and interpretation of
  7023. * PDEV in interface document.
  7024. * Bit 8 : Reserved for SOC stats
  7025. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7026. * Indicates MACID_MASK in DBS
  7027. * - STATS_TYPE
  7028. * Bits 23:16
  7029. * Purpose: identifies which FW statistics to upload
  7030. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7031. * - Reserved
  7032. * Bits 31:24
  7033. * - CONFIG_PARAM [0]
  7034. * Bits 31:0
  7035. * Purpose: give an opaque configuration value to the specified stats type
  7036. * Value: stats-type specific configuration value
  7037. * Refer to htt_stats.h for interpretation for each stats sub_type
  7038. * - CONFIG_PARAM [1]
  7039. * Bits 31:0
  7040. * Purpose: give an opaque configuration value to the specified stats type
  7041. * Value: stats-type specific configuration value
  7042. * Refer to htt_stats.h for interpretation for each stats sub_type
  7043. * - CONFIG_PARAM [2]
  7044. * Bits 31:0
  7045. * Purpose: give an opaque configuration value to the specified stats type
  7046. * Value: stats-type specific configuration value
  7047. * Refer to htt_stats.h for interpretation for each stats sub_type
  7048. * - CONFIG_PARAM [3]
  7049. * Bits 31:0
  7050. * Purpose: give an opaque configuration value to the specified stats type
  7051. * Value: stats-type specific configuration value
  7052. * Refer to htt_stats.h for interpretation for each stats sub_type
  7053. * - Reserved [31:0] for future use.
  7054. * - COOKIE_LSBS
  7055. * Bits 31:0
  7056. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7057. * message with its preceding host->target stats request message.
  7058. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7059. * - COOKIE_MSBS
  7060. * Bits 31:0
  7061. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7062. * message with its preceding host->target stats request message.
  7063. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7064. */
  7065. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7066. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7067. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7068. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7069. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7070. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7071. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7072. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7073. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7074. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7075. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7076. do { \
  7077. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7078. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7079. } while (0)
  7080. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7081. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7082. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7083. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7084. do { \
  7085. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7086. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7087. } while (0)
  7088. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7089. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7090. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7091. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7092. do { \
  7093. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7094. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7095. } while (0)
  7096. /**
  7097. * @brief host -> target FW streaming statistics request
  7098. *
  7099. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7100. *
  7101. * @details
  7102. * The following field definitions describe the format of the HTT host
  7103. * to target message that requests the target to start or stop producing
  7104. * ongoing stats of the specified type.
  7105. *
  7106. * |31|30 |23 16|15 8|7 0|
  7107. * |-----------------------------------------------------------|
  7108. * |EN| reserved | stats type | reserved | msg type |
  7109. * |-----------------------------------------------------------|
  7110. * | config param [0] |
  7111. * |-----------------------------------------------------------|
  7112. * | config param [1] |
  7113. * |-----------------------------------------------------------|
  7114. * | config param [2] |
  7115. * |-----------------------------------------------------------|
  7116. * | config param [3] |
  7117. * |-----------------------------------------------------------|
  7118. * Where:
  7119. * - EN is an enable/disable flag
  7120. * Header fields:
  7121. * - MSG_TYPE
  7122. * Bits 7:0
  7123. * Purpose: identifies this is a streaming stats upload request message
  7124. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7125. * - STATS_TYPE
  7126. * Bits 23:16
  7127. * Purpose: identifies which FW statistics to upload
  7128. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7129. * Only the htt_dbg_ext_stats_type values identified as streaming
  7130. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7131. * - ENABLE
  7132. * Bit 31
  7133. * Purpose: enable/disable the target's ongoing stats of the specified type
  7134. * Value:
  7135. * 0 - disable ongoing production of the specified stats type
  7136. * 1 - enable ongoing production of the specified stats type
  7137. * - CONFIG_PARAM [0]
  7138. * Bits 31:0
  7139. * Purpose: give an opaque configuration value to the specified stats type
  7140. * Value: stats-type specific configuration value
  7141. * Refer to htt_stats.h for interpretation for each stats sub_type
  7142. * - CONFIG_PARAM [1]
  7143. * Bits 31:0
  7144. * Purpose: give an opaque configuration value to the specified stats type
  7145. * Value: stats-type specific configuration value
  7146. * Refer to htt_stats.h for interpretation for each stats sub_type
  7147. * - CONFIG_PARAM [2]
  7148. * Bits 31:0
  7149. * Purpose: give an opaque configuration value to the specified stats type
  7150. * Value: stats-type specific configuration value
  7151. * Refer to htt_stats.h for interpretation for each stats sub_type
  7152. * - CONFIG_PARAM [3]
  7153. * Bits 31:0
  7154. * Purpose: give an opaque configuration value to the specified stats type
  7155. * Value: stats-type specific configuration value
  7156. * Refer to htt_stats.h for interpretation for each stats sub_type
  7157. */
  7158. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7159. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7160. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7161. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7162. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7163. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7164. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7165. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7166. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7167. do { \
  7168. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7169. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7170. } while (0)
  7171. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7172. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7173. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7174. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7175. do { \
  7176. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7177. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7178. } while (0)
  7179. /**
  7180. * @brief host -> target FW PPDU_STATS request message
  7181. *
  7182. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7183. *
  7184. * @details
  7185. * The following field definitions describe the format of the HTT host
  7186. * to target FW for PPDU_STATS_CFG msg.
  7187. * The message allows the host to configure the PPDU_STATS_IND messages
  7188. * produced by the target.
  7189. *
  7190. * |31 24|23 16|15 8|7 0|
  7191. * |-----------------------------------------------------------|
  7192. * | REQ bit mask | pdev_mask | msg type |
  7193. * |-----------------------------------------------------------|
  7194. * Header fields:
  7195. * - MSG_TYPE
  7196. * Bits 7:0
  7197. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7198. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7199. * - PDEV_MASK
  7200. * Bits 8:15
  7201. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7202. * Value: This is a overloaded field, refer to usage and interpretation of
  7203. * PDEV in interface document.
  7204. * Bit 8 : Reserved for SOC stats
  7205. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7206. * Indicates MACID_MASK in DBS
  7207. * - REQ_TLV_BIT_MASK
  7208. * Bits 16:31
  7209. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7210. * needs to be included in the target's PPDU_STATS_IND messages.
  7211. * Value: refer htt_ppdu_stats_tlv_tag_t
  7212. *
  7213. */
  7214. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7215. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7216. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7217. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7218. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7219. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7220. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7221. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7222. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7223. do { \
  7224. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7225. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7226. } while (0)
  7227. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7228. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7229. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7230. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7231. do { \
  7232. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7233. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7234. } while (0)
  7235. /**
  7236. * @brief Host-->target HTT RX FSE setup message
  7237. *
  7238. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7239. *
  7240. * @details
  7241. * Through this message, the host will provide details of the flow tables
  7242. * in host DDR along with hash keys.
  7243. * This message can be sent per SOC or per PDEV, which is differentiated
  7244. * by pdev id values.
  7245. * The host will allocate flow search table and sends table size,
  7246. * physical DMA address of flow table, and hash keys to firmware to
  7247. * program into the RXOLE FSE HW block.
  7248. *
  7249. * The following field definitions describe the format of the RX FSE setup
  7250. * message sent from the host to target
  7251. *
  7252. * Header fields:
  7253. * dword0 - b'7:0 - msg_type: This will be set to
  7254. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7255. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7256. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7257. * pdev's LMAC ring.
  7258. * b'31:16 - reserved : Reserved for future use
  7259. * dword1 - b'19:0 - number of records: This field indicates the number of
  7260. * entries in the flow table. For example: 8k number of
  7261. * records is equivalent to
  7262. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7263. * b'27:20 - max search: This field specifies the skid length to FSE
  7264. * parser HW module whenever match is not found at the
  7265. * exact index pointed by hash.
  7266. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7267. * Refer htt_ip_da_sa_prefix below for more details.
  7268. * b'31:30 - reserved: Reserved for future use
  7269. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7270. * table allocated by host in DDR
  7271. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7272. * table allocated by host in DDR
  7273. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7274. * entry hashing
  7275. *
  7276. *
  7277. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7278. * |---------------------------------------------------------------|
  7279. * | reserved | pdev_id | MSG_TYPE |
  7280. * |---------------------------------------------------------------|
  7281. * |resvd|IPDSA| max_search | Number of records |
  7282. * |---------------------------------------------------------------|
  7283. * | base address lo |
  7284. * |---------------------------------------------------------------|
  7285. * | base address high |
  7286. * |---------------------------------------------------------------|
  7287. * | toeplitz key 31_0 |
  7288. * |---------------------------------------------------------------|
  7289. * | toeplitz key 63_32 |
  7290. * |---------------------------------------------------------------|
  7291. * | toeplitz key 95_64 |
  7292. * |---------------------------------------------------------------|
  7293. * | toeplitz key 127_96 |
  7294. * |---------------------------------------------------------------|
  7295. * | toeplitz key 159_128 |
  7296. * |---------------------------------------------------------------|
  7297. * | toeplitz key 191_160 |
  7298. * |---------------------------------------------------------------|
  7299. * | toeplitz key 223_192 |
  7300. * |---------------------------------------------------------------|
  7301. * | toeplitz key 255_224 |
  7302. * |---------------------------------------------------------------|
  7303. * | toeplitz key 287_256 |
  7304. * |---------------------------------------------------------------|
  7305. * | reserved | toeplitz key 314_288(26:0 bits) |
  7306. * |---------------------------------------------------------------|
  7307. * where:
  7308. * IPDSA = ip_da_sa
  7309. */
  7310. /**
  7311. * @brief: htt_ip_da_sa_prefix
  7312. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7313. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7314. * documentation per RFC3849
  7315. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7316. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7317. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7318. */
  7319. enum htt_ip_da_sa_prefix {
  7320. HTT_RX_IPV6_20010db8,
  7321. HTT_RX_IPV4_MAPPED_IPV6,
  7322. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7323. HTT_RX_IPV6_64FF9B,
  7324. };
  7325. /**
  7326. * @brief Host-->target HTT RX FISA configure and enable
  7327. *
  7328. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7329. *
  7330. * @details
  7331. * The host will send this command down to configure and enable the FISA
  7332. * operational params.
  7333. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7334. * register.
  7335. * Should configure both the MACs.
  7336. *
  7337. * dword0 - b'7:0 - msg_type:
  7338. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7339. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7340. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7341. * pdev's LMAC ring.
  7342. * b'31:16 - reserved : Reserved for future use
  7343. *
  7344. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7345. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7346. * packets. 1 flow search will be skipped
  7347. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7348. * tcp,udp packets
  7349. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7350. * calculation
  7351. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7352. * calculation
  7353. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7354. * calculation
  7355. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7356. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7357. * length
  7358. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7359. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7360. * length
  7361. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7362. * num jump
  7363. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7364. * num jump
  7365. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7366. * data type switch has happend for MPDU Sequence num jump
  7367. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7368. * for MPDU Sequence num jump
  7369. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7370. * for decrypt errors
  7371. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7372. * while aggregating a msdu
  7373. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7374. * The aggregation is done until (number of MSDUs aggregated
  7375. * < LIMIT + 1)
  7376. * b'31:18 - Reserved
  7377. *
  7378. * fisa_control_value - 32bit value FW can write to register
  7379. *
  7380. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7381. * Threshold value for FISA timeout (units are microseconds).
  7382. * When the global timestamp exceeds this threshold, FISA
  7383. * aggregation will be restarted.
  7384. * A value of 0 means timeout is disabled.
  7385. * Compare the threshold register with timestamp field in
  7386. * flow entry to generate timeout for the flow.
  7387. *
  7388. * |31 18 |17 16|15 8|7 0|
  7389. * |-------------------------------------------------------------|
  7390. * | reserved | pdev_mask | msg type |
  7391. * |-------------------------------------------------------------|
  7392. * | reserved | FISA_CTRL |
  7393. * |-------------------------------------------------------------|
  7394. * | FISA_TIMEOUT_THRESH |
  7395. * |-------------------------------------------------------------|
  7396. */
  7397. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7398. A_UINT32 msg_type:8,
  7399. pdev_id:8,
  7400. reserved0:16;
  7401. /**
  7402. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7403. * [17:0]
  7404. */
  7405. union {
  7406. /*
  7407. * fisa_control_bits structure is deprecated.
  7408. * Please use fisa_control_bits_v2 going forward.
  7409. */
  7410. struct {
  7411. A_UINT32 fisa_enable: 1,
  7412. ipsec_skip_search: 1,
  7413. nontcp_skip_search: 1,
  7414. add_ipv4_fixed_hdr_len: 1,
  7415. add_ipv6_fixed_hdr_len: 1,
  7416. add_tcp_fixed_hdr_len: 1,
  7417. add_udp_hdr_len: 1,
  7418. chksum_cum_ip_len_en: 1,
  7419. disable_tid_check: 1,
  7420. disable_ta_check: 1,
  7421. disable_qos_check: 1,
  7422. disable_raw_check: 1,
  7423. disable_decrypt_err_check: 1,
  7424. disable_msdu_drop_check: 1,
  7425. fisa_aggr_limit: 4,
  7426. reserved: 14;
  7427. } fisa_control_bits;
  7428. struct {
  7429. A_UINT32 fisa_enable: 1,
  7430. fisa_aggr_limit: 4,
  7431. reserved: 27;
  7432. } fisa_control_bits_v2;
  7433. A_UINT32 fisa_control_value;
  7434. } u_fisa_control;
  7435. /**
  7436. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7437. * timeout threshold for aggregation. Unit in usec.
  7438. * [31:0]
  7439. */
  7440. A_UINT32 fisa_timeout_threshold;
  7441. } POSTPACK;
  7442. /* DWord 0: pdev-ID */
  7443. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7444. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7445. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7446. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7447. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7448. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7449. do { \
  7450. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7451. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7452. } while (0)
  7453. /* Dword 1: fisa_control_value fisa config */
  7454. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7455. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7456. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7457. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7458. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7459. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7460. do { \
  7461. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7462. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7463. } while (0)
  7464. /* Dword 1: fisa_control_value ipsec_skip_search */
  7465. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7466. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7467. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7468. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7469. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7470. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7471. do { \
  7472. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7473. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7474. } while (0)
  7475. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7476. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7477. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7478. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7479. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7480. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7481. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7482. do { \
  7483. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7484. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7485. } while (0)
  7486. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7487. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7488. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7489. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7490. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7491. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7492. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7493. do { \
  7494. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7495. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7496. } while (0)
  7497. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7498. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7499. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7500. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7501. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7502. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7503. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7504. do { \
  7505. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7506. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7507. } while (0)
  7508. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7509. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7510. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7511. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7512. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7513. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7514. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7515. do { \
  7516. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7517. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7518. } while (0)
  7519. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7520. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7521. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7522. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7523. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7524. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7525. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7526. do { \
  7527. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7528. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7529. } while (0)
  7530. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7531. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7532. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7533. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7534. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7535. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7536. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7537. do { \
  7538. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7539. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7540. } while (0)
  7541. /* Dword 1: fisa_control_value disable_tid_check */
  7542. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7543. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7544. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7545. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7546. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7547. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7548. do { \
  7549. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7550. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7551. } while (0)
  7552. /* Dword 1: fisa_control_value disable_ta_check */
  7553. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7554. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7555. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7556. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7557. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7558. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7559. do { \
  7560. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7561. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7562. } while (0)
  7563. /* Dword 1: fisa_control_value disable_qos_check */
  7564. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7565. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7566. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7567. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7568. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7569. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7570. do { \
  7571. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7572. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7573. } while (0)
  7574. /* Dword 1: fisa_control_value disable_raw_check */
  7575. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7576. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7577. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7578. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7579. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7580. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7581. do { \
  7582. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7583. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7584. } while (0)
  7585. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7586. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7587. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7588. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7589. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7590. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7591. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7592. do { \
  7593. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7594. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7595. } while (0)
  7596. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7597. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7598. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7599. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7600. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7601. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7602. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7603. do { \
  7604. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7605. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7606. } while (0)
  7607. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7608. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7609. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7610. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7611. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7612. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7613. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7614. do { \
  7615. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7616. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7617. } while (0)
  7618. /* Dword 1: fisa_control_value fisa config */
  7619. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7620. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7621. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7622. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7623. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7624. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7625. do { \
  7626. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7627. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7628. } while (0)
  7629. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7630. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7631. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7632. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7633. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7634. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7635. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7636. do { \
  7637. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7638. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7639. } while (0)
  7640. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7641. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7642. pdev_id:8,
  7643. reserved0:16;
  7644. A_UINT32 num_records:20,
  7645. max_search:8,
  7646. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7647. reserved1:2;
  7648. A_UINT32 base_addr_lo;
  7649. A_UINT32 base_addr_hi;
  7650. A_UINT32 toeplitz31_0;
  7651. A_UINT32 toeplitz63_32;
  7652. A_UINT32 toeplitz95_64;
  7653. A_UINT32 toeplitz127_96;
  7654. A_UINT32 toeplitz159_128;
  7655. A_UINT32 toeplitz191_160;
  7656. A_UINT32 toeplitz223_192;
  7657. A_UINT32 toeplitz255_224;
  7658. A_UINT32 toeplitz287_256;
  7659. A_UINT32 toeplitz314_288:27,
  7660. reserved2:5;
  7661. } POSTPACK;
  7662. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7663. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7664. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7665. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7666. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7667. /* DWORD 0: Pdev ID */
  7668. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7669. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7670. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7671. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7672. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7673. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7674. do { \
  7675. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7676. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7677. } while (0)
  7678. /* DWORD 1:num of records */
  7679. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7680. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7681. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7682. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7683. HTT_RX_FSE_SETUP_NUM_REC_S)
  7684. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7687. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7688. } while (0)
  7689. /* DWORD 1:max_search */
  7690. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7691. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7692. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7693. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7694. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7695. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7696. do { \
  7697. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7698. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7699. } while (0)
  7700. /* DWORD 1:ip_da_sa prefix */
  7701. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7702. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7703. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7704. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7705. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7706. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7707. do { \
  7708. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7709. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7710. } while (0)
  7711. /* DWORD 2: Base Address LO */
  7712. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7713. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7714. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7715. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7716. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7717. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7718. do { \
  7719. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7720. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7721. } while (0)
  7722. /* DWORD 3: Base Address High */
  7723. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7724. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7725. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7726. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7727. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7728. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7729. do { \
  7730. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7731. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7732. } while (0)
  7733. /* DWORD 4-12: Hash Value */
  7734. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7735. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7736. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7737. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7738. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7739. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7740. do { \
  7741. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7742. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7743. } while (0)
  7744. /* DWORD 13: Hash Value 314:288 bits */
  7745. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7746. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7747. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7748. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7749. do { \
  7750. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7751. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7752. } while (0)
  7753. /**
  7754. * @brief Host-->target HTT RX FSE operation message
  7755. *
  7756. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7757. *
  7758. * @details
  7759. * The host will send this Flow Search Engine (FSE) operation message for
  7760. * every flow add/delete operation.
  7761. * The FSE operation includes FSE full cache invalidation or individual entry
  7762. * invalidation.
  7763. * This message can be sent per SOC or per PDEV which is differentiated
  7764. * by pdev id values.
  7765. *
  7766. * |31 16|15 8|7 1|0|
  7767. * |-------------------------------------------------------------|
  7768. * | reserved | pdev_id | MSG_TYPE |
  7769. * |-------------------------------------------------------------|
  7770. * | reserved | operation |I|
  7771. * |-------------------------------------------------------------|
  7772. * | ip_src_addr_31_0 |
  7773. * |-------------------------------------------------------------|
  7774. * | ip_src_addr_63_32 |
  7775. * |-------------------------------------------------------------|
  7776. * | ip_src_addr_95_64 |
  7777. * |-------------------------------------------------------------|
  7778. * | ip_src_addr_127_96 |
  7779. * |-------------------------------------------------------------|
  7780. * | ip_dst_addr_31_0 |
  7781. * |-------------------------------------------------------------|
  7782. * | ip_dst_addr_63_32 |
  7783. * |-------------------------------------------------------------|
  7784. * | ip_dst_addr_95_64 |
  7785. * |-------------------------------------------------------------|
  7786. * | ip_dst_addr_127_96 |
  7787. * |-------------------------------------------------------------|
  7788. * | l4_dst_port | l4_src_port |
  7789. * | (32-bit SPI incase of IPsec) |
  7790. * |-------------------------------------------------------------|
  7791. * | reserved | l4_proto |
  7792. * |-------------------------------------------------------------|
  7793. *
  7794. * where I is 1-bit ipsec_valid.
  7795. *
  7796. * The following field definitions describe the format of the RX FSE operation
  7797. * message sent from the host to target for every add/delete flow entry to flow
  7798. * table.
  7799. *
  7800. * Header fields:
  7801. * dword0 - b'7:0 - msg_type: This will be set to
  7802. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7803. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7804. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7805. * specified pdev's LMAC ring.
  7806. * b'31:16 - reserved : Reserved for future use
  7807. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7808. * (Internet Protocol Security).
  7809. * IPsec describes the framework for providing security at
  7810. * IP layer. IPsec is defined for both versions of IP:
  7811. * IPV4 and IPV6.
  7812. * Please refer to htt_rx_flow_proto enumeration below for
  7813. * more info.
  7814. * ipsec_valid = 1 for IPSEC packets
  7815. * ipsec_valid = 0 for IP Packets
  7816. * b'7:1 - operation: This indicates types of FSE operation.
  7817. * Refer to htt_rx_fse_operation enumeration:
  7818. * 0 - No Cache Invalidation required
  7819. * 1 - Cache invalidate only one entry given by IP
  7820. * src/dest address at DWORD[2:9]
  7821. * 2 - Complete FSE Cache Invalidation
  7822. * 3 - FSE Disable
  7823. * 4 - FSE Enable
  7824. * b'31:8 - reserved: Reserved for future use
  7825. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7826. * for per flow addition/deletion
  7827. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7828. * and the subsequent 3 A_UINT32 will be padding bytes.
  7829. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7830. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7831. * from 0 to 65535 but only 0 to 1023 are designated as
  7832. * well-known ports. Refer to [RFC1700] for more details.
  7833. * This field is valid only if
  7834. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7835. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7836. * range from 0 to 65535 but only 0 to 1023 are designated
  7837. * as well-known ports. Refer to [RFC1700] for more details.
  7838. * This field is valid only if
  7839. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7840. * - SPI (31:0): Security Parameters Index is an
  7841. * identification tag added to the header while using IPsec
  7842. * for tunneling the IP traffici.
  7843. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7844. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7845. * Assigned Internet Protocol Numbers.
  7846. * l4_proto numbers for standard protocol like UDP/TCP
  7847. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7848. * l4_proto = 17 for UDP etc.
  7849. * b'31:8 - reserved: Reserved for future use.
  7850. *
  7851. */
  7852. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7853. A_UINT32 msg_type:8,
  7854. pdev_id:8,
  7855. reserved0:16;
  7856. A_UINT32 ipsec_valid:1,
  7857. operation:7,
  7858. reserved1:24;
  7859. A_UINT32 ip_src_addr_31_0;
  7860. A_UINT32 ip_src_addr_63_32;
  7861. A_UINT32 ip_src_addr_95_64;
  7862. A_UINT32 ip_src_addr_127_96;
  7863. A_UINT32 ip_dest_addr_31_0;
  7864. A_UINT32 ip_dest_addr_63_32;
  7865. A_UINT32 ip_dest_addr_95_64;
  7866. A_UINT32 ip_dest_addr_127_96;
  7867. union {
  7868. A_UINT32 spi;
  7869. struct {
  7870. A_UINT32 l4_src_port:16,
  7871. l4_dest_port:16;
  7872. } ip;
  7873. } u;
  7874. A_UINT32 l4_proto:8,
  7875. reserved:24;
  7876. } POSTPACK;
  7877. /**
  7878. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7879. *
  7880. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7881. *
  7882. * @details
  7883. * The host will send this Full monitor mode register configuration message.
  7884. * This message can be sent per SOC or per PDEV which is differentiated
  7885. * by pdev id values.
  7886. *
  7887. * |31 16|15 11|10 8|7 3|2|1|0|
  7888. * |-------------------------------------------------------------|
  7889. * | reserved | pdev_id | MSG_TYPE |
  7890. * |-------------------------------------------------------------|
  7891. * | reserved |Release Ring |N|Z|E|
  7892. * |-------------------------------------------------------------|
  7893. *
  7894. * where E is 1-bit full monitor mode enable/disable.
  7895. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7896. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7897. *
  7898. * The following field definitions describe the format of the full monitor
  7899. * mode configuration message sent from the host to target for each pdev.
  7900. *
  7901. * Header fields:
  7902. * dword0 - b'7:0 - msg_type: This will be set to
  7903. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7904. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7905. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7906. * specified pdev's LMAC ring.
  7907. * b'31:16 - reserved : Reserved for future use.
  7908. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7909. * monitor mode rxdma register is to be enabled or disabled.
  7910. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7911. * additional descriptors at ppdu end for zero mpdus
  7912. * enabled or disabled.
  7913. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7914. * additional descriptors at ppdu end for non zero mpdus
  7915. * enabled or disabled.
  7916. * b'10:3 - release_ring: This indicates the destination ring
  7917. * selection for the descriptor at the end of PPDU
  7918. * 0 - REO ring select
  7919. * 1 - FW ring select
  7920. * 2 - SW ring select
  7921. * 3 - Release ring select
  7922. * Refer to htt_rx_full_mon_release_ring.
  7923. * b'31:11 - reserved for future use
  7924. */
  7925. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7926. A_UINT32 msg_type:8,
  7927. pdev_id:8,
  7928. reserved0:16;
  7929. A_UINT32 full_monitor_mode_enable:1,
  7930. addnl_descs_zero_mpdus_end:1,
  7931. addnl_descs_non_zero_mpdus_end:1,
  7932. release_ring:8,
  7933. reserved1:21;
  7934. } POSTPACK;
  7935. /**
  7936. * Enumeration for full monitor mode destination ring select
  7937. * 0 - REO destination ring select
  7938. * 1 - FW destination ring select
  7939. * 2 - SW destination ring select
  7940. * 3 - Release destination ring select
  7941. */
  7942. enum htt_rx_full_mon_release_ring {
  7943. HTT_RX_MON_RING_REO,
  7944. HTT_RX_MON_RING_FW,
  7945. HTT_RX_MON_RING_SW,
  7946. HTT_RX_MON_RING_RELEASE,
  7947. };
  7948. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7949. /* DWORD 0: Pdev ID */
  7950. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7951. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7952. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7953. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7954. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7955. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7956. do { \
  7957. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7958. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7959. } while (0)
  7960. /* DWORD 1:ENABLE */
  7961. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7962. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7963. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7964. do { \
  7965. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7966. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7967. } while (0)
  7968. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7969. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7970. /* DWORD 1:ZERO_MPDU */
  7971. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7972. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7973. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7974. do { \
  7975. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7976. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7977. } while (0)
  7978. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7979. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7980. /* DWORD 1:NON_ZERO_MPDU */
  7981. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7982. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7983. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7984. do { \
  7985. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7986. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7987. } while (0)
  7988. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7989. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7990. /* DWORD 1:RELEASE_RINGS */
  7991. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7992. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7993. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7994. do { \
  7995. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7996. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7997. } while (0)
  7998. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7999. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8000. /**
  8001. * Enumeration for IP Protocol or IPSEC Protocol
  8002. * IPsec describes the framework for providing security at IP layer.
  8003. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8004. */
  8005. enum htt_rx_flow_proto {
  8006. HTT_RX_FLOW_IP_PROTO,
  8007. HTT_RX_FLOW_IPSEC_PROTO,
  8008. };
  8009. /**
  8010. * Enumeration for FSE Cache Invalidation
  8011. * 0 - No Cache Invalidation required
  8012. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8013. * 2 - Complete FSE Cache Invalidation
  8014. * 3 - FSE Disable
  8015. * 4 - FSE Enable
  8016. */
  8017. enum htt_rx_fse_operation {
  8018. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8019. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8020. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8021. HTT_RX_FSE_DISABLE,
  8022. HTT_RX_FSE_ENABLE,
  8023. };
  8024. /* DWORD 0: Pdev ID */
  8025. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8026. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8027. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8028. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8029. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8030. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8031. do { \
  8032. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8033. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8034. } while (0)
  8035. /* DWORD 1:IP PROTO or IPSEC */
  8036. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8037. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8038. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8039. do { \
  8040. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8041. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8042. } while (0)
  8043. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8044. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8045. /* DWORD 1:FSE Operation */
  8046. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8047. #define HTT_RX_FSE_OPERATION_S 1
  8048. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8049. do { \
  8050. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8051. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8052. } while (0)
  8053. #define HTT_RX_FSE_OPERATION_GET(word) \
  8054. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8055. /* DWORD 2-9:IP Address */
  8056. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8057. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8058. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8059. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8060. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8061. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8062. do { \
  8063. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8064. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8065. } while (0)
  8066. /* DWORD 10:Source Port Number */
  8067. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8068. #define HTT_RX_FSE_SOURCEPORT_S 0
  8069. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8070. do { \
  8071. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8072. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8073. } while (0)
  8074. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8075. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8076. /* DWORD 11:Destination Port Number */
  8077. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8078. #define HTT_RX_FSE_DESTPORT_S 16
  8079. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8080. do { \
  8081. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8082. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8083. } while (0)
  8084. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8085. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8086. /* DWORD 10-11:SPI (In case of IPSEC) */
  8087. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8088. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8089. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8090. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8091. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8092. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8093. do { \
  8094. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8095. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8096. } while (0)
  8097. /* DWORD 12:L4 PROTO */
  8098. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8099. #define HTT_RX_FSE_L4_PROTO_S 0
  8100. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8101. do { \
  8102. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8103. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8104. } while (0)
  8105. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8106. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8107. /**
  8108. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8109. *
  8110. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8111. *
  8112. * |31 24|23 |15 8|7 2|1|0|
  8113. * |----------------+----------------+----------------+----------------|
  8114. * | reserved | pdev_id | msg_type |
  8115. * |---------------------------------+----------------+----------------|
  8116. * | reserved |E|F|
  8117. * |---------------------------------+----------------+----------------|
  8118. * Where E = Configure the target to provide the 3-tuple hash value in
  8119. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8120. * F = Configure the target to provide the 3-tuple hash value in
  8121. * flow_id_toeplitz field of rx_msdu_start tlv
  8122. *
  8123. * The following field definitions describe the format of the 3 tuple hash value
  8124. * message sent from the host to target as part of initialization sequence.
  8125. *
  8126. * Header fields:
  8127. * dword0 - b'7:0 - msg_type: This will be set to
  8128. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8129. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8130. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8131. * specified pdev's LMAC ring.
  8132. * b'31:16 - reserved : Reserved for future use
  8133. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8134. * b'1 - toeplitz_hash_2_or_4_field_enable
  8135. * b'31:2 - reserved : Reserved for future use
  8136. * ---------+------+----------------------------------------------------------
  8137. * bit1 | bit0 | Functionality
  8138. * ---------+------+----------------------------------------------------------
  8139. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8140. * | | in flow_id_toeplitz field
  8141. * ---------+------+----------------------------------------------------------
  8142. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8143. * | | in toeplitz_hash_2_or_4 field
  8144. * ---------+------+----------------------------------------------------------
  8145. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8146. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8147. * ---------+------+----------------------------------------------------------
  8148. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8149. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8150. * | | toeplitz_hash_2_or_4 field
  8151. *----------------------------------------------------------------------------
  8152. */
  8153. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8154. A_UINT32 msg_type :8,
  8155. pdev_id :8,
  8156. reserved0 :16;
  8157. A_UINT32 flow_id_toeplitz_field_enable :1,
  8158. toeplitz_hash_2_or_4_field_enable :1,
  8159. reserved1 :30;
  8160. } POSTPACK;
  8161. /* DWORD0 : pdev_id configuration Macros */
  8162. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8163. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8164. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8165. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8166. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8167. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8168. do { \
  8169. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8170. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8171. } while (0)
  8172. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8173. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8174. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8175. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8176. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8177. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8178. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8179. do { \
  8180. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8181. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8182. } while (0)
  8183. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8184. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8185. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8186. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8187. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8188. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8189. do { \
  8190. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8191. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8192. } while (0)
  8193. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8194. /**
  8195. * @brief host --> target Host PA Address Size
  8196. *
  8197. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8198. *
  8199. * @details
  8200. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8201. * provide the physical start address and size of each of the memory
  8202. * areas within host DDR that the target FW may need to access.
  8203. *
  8204. * For example, the host can use this message to allow the target FW
  8205. * to set up access to the host's pools of TQM link descriptors.
  8206. * The message would appear as follows:
  8207. *
  8208. * |31 24|23 16|15 8|7 0|
  8209. * |----------------+----------------+----------------+----------------|
  8210. * | reserved | num_entries | msg_type |
  8211. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8212. * | mem area 0 size |
  8213. * |----------------+----------------+----------------+----------------|
  8214. * | mem area 0 physical_address_lo |
  8215. * |----------------+----------------+----------------+----------------|
  8216. * | mem area 0 physical_address_hi |
  8217. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8218. * | mem area 1 size |
  8219. * |----------------+----------------+----------------+----------------|
  8220. * | mem area 1 physical_address_lo |
  8221. * |----------------+----------------+----------------+----------------|
  8222. * | mem area 1 physical_address_hi |
  8223. * |----------------+----------------+----------------+----------------|
  8224. * ...
  8225. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8226. * | mem area N size |
  8227. * |----------------+----------------+----------------+----------------|
  8228. * | mem area N physical_address_lo |
  8229. * |----------------+----------------+----------------+----------------|
  8230. * | mem area N physical_address_hi |
  8231. * |----------------+----------------+----------------+----------------|
  8232. *
  8233. * The message is interpreted as follows:
  8234. * dword0 - b'0:7 - msg_type: This will be set to
  8235. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8236. * b'8:15 - number_entries: Indicated the number of host memory
  8237. * areas specified within the remainder of the message
  8238. * b'16:31 - reserved.
  8239. * dword1 - b'0:31 - memory area 0 size in bytes
  8240. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8241. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8242. * and similar for memory area 1 through memory area N.
  8243. */
  8244. PREPACK struct htt_h2t_host_paddr_size {
  8245. A_UINT32 msg_type: 8,
  8246. num_entries: 8,
  8247. reserved: 16;
  8248. } POSTPACK;
  8249. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8250. A_UINT32 size;
  8251. A_UINT32 physical_address_lo;
  8252. A_UINT32 physical_address_hi;
  8253. } POSTPACK;
  8254. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8255. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8256. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8257. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8258. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8259. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8260. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8261. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8262. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8263. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8264. do { \
  8265. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8266. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8267. } while (0)
  8268. /**
  8269. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8270. *
  8271. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8272. *
  8273. * @details
  8274. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8275. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8276. *
  8277. * The message would appear as follows:
  8278. *
  8279. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8280. * |---------------------------------+---+---+----------+-+-----------|
  8281. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8282. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8283. *
  8284. *
  8285. * The message is interpreted as follows:
  8286. * dword0 - b'0:7 - msg_type: This will be set to
  8287. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8288. * b'8 - override bit to drive MSDUs to PPE ring
  8289. * b'9:13 - REO destination ring indication
  8290. * b'14 - Multi buffer msdu override enable bit
  8291. * b'15 - Intra BSS override
  8292. * b'16 - Decap raw override
  8293. * b'17 - Decap Native wifi override
  8294. * b'18 - IP frag override
  8295. * b'19:31 - reserved
  8296. */
  8297. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8298. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8299. override: 1,
  8300. reo_destination_indication: 5,
  8301. multi_buffer_msdu_override_en: 1,
  8302. intra_bss_override: 1,
  8303. decap_raw_override: 1,
  8304. decap_nwifi_override: 1,
  8305. ip_frag_override: 1,
  8306. reserved: 13;
  8307. } POSTPACK;
  8308. /* DWORD 0: Override */
  8309. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8310. #define HTT_PPE_CFG_OVERRIDE_S 8
  8311. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8312. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8313. HTT_PPE_CFG_OVERRIDE_S)
  8314. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8315. do { \
  8316. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8317. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8318. } while (0)
  8319. /* DWORD 0: REO Destination Indication*/
  8320. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8321. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8322. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8323. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8324. HTT_PPE_CFG_REO_DEST_IND_S)
  8325. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8326. do { \
  8327. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8328. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8329. } while (0)
  8330. /* DWORD 0: Multi buffer MSDU override */
  8331. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8332. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8333. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8334. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8335. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8336. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8337. do { \
  8338. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8339. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8340. } while (0)
  8341. /* DWORD 0: Intra BSS override */
  8342. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8343. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8344. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8345. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8346. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8347. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8348. do { \
  8349. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8350. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8351. } while (0)
  8352. /* DWORD 0: Decap RAW override */
  8353. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8354. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8355. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8356. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8357. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8358. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8359. do { \
  8360. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8361. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8362. } while (0)
  8363. /* DWORD 0: Decap NWIFI override */
  8364. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8365. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8366. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8367. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8368. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8369. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8370. do { \
  8371. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8372. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8373. } while (0)
  8374. /* DWORD 0: IP frag override */
  8375. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8376. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8377. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8378. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8379. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8380. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8381. do { \
  8382. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8383. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8384. } while (0)
  8385. /*
  8386. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8387. *
  8388. * @details
  8389. * The following field definitions describe the format of the HTT host
  8390. * to target FW VDEV TX RX stats retrieve message.
  8391. * The message specifies the type of stats the host wants to retrieve.
  8392. *
  8393. * |31 27|26 25|24 17|16|15 8|7 0|
  8394. * |-----------------------------------------------------------|
  8395. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8396. * |-----------------------------------------------------------|
  8397. * | vdev_id lower bitmask |
  8398. * |-----------------------------------------------------------|
  8399. * | vdev_id upper bitmask |
  8400. * |-----------------------------------------------------------|
  8401. * Header fields:
  8402. * Where:
  8403. * dword0 - b'7:0 - msg_type: This will be set to
  8404. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8405. * b'15:8 - pdev id
  8406. * b'16(E) - Enable/Disable the vdev HW stats
  8407. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8408. * b'25:26(R) - Reset stats bits
  8409. * 0: don't reset stats
  8410. * 1: reset stats once
  8411. * 2: reset stats at the start of each periodic interval
  8412. * b'27:31 - reserved for future use
  8413. * dword1 - b'0:31 - vdev_id lower bitmask
  8414. * dword2 - b'0:31 - vdev_id upper bitmask
  8415. */
  8416. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8417. A_UINT32 msg_type :8,
  8418. pdev_id :8,
  8419. enable :1,
  8420. periodic_interval :8,
  8421. reset_stats_bits :2,
  8422. reserved0 :5;
  8423. A_UINT32 vdev_id_lower_bitmask;
  8424. A_UINT32 vdev_id_upper_bitmask;
  8425. } POSTPACK;
  8426. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8427. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8428. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8429. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8430. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8431. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8432. do { \
  8433. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8434. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8435. } while (0)
  8436. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8437. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8438. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8439. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8440. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8441. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8444. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8445. } while (0)
  8446. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8447. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8448. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8449. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8450. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8451. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8454. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8455. } while (0)
  8456. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8457. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8458. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8459. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8460. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8461. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8462. do { \
  8463. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8464. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8465. } while (0)
  8466. /*
  8467. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8468. *
  8469. * @details
  8470. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8471. * the default MSDU queues for one of the TIDs within the specified peer
  8472. * to the specified service class.
  8473. * The TID is indirectly specified - each service class is associated
  8474. * with a TID. All default MSDU queues for this peer-TID will be
  8475. * linked to the service class in question.
  8476. *
  8477. * |31 16|15 8|7 0|
  8478. * |------------------------------+--------------+--------------|
  8479. * | peer ID | svc class ID | msg type |
  8480. * |------------------------------------------------------------|
  8481. * Header fields:
  8482. * dword0 - b'7:0 - msg_type: This will be set to
  8483. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8484. * b'15:8 - service class ID
  8485. * b'31:16 - peer ID
  8486. */
  8487. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8488. A_UINT32 msg_type :8,
  8489. svc_class_id :8,
  8490. peer_id :16;
  8491. } POSTPACK;
  8492. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8493. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8494. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8495. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8496. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8497. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8498. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8499. do { \
  8500. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8501. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8502. } while (0)
  8503. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8504. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8505. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8506. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8507. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8508. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8511. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8512. } while (0)
  8513. /*
  8514. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8515. *
  8516. * @details
  8517. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8518. * remove the linkage of the specified peer-TID's MSDU queues to
  8519. * service classes.
  8520. *
  8521. * |31 16|15 8|7 0|
  8522. * |------------------------------+--------------+--------------|
  8523. * | peer ID | svc class ID | msg type |
  8524. * |------------------------------------------------------------|
  8525. * Header fields:
  8526. * dword0 - b'7:0 - msg_type: This will be set to
  8527. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8528. * b'15:8 - service class ID
  8529. * b'31:16 - peer ID
  8530. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8531. * value for peer ID indicates that the target should
  8532. * apply the UNMAP_REQ to all peers.
  8533. */
  8534. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8535. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8536. A_UINT32 msg_type :8,
  8537. svc_class_id :8,
  8538. peer_id :16;
  8539. } POSTPACK;
  8540. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8541. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8542. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8543. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8544. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8545. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8546. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8547. do { \
  8548. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8549. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8550. } while (0)
  8551. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8552. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8553. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8554. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8555. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8556. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8557. do { \
  8558. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8559. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8560. } while (0)
  8561. /*
  8562. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8563. *
  8564. * @details
  8565. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8566. * request the target to report what service class the default MSDU queues
  8567. * of the specified TIDs within the peer are linked to.
  8568. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8569. * to report what service class (if any) the default MSDU queues for
  8570. * each of the specified TIDs are linked to.
  8571. *
  8572. * |31 16|15 8|7 1| 0|
  8573. * |------------------------------+--------------+--------------|
  8574. * | peer ID | TID mask | msg type |
  8575. * |------------------------------------------------------------|
  8576. * | reserved |ETO|
  8577. * |------------------------------------------------------------|
  8578. * Header fields:
  8579. * dword0 - b'7:0 - msg_type: This will be set to
  8580. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8581. * b'15:8 - TID mask
  8582. * b'31:16 - peer ID
  8583. * dword1 - b'0 - "Existing Tids Only" flag
  8584. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8585. * message generated by this REQ will only show the
  8586. * mapping for TIDs that actually exist in the target's
  8587. * peer object.
  8588. * Any TIDs that are covered by a MAP_REQ but which
  8589. * do not actually exist will be shown as being
  8590. * unmapped (i.e. svc class ID 0xff).
  8591. * If this flag is cleared, the MAP_REPORT_CONF message
  8592. * will consider not only the mapping of TIDs currently
  8593. * existing in the peer, but also the mapping that will
  8594. * be applied for any TID objects created within this
  8595. * peer in the future.
  8596. * b'31:1 - reserved for future use
  8597. */
  8598. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8599. A_UINT32 msg_type :8,
  8600. tid_mask :8,
  8601. peer_id :16;
  8602. A_UINT32 existing_tids_only:1,
  8603. reserved :31;
  8604. } POSTPACK;
  8605. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8606. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8607. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8608. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8609. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8610. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8611. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8612. do { \
  8613. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8614. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8615. } while (0)
  8616. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8617. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8618. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8619. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8620. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8621. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8624. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8625. } while (0)
  8626. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8627. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8628. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8629. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8630. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8631. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8632. do { \
  8633. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8634. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8635. } while (0)
  8636. /**
  8637. * @brief Format of shared memory between Host and Target
  8638. * for UMAC hang recovery feature messaging.
  8639. * @details
  8640. * This is shared memory between Host and Target allocated
  8641. * and used in chips where UMAC hang recovery feature is supported.
  8642. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8643. * then host interprets it as a new message from target.
  8644. * Host clears that particular read bit in t2h_msg after each read
  8645. * operation. It is vice versa for h2t_msg. At any given point
  8646. * of time there is expected to be only one bit set
  8647. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8648. *
  8649. * The message is interpreted as follows:
  8650. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8651. * added for debuggability purpose.
  8652. * dword1 - b'0 - do_pre_reset
  8653. * b'1 - do_post_reset_start
  8654. * b'2 - do_post_reset_complete
  8655. * b'3:31 - rsvd_t2h
  8656. * dword2 - b'0 - pre_reset_done
  8657. * b'1 - post_reset_start_done
  8658. * b'2 - post_reset_complete_done
  8659. * b'3:31 - rsvd_h2t
  8660. */
  8661. PREPACK typedef struct {
  8662. /** Magic number added for debuggability. */
  8663. A_UINT32 magic_num;
  8664. union {
  8665. /*
  8666. * BIT [0] :- T2H msg to do pre-reset
  8667. * BIT [1] :- T2H msg to do post-reset start
  8668. * BIT [2] :- T2H msg to do post-reset complete
  8669. * BIT [31 : 3] :- reserved
  8670. */
  8671. A_UINT32 t2h_msg;
  8672. struct {
  8673. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8674. do_post_reset_start : 1, /* BIT [1] */
  8675. do_post_reset_complete : 1, /* BIT [2] */
  8676. rsvd_t2h : 29; /* BIT [31 : 3] */
  8677. };
  8678. };
  8679. union {
  8680. /*
  8681. * BIT [0] :- H2T msg to send pre-reset done
  8682. * BIT [1] :- H2T msg to send post-reset start done
  8683. * BIT [2] :- H2T msg to send post-reset complete done
  8684. * BIT [31 : 3] :- reserved
  8685. */
  8686. A_UINT32 h2t_msg;
  8687. struct {
  8688. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8689. post_reset_start_done : 1, /* BIT [1] */
  8690. post_reset_complete_done : 1, /* BIT [2] */
  8691. rsvd_h2t : 29; /* BIT [31 : 3] */
  8692. };
  8693. };
  8694. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8695. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8696. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8697. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8698. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8699. /* dword1 - b'0 - do_pre_reset */
  8700. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8701. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8702. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8703. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8704. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8705. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8706. do { \
  8707. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8708. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8709. } while (0)
  8710. /* dword1 - b'1 - do_post_reset_start */
  8711. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8712. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8713. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8714. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8715. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8716. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8717. do { \
  8718. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8719. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8720. } while (0)
  8721. /* dword1 - b'2 - do_post_reset_complete */
  8722. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8723. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8724. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8725. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8726. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8727. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8728. do { \
  8729. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8730. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8731. } while (0)
  8732. /* dword2 - b'0 - pre_reset_done */
  8733. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8734. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8735. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8736. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8737. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8738. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8739. do { \
  8740. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8741. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8742. } while (0)
  8743. /* dword2 - b'1 - post_reset_start_done */
  8744. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8745. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8746. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8747. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8748. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8749. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8750. do { \
  8751. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8752. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8753. } while (0)
  8754. /* dword2 - b'2 - post_reset_complete_done */
  8755. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8756. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8757. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8758. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8759. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8760. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8761. do { \
  8762. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8763. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8764. } while (0)
  8765. /**
  8766. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8767. *
  8768. * @details
  8769. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8770. * by the host to provide prerequisite info to target for the UMAC hang
  8771. * recovery feature.
  8772. * The info sent in this H2T message are T2H message method, H2T message
  8773. * method, T2H MSI interrupt number and physical start address, size of
  8774. * the shared memory (refers to the shared memory dedicated for messaging
  8775. * between host and target when the DUT is in UMAC hang recovery mode).
  8776. * This H2T message is expected to be only sent if the WMI service bit
  8777. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8778. *
  8779. * |31 16|15 12|11 8|7 0|
  8780. * |-------------------------------+--------------+--------------+------------|
  8781. * | reserved |h2t msg method|t2h msg method| msg_type |
  8782. * |--------------------------------------------------------------------------|
  8783. * | t2h msi interrupt number |
  8784. * |--------------------------------------------------------------------------|
  8785. * | shared memory area size |
  8786. * |--------------------------------------------------------------------------|
  8787. * | shared memory area physical address low |
  8788. * |--------------------------------------------------------------------------|
  8789. * | shared memory area physical address high |
  8790. * |--------------------------------------------------------------------------|
  8791. *
  8792. * The message is interpreted as follows:
  8793. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8794. * b'8:11 - t2h_msg_method: indicates method to be used for
  8795. * T2H communication in UMAC hang recovery mode.
  8796. * Value zero indicates MSI interrupt (default method).
  8797. * Refer to htt_umac_hang_recovery_msg_method enum.
  8798. * b'12:15 - h2t_msg_method: indicates method to be used for
  8799. * H2T communication in UMAC hang recovery mode.
  8800. * Value zero indicates polling by target for this h2t msg
  8801. * during UMAC hang recovery mode.
  8802. * Refer to htt_umac_hang_recovery_msg_method enum.
  8803. * b'16:31 - reserved.
  8804. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8805. * T2H communication in UMAC hang recovery mode.
  8806. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8807. * only when in UMAC hang recovery mode.
  8808. * This refers to size in bytes.
  8809. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8810. * of the shared memory dedicated for messaging only when
  8811. * in UMAC hang recovery mode.
  8812. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8813. * of the shared memory dedicated for messaging only when
  8814. * in UMAC hang recovery mode.
  8815. */
  8816. /* t2h_msg_method and h2t_msg_method */
  8817. enum htt_umac_hang_recovery_msg_method {
  8818. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8819. };
  8820. PREPACK typedef struct {
  8821. A_UINT32 msg_type : 8,
  8822. t2h_msg_method : 4,
  8823. h2t_msg_method : 4,
  8824. reserved : 16;
  8825. A_UINT32 t2h_msi_data;
  8826. /* size bytes and physical address of shared memory. */
  8827. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8828. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8829. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8830. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8831. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8832. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8833. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8834. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8835. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8836. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8837. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8838. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8839. do { \
  8840. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8841. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8842. } while (0)
  8843. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8844. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8845. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8846. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8847. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8848. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8849. do { \
  8850. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8851. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8852. } while (0)
  8853. /*=== target -> host messages ===============================================*/
  8854. enum htt_t2h_msg_type {
  8855. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8856. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8857. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8858. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8859. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8860. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8861. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8862. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8863. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8864. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8865. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8866. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8867. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8868. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8869. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8870. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8871. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8872. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8873. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8874. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8875. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8876. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8877. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8878. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8879. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8880. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8881. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8882. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8883. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8884. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8885. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8886. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8887. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8888. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8889. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8890. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8891. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8892. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8893. /* TX_OFFLOAD_DELIVER_IND:
  8894. * Forward the target's locally-generated packets to the host,
  8895. * to provide to the monitor mode interface.
  8896. */
  8897. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8898. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8899. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8900. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8901. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8902. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8903. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8904. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8905. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8906. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8907. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8908. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8909. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8910. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8911. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8912. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8913. HTT_T2H_MSG_TYPE_TEST,
  8914. /* keep this last */
  8915. HTT_T2H_NUM_MSGS
  8916. };
  8917. /*
  8918. * HTT target to host message type -
  8919. * stored in bits 7:0 of the first word of the message
  8920. */
  8921. #define HTT_T2H_MSG_TYPE_M 0xff
  8922. #define HTT_T2H_MSG_TYPE_S 0
  8923. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8924. do { \
  8925. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8926. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8927. } while (0)
  8928. #define HTT_T2H_MSG_TYPE_GET(word) \
  8929. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8930. /**
  8931. * @brief target -> host version number confirmation message definition
  8932. *
  8933. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8934. *
  8935. * |31 24|23 16|15 8|7 0|
  8936. * |----------------+----------------+----------------+----------------|
  8937. * | reserved | major number | minor number | msg type |
  8938. * |-------------------------------------------------------------------|
  8939. * : option request TLV (optional) |
  8940. * :...................................................................:
  8941. *
  8942. * The VER_CONF message may consist of a single 4-byte word, or may be
  8943. * extended with TLVs that specify HTT options selected by the target.
  8944. * The following option TLVs may be appended to the VER_CONF message:
  8945. * - LL_BUS_ADDR_SIZE
  8946. * - HL_SUPPRESS_TX_COMPL_IND
  8947. * - MAX_TX_QUEUE_GROUPS
  8948. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8949. * may be appended to the VER_CONF message (but only one TLV of each type).
  8950. *
  8951. * Header fields:
  8952. * - MSG_TYPE
  8953. * Bits 7:0
  8954. * Purpose: identifies this as a version number confirmation message
  8955. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8956. * - VER_MINOR
  8957. * Bits 15:8
  8958. * Purpose: Specify the minor number of the HTT message library version
  8959. * in use by the target firmware.
  8960. * The minor number specifies the specific revision within a range
  8961. * of fundamentally compatible HTT message definition revisions.
  8962. * Compatible revisions involve adding new messages or perhaps
  8963. * adding new fields to existing messages, in a backwards-compatible
  8964. * manner.
  8965. * Incompatible revisions involve changing the message type values,
  8966. * or redefining existing messages.
  8967. * Value: minor number
  8968. * - VER_MAJOR
  8969. * Bits 15:8
  8970. * Purpose: Specify the major number of the HTT message library version
  8971. * in use by the target firmware.
  8972. * The major number specifies the family of minor revisions that are
  8973. * fundamentally compatible with each other, but not with prior or
  8974. * later families.
  8975. * Value: major number
  8976. */
  8977. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8978. #define HTT_VER_CONF_MINOR_S 8
  8979. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8980. #define HTT_VER_CONF_MAJOR_S 16
  8981. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8984. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8985. } while (0)
  8986. #define HTT_VER_CONF_MINOR_GET(word) \
  8987. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8988. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8991. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8992. } while (0)
  8993. #define HTT_VER_CONF_MAJOR_GET(word) \
  8994. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8995. #define HTT_VER_CONF_BYTES 4
  8996. /**
  8997. * @brief - target -> host HTT Rx In order indication message
  8998. *
  8999. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9000. *
  9001. * @details
  9002. *
  9003. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9004. * |----------------+-------------------+---------------------+---------------|
  9005. * | peer ID | P| F| O| ext TID | msg type |
  9006. * |--------------------------------------------------------------------------|
  9007. * | MSDU count | Reserved | vdev id |
  9008. * |--------------------------------------------------------------------------|
  9009. * | MSDU 0 bus address (bits 31:0) |
  9010. #if HTT_PADDR64
  9011. * | MSDU 0 bus address (bits 63:32) |
  9012. #endif
  9013. * |--------------------------------------------------------------------------|
  9014. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9015. * |--------------------------------------------------------------------------|
  9016. * | MSDU 1 bus address (bits 31:0) |
  9017. #if HTT_PADDR64
  9018. * | MSDU 1 bus address (bits 63:32) |
  9019. #endif
  9020. * |--------------------------------------------------------------------------|
  9021. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9022. * |--------------------------------------------------------------------------|
  9023. */
  9024. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9025. *
  9026. * @details
  9027. * bits
  9028. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9029. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9030. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9031. * | | frag | | | | fail |chksum fail|
  9032. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9033. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9034. */
  9035. struct htt_rx_in_ord_paddr_ind_hdr_t
  9036. {
  9037. A_UINT32 /* word 0 */
  9038. msg_type: 8,
  9039. ext_tid: 5,
  9040. offload: 1,
  9041. frag: 1,
  9042. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9043. peer_id: 16;
  9044. A_UINT32 /* word 1 */
  9045. vap_id: 8,
  9046. /* NOTE:
  9047. * This reserved_1 field is not truly reserved - certain targets use
  9048. * this field internally to store debug information, and do not zero
  9049. * out the contents of the field before uploading the message to the
  9050. * host. Thus, any host-target communication supported by this field
  9051. * is limited to using values that are never used by the debug
  9052. * information stored by certain targets in the reserved_1 field.
  9053. * In particular, the targets in question don't use the value 0x3
  9054. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9055. * so this previously-unused value within these bits is available to
  9056. * use as the host / target PKT_CAPTURE_MODE flag.
  9057. */
  9058. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9059. /* if pkt_capture_mode == 0x3, host should
  9060. * send rx frames to monitor mode interface
  9061. */
  9062. msdu_cnt: 16;
  9063. };
  9064. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9065. {
  9066. A_UINT32 dma_addr;
  9067. A_UINT32
  9068. length: 16,
  9069. fw_desc: 8,
  9070. msdu_info:8;
  9071. };
  9072. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9073. {
  9074. A_UINT32 dma_addr_lo;
  9075. A_UINT32 dma_addr_hi;
  9076. A_UINT32
  9077. length: 16,
  9078. fw_desc: 8,
  9079. msdu_info:8;
  9080. };
  9081. #if HTT_PADDR64
  9082. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9083. #else
  9084. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9085. #endif
  9086. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9087. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9088. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9089. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9090. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9091. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9092. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9093. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9094. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9095. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9096. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9097. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9098. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9099. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9100. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9101. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9102. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9103. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9104. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9105. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9106. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9107. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9108. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9109. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9110. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9111. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9112. /* for systems using 64-bit format for bus addresses */
  9113. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9114. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9115. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9116. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9117. /* for systems using 32-bit format for bus addresses */
  9118. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9119. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9120. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9121. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9122. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9123. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9124. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9125. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9126. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9127. do { \
  9128. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9129. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9130. } while (0)
  9131. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9132. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9133. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9136. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9137. } while (0)
  9138. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9139. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9140. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9143. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9144. } while (0)
  9145. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9146. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9147. /*
  9148. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9149. * deliver the rx frames to the monitor mode interface.
  9150. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9151. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9152. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9153. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9154. */
  9155. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9156. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9157. do { \
  9158. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9159. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9160. } while (0)
  9161. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9162. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9163. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9164. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9167. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9168. } while (0)
  9169. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9170. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9171. /* for systems using 64-bit format for bus addresses */
  9172. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9173. do { \
  9174. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9175. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9176. } while (0)
  9177. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9178. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9179. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9180. do { \
  9181. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9182. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9183. } while (0)
  9184. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9185. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9186. /* for systems using 32-bit format for bus addresses */
  9187. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9188. do { \
  9189. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9190. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9191. } while (0)
  9192. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9193. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9195. do { \
  9196. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9197. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9198. } while (0)
  9199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9200. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9201. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9204. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9205. } while (0)
  9206. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9207. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9208. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9209. do { \
  9210. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9211. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9212. } while (0)
  9213. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9214. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9215. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9216. do { \
  9217. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9218. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9219. } while (0)
  9220. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9221. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9222. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9223. do { \
  9224. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9225. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9226. } while (0)
  9227. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9228. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9229. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9230. do { \
  9231. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9232. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9233. } while (0)
  9234. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9235. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9236. /* definitions used within target -> host rx indication message */
  9237. PREPACK struct htt_rx_ind_hdr_prefix_t
  9238. {
  9239. A_UINT32 /* word 0 */
  9240. msg_type: 8,
  9241. ext_tid: 5,
  9242. release_valid: 1,
  9243. flush_valid: 1,
  9244. reserved0: 1,
  9245. peer_id: 16;
  9246. A_UINT32 /* word 1 */
  9247. flush_start_seq_num: 6,
  9248. flush_end_seq_num: 6,
  9249. release_start_seq_num: 6,
  9250. release_end_seq_num: 6,
  9251. num_mpdu_ranges: 8;
  9252. } POSTPACK;
  9253. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9254. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9255. #define HTT_TGT_RSSI_INVALID 0x80
  9256. PREPACK struct htt_rx_ppdu_desc_t
  9257. {
  9258. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9259. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9260. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9261. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9262. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9263. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9264. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9265. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9266. A_UINT32 /* word 0 */
  9267. rssi_cmb: 8,
  9268. timestamp_submicrosec: 8,
  9269. phy_err_code: 8,
  9270. phy_err: 1,
  9271. legacy_rate: 4,
  9272. legacy_rate_sel: 1,
  9273. end_valid: 1,
  9274. start_valid: 1;
  9275. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9276. union {
  9277. A_UINT32 /* word 1 */
  9278. rssi0_pri20: 8,
  9279. rssi0_ext20: 8,
  9280. rssi0_ext40: 8,
  9281. rssi0_ext80: 8;
  9282. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9283. } u0;
  9284. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9285. union {
  9286. A_UINT32 /* word 2 */
  9287. rssi1_pri20: 8,
  9288. rssi1_ext20: 8,
  9289. rssi1_ext40: 8,
  9290. rssi1_ext80: 8;
  9291. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9292. } u1;
  9293. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9294. union {
  9295. A_UINT32 /* word 3 */
  9296. rssi2_pri20: 8,
  9297. rssi2_ext20: 8,
  9298. rssi2_ext40: 8,
  9299. rssi2_ext80: 8;
  9300. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9301. } u2;
  9302. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9303. union {
  9304. A_UINT32 /* word 4 */
  9305. rssi3_pri20: 8,
  9306. rssi3_ext20: 8,
  9307. rssi3_ext40: 8,
  9308. rssi3_ext80: 8;
  9309. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9310. } u3;
  9311. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9312. A_UINT32 tsf32; /* word 5 */
  9313. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9314. A_UINT32 timestamp_microsec; /* word 6 */
  9315. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9316. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9317. A_UINT32 /* word 7 */
  9318. vht_sig_a1: 24,
  9319. preamble_type: 8;
  9320. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9321. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9322. A_UINT32 /* word 8 */
  9323. vht_sig_a2: 24,
  9324. /* sa_ant_matrix
  9325. * For cases where a single rx chain has options to be connected to
  9326. * different rx antennas, show which rx antennas were in use during
  9327. * receipt of a given PPDU.
  9328. * This sa_ant_matrix provides a bitmask of the antennas used while
  9329. * receiving this frame.
  9330. */
  9331. sa_ant_matrix: 8;
  9332. } POSTPACK;
  9333. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9334. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9335. PREPACK struct htt_rx_ind_hdr_suffix_t
  9336. {
  9337. A_UINT32 /* word 0 */
  9338. fw_rx_desc_bytes: 16,
  9339. reserved0: 16;
  9340. } POSTPACK;
  9341. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9342. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9343. PREPACK struct htt_rx_ind_hdr_t
  9344. {
  9345. struct htt_rx_ind_hdr_prefix_t prefix;
  9346. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9347. struct htt_rx_ind_hdr_suffix_t suffix;
  9348. } POSTPACK;
  9349. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9350. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9351. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9352. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9353. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9354. /*
  9355. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9356. * the offset into the HTT rx indication message at which the
  9357. * FW rx PPDU descriptor resides
  9358. */
  9359. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9360. /*
  9361. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9362. * the offset into the HTT rx indication message at which the
  9363. * header suffix (FW rx MSDU byte count) resides
  9364. */
  9365. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9366. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9367. /*
  9368. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9369. * the offset into the HTT rx indication message at which the per-MSDU
  9370. * information starts
  9371. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9372. * per-MSDU information portion of the message. The per-MSDU info itself
  9373. * starts at byte 12.
  9374. */
  9375. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9376. /**
  9377. * @brief target -> host rx indication message definition
  9378. *
  9379. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9380. *
  9381. * @details
  9382. * The following field definitions describe the format of the rx indication
  9383. * message sent from the target to the host.
  9384. * The message consists of three major sections:
  9385. * 1. a fixed-length header
  9386. * 2. a variable-length list of firmware rx MSDU descriptors
  9387. * 3. one or more 4-octet MPDU range information elements
  9388. * The fixed length header itself has two sub-sections
  9389. * 1. the message meta-information, including identification of the
  9390. * sender and type of the received data, and a 4-octet flush/release IE
  9391. * 2. the firmware rx PPDU descriptor
  9392. *
  9393. * The format of the message is depicted below.
  9394. * in this depiction, the following abbreviations are used for information
  9395. * elements within the message:
  9396. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9397. * elements associated with the PPDU start are valid.
  9398. * Specifically, the following fields are valid only if SV is set:
  9399. * RSSI (all variants), L, legacy rate, preamble type, service,
  9400. * VHT-SIG-A
  9401. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9402. * elements associated with the PPDU end are valid.
  9403. * Specifically, the following fields are valid only if EV is set:
  9404. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9405. * - L - Legacy rate selector - if legacy rates are used, this flag
  9406. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9407. * (L == 0) PHY.
  9408. * - P - PHY error flag - boolean indication of whether the rx frame had
  9409. * a PHY error
  9410. *
  9411. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9412. * |----------------+-------------------+---------------------+---------------|
  9413. * | peer ID | |RV|FV| ext TID | msg type |
  9414. * |--------------------------------------------------------------------------|
  9415. * | num | release | release | flush | flush |
  9416. * | MPDU | end | start | end | start |
  9417. * | ranges | seq num | seq num | seq num | seq num |
  9418. * |==========================================================================|
  9419. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9420. * |V|V| | rate | | | timestamp | RSSI |
  9421. * |--------------------------------------------------------------------------|
  9422. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9423. * |--------------------------------------------------------------------------|
  9424. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9425. * |--------------------------------------------------------------------------|
  9426. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9427. * |--------------------------------------------------------------------------|
  9428. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9429. * |--------------------------------------------------------------------------|
  9430. * | TSF LSBs |
  9431. * |--------------------------------------------------------------------------|
  9432. * | microsec timestamp |
  9433. * |--------------------------------------------------------------------------|
  9434. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9435. * |--------------------------------------------------------------------------|
  9436. * | service | HT-SIG / VHT-SIG-A2 |
  9437. * |==========================================================================|
  9438. * | reserved | FW rx desc bytes |
  9439. * |--------------------------------------------------------------------------|
  9440. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9441. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9442. * |--------------------------------------------------------------------------|
  9443. * : : :
  9444. * |--------------------------------------------------------------------------|
  9445. * | alignment | MSDU Rx |
  9446. * | padding | desc Bn |
  9447. * |--------------------------------------------------------------------------|
  9448. * | reserved | MPDU range status | MPDU count |
  9449. * |--------------------------------------------------------------------------|
  9450. * : reserved : MPDU range status : MPDU count :
  9451. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9452. *
  9453. * Header fields:
  9454. * - MSG_TYPE
  9455. * Bits 7:0
  9456. * Purpose: identifies this as an rx indication message
  9457. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9458. * - EXT_TID
  9459. * Bits 12:8
  9460. * Purpose: identify the traffic ID of the rx data, including
  9461. * special "extended" TID values for multicast, broadcast, and
  9462. * non-QoS data frames
  9463. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9464. * - FLUSH_VALID (FV)
  9465. * Bit 13
  9466. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9467. * is valid
  9468. * Value:
  9469. * 1 -> flush IE is valid and needs to be processed
  9470. * 0 -> flush IE is not valid and should be ignored
  9471. * - REL_VALID (RV)
  9472. * Bit 13
  9473. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9474. * is valid
  9475. * Value:
  9476. * 1 -> release IE is valid and needs to be processed
  9477. * 0 -> release IE is not valid and should be ignored
  9478. * - PEER_ID
  9479. * Bits 31:16
  9480. * Purpose: Identify, by ID, which peer sent the rx data
  9481. * Value: ID of the peer who sent the rx data
  9482. * - FLUSH_SEQ_NUM_START
  9483. * Bits 5:0
  9484. * Purpose: Indicate the start of a series of MPDUs to flush
  9485. * Not all MPDUs within this series are necessarily valid - the host
  9486. * must check each sequence number within this range to see if the
  9487. * corresponding MPDU is actually present.
  9488. * This field is only valid if the FV bit is set.
  9489. * Value:
  9490. * The sequence number for the first MPDUs to check to flush.
  9491. * The sequence number is masked by 0x3f.
  9492. * - FLUSH_SEQ_NUM_END
  9493. * Bits 11:6
  9494. * Purpose: Indicate the end of a series of MPDUs to flush
  9495. * Value:
  9496. * The sequence number one larger than the sequence number of the
  9497. * last MPDU to check to flush.
  9498. * The sequence number is masked by 0x3f.
  9499. * Not all MPDUs within this series are necessarily valid - the host
  9500. * must check each sequence number within this range to see if the
  9501. * corresponding MPDU is actually present.
  9502. * This field is only valid if the FV bit is set.
  9503. * - REL_SEQ_NUM_START
  9504. * Bits 17:12
  9505. * Purpose: Indicate the start of a series of MPDUs to release.
  9506. * All MPDUs within this series are present and valid - the host
  9507. * need not check each sequence number within this range to see if
  9508. * the corresponding MPDU is actually present.
  9509. * This field is only valid if the RV bit is set.
  9510. * Value:
  9511. * The sequence number for the first MPDUs to check to release.
  9512. * The sequence number is masked by 0x3f.
  9513. * - REL_SEQ_NUM_END
  9514. * Bits 23:18
  9515. * Purpose: Indicate the end of a series of MPDUs to release.
  9516. * Value:
  9517. * The sequence number one larger than the sequence number of the
  9518. * last MPDU to check to release.
  9519. * The sequence number is masked by 0x3f.
  9520. * All MPDUs within this series are present and valid - the host
  9521. * need not check each sequence number within this range to see if
  9522. * the corresponding MPDU is actually present.
  9523. * This field is only valid if the RV bit is set.
  9524. * - NUM_MPDU_RANGES
  9525. * Bits 31:24
  9526. * Purpose: Indicate how many ranges of MPDUs are present.
  9527. * Each MPDU range consists of a series of contiguous MPDUs within the
  9528. * rx frame sequence which all have the same MPDU status.
  9529. * Value: 1-63 (typically a small number, like 1-3)
  9530. *
  9531. * Rx PPDU descriptor fields:
  9532. * - RSSI_CMB
  9533. * Bits 7:0
  9534. * Purpose: Combined RSSI from all active rx chains, across the active
  9535. * bandwidth.
  9536. * Value: RSSI dB units w.r.t. noise floor
  9537. * - TIMESTAMP_SUBMICROSEC
  9538. * Bits 15:8
  9539. * Purpose: high-resolution timestamp
  9540. * Value:
  9541. * Sub-microsecond time of PPDU reception.
  9542. * This timestamp ranges from [0,MAC clock MHz).
  9543. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9544. * to form a high-resolution, large range rx timestamp.
  9545. * - PHY_ERR_CODE
  9546. * Bits 23:16
  9547. * Purpose:
  9548. * If the rx frame processing resulted in a PHY error, indicate what
  9549. * type of rx PHY error occurred.
  9550. * Value:
  9551. * This field is valid if the "P" (PHY_ERR) flag is set.
  9552. * TBD: document/specify the values for this field
  9553. * - PHY_ERR
  9554. * Bit 24
  9555. * Purpose: indicate whether the rx PPDU had a PHY error
  9556. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9557. * - LEGACY_RATE
  9558. * Bits 28:25
  9559. * Purpose:
  9560. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9561. * specify which rate was used.
  9562. * Value:
  9563. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9564. * flag.
  9565. * If LEGACY_RATE_SEL is 0:
  9566. * 0x8: OFDM 48 Mbps
  9567. * 0x9: OFDM 24 Mbps
  9568. * 0xA: OFDM 12 Mbps
  9569. * 0xB: OFDM 6 Mbps
  9570. * 0xC: OFDM 54 Mbps
  9571. * 0xD: OFDM 36 Mbps
  9572. * 0xE: OFDM 18 Mbps
  9573. * 0xF: OFDM 9 Mbps
  9574. * If LEGACY_RATE_SEL is 1:
  9575. * 0x8: CCK 11 Mbps long preamble
  9576. * 0x9: CCK 5.5 Mbps long preamble
  9577. * 0xA: CCK 2 Mbps long preamble
  9578. * 0xB: CCK 1 Mbps long preamble
  9579. * 0xC: CCK 11 Mbps short preamble
  9580. * 0xD: CCK 5.5 Mbps short preamble
  9581. * 0xE: CCK 2 Mbps short preamble
  9582. * - LEGACY_RATE_SEL
  9583. * Bit 29
  9584. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9585. * Value:
  9586. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9587. * used a legacy rate.
  9588. * 0 -> OFDM, 1 -> CCK
  9589. * - END_VALID
  9590. * Bit 30
  9591. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9592. * the start of the PPDU are valid. Specifically, the following
  9593. * fields are only valid if END_VALID is set:
  9594. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9595. * TIMESTAMP_SUBMICROSEC
  9596. * Value:
  9597. * 0 -> rx PPDU desc end fields are not valid
  9598. * 1 -> rx PPDU desc end fields are valid
  9599. * - START_VALID
  9600. * Bit 31
  9601. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9602. * the end of the PPDU are valid. Specifically, the following
  9603. * fields are only valid if START_VALID is set:
  9604. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9605. * VHT-SIG-A
  9606. * Value:
  9607. * 0 -> rx PPDU desc start fields are not valid
  9608. * 1 -> rx PPDU desc start fields are valid
  9609. * - RSSI0_PRI20
  9610. * Bits 7:0
  9611. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9612. * Value: RSSI dB units w.r.t. noise floor
  9613. *
  9614. * - RSSI0_EXT20
  9615. * Bits 7:0
  9616. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9617. * (if the rx bandwidth was >= 40 MHz)
  9618. * Value: RSSI dB units w.r.t. noise floor
  9619. * - RSSI0_EXT40
  9620. * Bits 7:0
  9621. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9622. * (if the rx bandwidth was >= 80 MHz)
  9623. * Value: RSSI dB units w.r.t. noise floor
  9624. * - RSSI0_EXT80
  9625. * Bits 7:0
  9626. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9627. * (if the rx bandwidth was >= 160 MHz)
  9628. * Value: RSSI dB units w.r.t. noise floor
  9629. *
  9630. * - RSSI1_PRI20
  9631. * Bits 7:0
  9632. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9633. * Value: RSSI dB units w.r.t. noise floor
  9634. * - RSSI1_EXT20
  9635. * Bits 7:0
  9636. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9637. * (if the rx bandwidth was >= 40 MHz)
  9638. * Value: RSSI dB units w.r.t. noise floor
  9639. * - RSSI1_EXT40
  9640. * Bits 7:0
  9641. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9642. * (if the rx bandwidth was >= 80 MHz)
  9643. * Value: RSSI dB units w.r.t. noise floor
  9644. * - RSSI1_EXT80
  9645. * Bits 7:0
  9646. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9647. * (if the rx bandwidth was >= 160 MHz)
  9648. * Value: RSSI dB units w.r.t. noise floor
  9649. *
  9650. * - RSSI2_PRI20
  9651. * Bits 7:0
  9652. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9653. * Value: RSSI dB units w.r.t. noise floor
  9654. * - RSSI2_EXT20
  9655. * Bits 7:0
  9656. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9657. * (if the rx bandwidth was >= 40 MHz)
  9658. * Value: RSSI dB units w.r.t. noise floor
  9659. * - RSSI2_EXT40
  9660. * Bits 7:0
  9661. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9662. * (if the rx bandwidth was >= 80 MHz)
  9663. * Value: RSSI dB units w.r.t. noise floor
  9664. * - RSSI2_EXT80
  9665. * Bits 7:0
  9666. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9667. * (if the rx bandwidth was >= 160 MHz)
  9668. * Value: RSSI dB units w.r.t. noise floor
  9669. *
  9670. * - RSSI3_PRI20
  9671. * Bits 7:0
  9672. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9673. * Value: RSSI dB units w.r.t. noise floor
  9674. * - RSSI3_EXT20
  9675. * Bits 7:0
  9676. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9677. * (if the rx bandwidth was >= 40 MHz)
  9678. * Value: RSSI dB units w.r.t. noise floor
  9679. * - RSSI3_EXT40
  9680. * Bits 7:0
  9681. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9682. * (if the rx bandwidth was >= 80 MHz)
  9683. * Value: RSSI dB units w.r.t. noise floor
  9684. * - RSSI3_EXT80
  9685. * Bits 7:0
  9686. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9687. * (if the rx bandwidth was >= 160 MHz)
  9688. * Value: RSSI dB units w.r.t. noise floor
  9689. *
  9690. * - TSF32
  9691. * Bits 31:0
  9692. * Purpose: specify the time the rx PPDU was received, in TSF units
  9693. * Value: 32 LSBs of the TSF
  9694. * - TIMESTAMP_MICROSEC
  9695. * Bits 31:0
  9696. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9697. * Value: PPDU rx time, in microseconds
  9698. * - VHT_SIG_A1
  9699. * Bits 23:0
  9700. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9701. * from the rx PPDU
  9702. * Value:
  9703. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9704. * VHT-SIG-A1 data.
  9705. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9706. * first 24 bits of the HT-SIG data.
  9707. * Otherwise, this field is invalid.
  9708. * Refer to the the 802.11 protocol for the definition of the
  9709. * HT-SIG and VHT-SIG-A1 fields
  9710. * - VHT_SIG_A2
  9711. * Bits 23:0
  9712. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9713. * from the rx PPDU
  9714. * Value:
  9715. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9716. * VHT-SIG-A2 data.
  9717. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9718. * last 24 bits of the HT-SIG data.
  9719. * Otherwise, this field is invalid.
  9720. * Refer to the the 802.11 protocol for the definition of the
  9721. * HT-SIG and VHT-SIG-A2 fields
  9722. * - PREAMBLE_TYPE
  9723. * Bits 31:24
  9724. * Purpose: indicate the PHY format of the received burst
  9725. * Value:
  9726. * 0x4: Legacy (OFDM/CCK)
  9727. * 0x8: HT
  9728. * 0x9: HT with TxBF
  9729. * 0xC: VHT
  9730. * 0xD: VHT with TxBF
  9731. * - SERVICE
  9732. * Bits 31:24
  9733. * Purpose: TBD
  9734. * Value: TBD
  9735. *
  9736. * Rx MSDU descriptor fields:
  9737. * - FW_RX_DESC_BYTES
  9738. * Bits 15:0
  9739. * Purpose: Indicate how many bytes in the Rx indication are used for
  9740. * FW Rx descriptors
  9741. *
  9742. * Payload fields:
  9743. * - MPDU_COUNT
  9744. * Bits 7:0
  9745. * Purpose: Indicate how many sequential MPDUs share the same status.
  9746. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9747. * - MPDU_STATUS
  9748. * Bits 15:8
  9749. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9750. * received successfully.
  9751. * Value:
  9752. * 0x1: success
  9753. * 0x2: FCS error
  9754. * 0x3: duplicate error
  9755. * 0x4: replay error
  9756. * 0x5: invalid peer
  9757. */
  9758. /* header fields */
  9759. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9760. #define HTT_RX_IND_EXT_TID_S 8
  9761. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9762. #define HTT_RX_IND_FLUSH_VALID_S 13
  9763. #define HTT_RX_IND_REL_VALID_M 0x4000
  9764. #define HTT_RX_IND_REL_VALID_S 14
  9765. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9766. #define HTT_RX_IND_PEER_ID_S 16
  9767. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9768. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9769. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9770. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9771. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9772. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9773. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9774. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9775. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9776. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9777. /* rx PPDU descriptor fields */
  9778. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9779. #define HTT_RX_IND_RSSI_CMB_S 0
  9780. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9781. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9782. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9783. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9784. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9785. #define HTT_RX_IND_PHY_ERR_S 24
  9786. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9787. #define HTT_RX_IND_LEGACY_RATE_S 25
  9788. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9789. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9790. #define HTT_RX_IND_END_VALID_M 0x40000000
  9791. #define HTT_RX_IND_END_VALID_S 30
  9792. #define HTT_RX_IND_START_VALID_M 0x80000000
  9793. #define HTT_RX_IND_START_VALID_S 31
  9794. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9795. #define HTT_RX_IND_RSSI_PRI20_S 0
  9796. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9797. #define HTT_RX_IND_RSSI_EXT20_S 8
  9798. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9799. #define HTT_RX_IND_RSSI_EXT40_S 16
  9800. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9801. #define HTT_RX_IND_RSSI_EXT80_S 24
  9802. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9803. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9804. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9805. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9806. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9807. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9808. #define HTT_RX_IND_SERVICE_M 0xff000000
  9809. #define HTT_RX_IND_SERVICE_S 24
  9810. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9811. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9812. /* rx MSDU descriptor fields */
  9813. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9814. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9815. /* payload fields */
  9816. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9817. #define HTT_RX_IND_MPDU_COUNT_S 0
  9818. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9819. #define HTT_RX_IND_MPDU_STATUS_S 8
  9820. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9821. do { \
  9822. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9823. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9824. } while (0)
  9825. #define HTT_RX_IND_EXT_TID_GET(word) \
  9826. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9827. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9828. do { \
  9829. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9830. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9831. } while (0)
  9832. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9833. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9834. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9835. do { \
  9836. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9837. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9838. } while (0)
  9839. #define HTT_RX_IND_REL_VALID_GET(word) \
  9840. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9841. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9842. do { \
  9843. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9844. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9845. } while (0)
  9846. #define HTT_RX_IND_PEER_ID_GET(word) \
  9847. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9848. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9849. do { \
  9850. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9851. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9852. } while (0)
  9853. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9854. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9855. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9856. do { \
  9857. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9858. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9859. } while (0)
  9860. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9861. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9862. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9863. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9864. do { \
  9865. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9866. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9867. } while (0)
  9868. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9869. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9870. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9871. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9872. do { \
  9873. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9874. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9875. } while (0)
  9876. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9877. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9878. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9879. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9880. do { \
  9881. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9882. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9883. } while (0)
  9884. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9885. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9886. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9887. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9888. do { \
  9889. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9890. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9891. } while (0)
  9892. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9893. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9894. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9895. /* FW rx PPDU descriptor fields */
  9896. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9897. do { \
  9898. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9899. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9900. } while (0)
  9901. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9902. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9903. HTT_RX_IND_RSSI_CMB_S)
  9904. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9905. do { \
  9906. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9907. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9908. } while (0)
  9909. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9910. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9911. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9912. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9913. do { \
  9914. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9915. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9916. } while (0)
  9917. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9918. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9919. HTT_RX_IND_PHY_ERR_CODE_S)
  9920. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9921. do { \
  9922. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9923. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9924. } while (0)
  9925. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9926. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9927. HTT_RX_IND_PHY_ERR_S)
  9928. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9929. do { \
  9930. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9931. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9932. } while (0)
  9933. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9934. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9935. HTT_RX_IND_LEGACY_RATE_S)
  9936. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9937. do { \
  9938. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9939. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9940. } while (0)
  9941. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9942. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9943. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9944. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9945. do { \
  9946. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9947. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9948. } while (0)
  9949. #define HTT_RX_IND_END_VALID_GET(word) \
  9950. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9951. HTT_RX_IND_END_VALID_S)
  9952. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9953. do { \
  9954. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9955. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9956. } while (0)
  9957. #define HTT_RX_IND_START_VALID_GET(word) \
  9958. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9959. HTT_RX_IND_START_VALID_S)
  9960. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9961. do { \
  9962. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9963. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9964. } while (0)
  9965. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9966. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9967. HTT_RX_IND_RSSI_PRI20_S)
  9968. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9969. do { \
  9970. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9971. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9972. } while (0)
  9973. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9974. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9975. HTT_RX_IND_RSSI_EXT20_S)
  9976. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9979. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9980. } while (0)
  9981. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9982. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9983. HTT_RX_IND_RSSI_EXT40_S)
  9984. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9985. do { \
  9986. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9987. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9988. } while (0)
  9989. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9990. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9991. HTT_RX_IND_RSSI_EXT80_S)
  9992. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9993. do { \
  9994. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9995. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9996. } while (0)
  9997. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9998. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9999. HTT_RX_IND_VHT_SIG_A1_S)
  10000. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10001. do { \
  10002. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10003. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10004. } while (0)
  10005. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10006. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10007. HTT_RX_IND_VHT_SIG_A2_S)
  10008. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10011. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10012. } while (0)
  10013. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10014. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10015. HTT_RX_IND_PREAMBLE_TYPE_S)
  10016. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10017. do { \
  10018. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10019. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10020. } while (0)
  10021. #define HTT_RX_IND_SERVICE_GET(word) \
  10022. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10023. HTT_RX_IND_SERVICE_S)
  10024. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10025. do { \
  10026. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10027. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10028. } while (0)
  10029. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10030. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10031. HTT_RX_IND_SA_ANT_MATRIX_S)
  10032. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10033. do { \
  10034. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10035. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10036. } while (0)
  10037. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10038. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10039. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10040. do { \
  10041. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10042. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10043. } while (0)
  10044. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10045. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10046. #define HTT_RX_IND_HL_BYTES \
  10047. (HTT_RX_IND_HDR_BYTES + \
  10048. 4 /* single FW rx MSDU descriptor */ + \
  10049. 4 /* single MPDU range information element */)
  10050. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10051. /* Could we use one macro entry? */
  10052. #define HTT_WORD_SET(word, field, value) \
  10053. do { \
  10054. HTT_CHECK_SET_VAL(field, value); \
  10055. (word) |= ((value) << field ## _S); \
  10056. } while (0)
  10057. #define HTT_WORD_GET(word, field) \
  10058. (((word) & field ## _M) >> field ## _S)
  10059. PREPACK struct hl_htt_rx_ind_base {
  10060. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10061. } POSTPACK;
  10062. /*
  10063. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10064. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10065. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10066. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10067. * htt_rx_ind_hl_rx_desc_t.
  10068. */
  10069. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10070. struct htt_rx_ind_hl_rx_desc_t {
  10071. A_UINT8 ver;
  10072. A_UINT8 len;
  10073. struct {
  10074. A_UINT8
  10075. first_msdu: 1,
  10076. last_msdu: 1,
  10077. c3_failed: 1,
  10078. c4_failed: 1,
  10079. ipv6: 1,
  10080. tcp: 1,
  10081. udp: 1,
  10082. reserved: 1;
  10083. } flags;
  10084. /* NOTE: no reserved space - don't append any new fields here */
  10085. };
  10086. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10087. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10088. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10089. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10090. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10091. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10092. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10093. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10094. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10095. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10096. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10097. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10098. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10099. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10100. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10101. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10102. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10103. /* This structure is used in HL, the basic descriptor information
  10104. * used by host. the structure is translated by FW from HW desc
  10105. * or generated by FW. But in HL monitor mode, the host would use
  10106. * the same structure with LL.
  10107. */
  10108. PREPACK struct hl_htt_rx_desc_base {
  10109. A_UINT32
  10110. seq_num:12,
  10111. encrypted:1,
  10112. chan_info_present:1,
  10113. resv0:2,
  10114. mcast_bcast:1,
  10115. fragment:1,
  10116. key_id_oct:8,
  10117. resv1:6;
  10118. A_UINT32
  10119. pn_31_0;
  10120. union {
  10121. struct {
  10122. A_UINT16 pn_47_32;
  10123. A_UINT16 pn_63_48;
  10124. } pn16;
  10125. A_UINT32 pn_63_32;
  10126. } u0;
  10127. A_UINT32
  10128. pn_95_64;
  10129. A_UINT32
  10130. pn_127_96;
  10131. } POSTPACK;
  10132. /*
  10133. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10134. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10135. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10136. * Please see htt_chan_change_t for description of the fields.
  10137. */
  10138. PREPACK struct htt_chan_info_t
  10139. {
  10140. A_UINT32 primary_chan_center_freq_mhz: 16,
  10141. contig_chan1_center_freq_mhz: 16;
  10142. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10143. phy_mode: 8,
  10144. reserved: 8;
  10145. } POSTPACK;
  10146. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10147. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10148. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10149. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10150. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10151. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10152. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10153. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10154. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10155. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10156. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10157. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10158. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10159. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10160. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10161. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10162. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10163. /* Channel information */
  10164. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10165. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10166. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10167. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10168. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10169. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10170. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10171. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10172. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10173. do { \
  10174. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10175. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10176. } while (0)
  10177. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10178. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10179. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10180. do { \
  10181. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10182. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10183. } while (0)
  10184. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10185. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10186. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10187. do { \
  10188. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10189. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10190. } while (0)
  10191. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10192. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10193. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10194. do { \
  10195. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10196. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10197. } while (0)
  10198. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10199. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10200. /*
  10201. * @brief target -> host message definition for FW offloaded pkts
  10202. *
  10203. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10204. *
  10205. * @details
  10206. * The following field definitions describe the format of the firmware
  10207. * offload deliver message sent from the target to the host.
  10208. *
  10209. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10210. *
  10211. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10212. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10213. * | reserved_1 | msg type |
  10214. * |--------------------------------------------------------------------------|
  10215. * | phy_timestamp_l32 |
  10216. * |--------------------------------------------------------------------------|
  10217. * | WORD2 (see below) |
  10218. * |--------------------------------------------------------------------------|
  10219. * | seqno | framectrl |
  10220. * |--------------------------------------------------------------------------|
  10221. * | reserved_3 | vdev_id | tid_num|
  10222. * |--------------------------------------------------------------------------|
  10223. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10224. * |--------------------------------------------------------------------------|
  10225. *
  10226. * where:
  10227. * STAT = status
  10228. * F = format (802.3 vs. 802.11)
  10229. *
  10230. * definition for word 2
  10231. *
  10232. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10233. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10234. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10235. * |--------------------------------------------------------------------------|
  10236. *
  10237. * where:
  10238. * PR = preamble
  10239. * BF = beamformed
  10240. */
  10241. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10242. {
  10243. A_UINT32 /* word 0 */
  10244. msg_type:8, /* [ 7: 0] */
  10245. reserved_1:24; /* [31: 8] */
  10246. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10247. A_UINT32 /* word 2 */
  10248. /* preamble:
  10249. * 0-OFDM,
  10250. * 1-CCk,
  10251. * 2-HT,
  10252. * 3-VHT
  10253. */
  10254. preamble: 2, /* [1:0] */
  10255. /* mcs:
  10256. * In case of HT preamble interpret
  10257. * MCS along with NSS.
  10258. * Valid values for HT are 0 to 7.
  10259. * HT mcs 0 with NSS 2 is mcs 8.
  10260. * Valid values for VHT are 0 to 9.
  10261. */
  10262. mcs: 4, /* [5:2] */
  10263. /* rate:
  10264. * This is applicable only for
  10265. * CCK and OFDM preamble type
  10266. * rate 0: OFDM 48 Mbps,
  10267. * 1: OFDM 24 Mbps,
  10268. * 2: OFDM 12 Mbps
  10269. * 3: OFDM 6 Mbps
  10270. * 4: OFDM 54 Mbps
  10271. * 5: OFDM 36 Mbps
  10272. * 6: OFDM 18 Mbps
  10273. * 7: OFDM 9 Mbps
  10274. * rate 0: CCK 11 Mbps Long
  10275. * 1: CCK 5.5 Mbps Long
  10276. * 2: CCK 2 Mbps Long
  10277. * 3: CCK 1 Mbps Long
  10278. * 4: CCK 11 Mbps Short
  10279. * 5: CCK 5.5 Mbps Short
  10280. * 6: CCK 2 Mbps Short
  10281. */
  10282. rate : 3, /* [ 8: 6] */
  10283. rssi : 8, /* [16: 9] units=dBm */
  10284. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10285. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10286. stbc : 1, /* [22] */
  10287. sgi : 1, /* [23] */
  10288. ldpc : 1, /* [24] */
  10289. beamformed: 1, /* [25] */
  10290. reserved_2: 6; /* [31:26] */
  10291. A_UINT32 /* word 3 */
  10292. framectrl:16, /* [15: 0] */
  10293. seqno:16; /* [31:16] */
  10294. A_UINT32 /* word 4 */
  10295. tid_num:5, /* [ 4: 0] actual TID number */
  10296. vdev_id:8, /* [12: 5] */
  10297. reserved_3:19; /* [31:13] */
  10298. A_UINT32 /* word 5 */
  10299. /* status:
  10300. * 0: tx_ok
  10301. * 1: retry
  10302. * 2: drop
  10303. * 3: filtered
  10304. * 4: abort
  10305. * 5: tid delete
  10306. * 6: sw abort
  10307. * 7: dropped by peer migration
  10308. */
  10309. status:3, /* [2:0] */
  10310. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10311. tx_mpdu_bytes:16, /* [19:4] */
  10312. /* Indicates retry count of offloaded/local generated Data tx frames */
  10313. tx_retry_cnt:6, /* [25:20] */
  10314. reserved_4:6; /* [31:26] */
  10315. } POSTPACK;
  10316. /* FW offload deliver ind message header fields */
  10317. /* DWORD one */
  10318. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10319. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10320. /* DWORD two */
  10321. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10322. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10323. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10324. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10325. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10326. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10327. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10328. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10329. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10330. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10331. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10332. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10333. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10334. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10335. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10336. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10337. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10338. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10339. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10340. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10341. /* DWORD three*/
  10342. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10343. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10344. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10345. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10346. /* DWORD four */
  10347. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10348. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10349. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10350. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10351. /* DWORD five */
  10352. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10353. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10354. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10355. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10356. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10357. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10358. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10359. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10360. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10361. do { \
  10362. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10363. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10364. } while (0)
  10365. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10366. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10367. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10368. do { \
  10369. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10370. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10371. } while (0)
  10372. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10373. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10374. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10375. do { \
  10376. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10377. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10378. } while (0)
  10379. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10380. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10381. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10382. do { \
  10383. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10384. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10385. } while (0)
  10386. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10387. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10388. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10389. do { \
  10390. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10391. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10392. } while (0)
  10393. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10394. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10395. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10396. do { \
  10397. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10398. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10399. } while (0)
  10400. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10401. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10402. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10403. do { \
  10404. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10405. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10406. } while (0)
  10407. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10408. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10409. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10410. do { \
  10411. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10412. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10413. } while (0)
  10414. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10415. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10416. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10417. do { \
  10418. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10419. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10420. } while (0)
  10421. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10422. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10423. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10424. do { \
  10425. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10426. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10427. } while (0)
  10428. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10429. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10430. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10431. do { \
  10432. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10433. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10434. } while (0)
  10435. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10436. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10437. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10438. do { \
  10439. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10440. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10441. } while (0)
  10442. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10443. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10444. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10445. do { \
  10446. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10447. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10448. } while (0)
  10449. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10450. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10451. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10452. do { \
  10453. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10454. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10455. } while (0)
  10456. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10457. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10458. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10459. do { \
  10460. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10461. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10462. } while (0)
  10463. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10464. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10465. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10466. do { \
  10467. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10468. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10469. } while (0)
  10470. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10471. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10472. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10473. do { \
  10474. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10475. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10476. } while (0)
  10477. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10478. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10479. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10480. do { \
  10481. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10482. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10483. } while (0)
  10484. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10485. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10486. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10487. do { \
  10488. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10489. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10490. } while (0)
  10491. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10492. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10493. /*
  10494. * @brief target -> host rx reorder flush message definition
  10495. *
  10496. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10497. *
  10498. * @details
  10499. * The following field definitions describe the format of the rx flush
  10500. * message sent from the target to the host.
  10501. * The message consists of a 4-octet header, followed by one or more
  10502. * 4-octet payload information elements.
  10503. *
  10504. * |31 24|23 8|7 0|
  10505. * |--------------------------------------------------------------|
  10506. * | TID | peer ID | msg type |
  10507. * |--------------------------------------------------------------|
  10508. * | seq num end | seq num start | MPDU status | reserved |
  10509. * |--------------------------------------------------------------|
  10510. * First DWORD:
  10511. * - MSG_TYPE
  10512. * Bits 7:0
  10513. * Purpose: identifies this as an rx flush message
  10514. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10515. * - PEER_ID
  10516. * Bits 23:8 (only bits 18:8 actually used)
  10517. * Purpose: identify which peer's rx data is being flushed
  10518. * Value: (rx) peer ID
  10519. * - TID
  10520. * Bits 31:24 (only bits 27:24 actually used)
  10521. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10522. * Value: traffic identifier
  10523. * Second DWORD:
  10524. * - MPDU_STATUS
  10525. * Bits 15:8
  10526. * Purpose:
  10527. * Indicate whether the flushed MPDUs should be discarded or processed.
  10528. * Value:
  10529. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10530. * stages of rx processing
  10531. * other: discard the MPDUs
  10532. * It is anticipated that flush messages will always have
  10533. * MPDU status == 1, but the status flag is included for
  10534. * flexibility.
  10535. * - SEQ_NUM_START
  10536. * Bits 23:16
  10537. * Purpose:
  10538. * Indicate the start of a series of consecutive MPDUs being flushed.
  10539. * Not all MPDUs within this range are necessarily valid - the host
  10540. * must check each sequence number within this range to see if the
  10541. * corresponding MPDU is actually present.
  10542. * Value:
  10543. * The sequence number for the first MPDU in the sequence.
  10544. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10545. * - SEQ_NUM_END
  10546. * Bits 30:24
  10547. * Purpose:
  10548. * Indicate the end of a series of consecutive MPDUs being flushed.
  10549. * Value:
  10550. * The sequence number one larger than the sequence number of the
  10551. * last MPDU being flushed.
  10552. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10553. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10554. * are to be released for further rx processing.
  10555. * Not all MPDUs within this range are necessarily valid - the host
  10556. * must check each sequence number within this range to see if the
  10557. * corresponding MPDU is actually present.
  10558. */
  10559. /* first DWORD */
  10560. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10561. #define HTT_RX_FLUSH_PEER_ID_S 8
  10562. #define HTT_RX_FLUSH_TID_M 0xff000000
  10563. #define HTT_RX_FLUSH_TID_S 24
  10564. /* second DWORD */
  10565. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10566. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10567. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10568. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10569. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10570. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10571. #define HTT_RX_FLUSH_BYTES 8
  10572. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10573. do { \
  10574. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10575. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10576. } while (0)
  10577. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10578. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10579. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10580. do { \
  10581. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10582. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10583. } while (0)
  10584. #define HTT_RX_FLUSH_TID_GET(word) \
  10585. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10586. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10589. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10590. } while (0)
  10591. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10592. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10593. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10596. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10597. } while (0)
  10598. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10599. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10600. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10601. do { \
  10602. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10603. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10604. } while (0)
  10605. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10606. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10607. /*
  10608. * @brief target -> host rx pn check indication message
  10609. *
  10610. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10611. *
  10612. * @details
  10613. * The following field definitions describe the format of the Rx PN check
  10614. * indication message sent from the target to the host.
  10615. * The message consists of a 4-octet header, followed by the start and
  10616. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10617. * IE is one octet containing the sequence number that failed the PN
  10618. * check.
  10619. *
  10620. * |31 24|23 8|7 0|
  10621. * |--------------------------------------------------------------|
  10622. * | TID | peer ID | msg type |
  10623. * |--------------------------------------------------------------|
  10624. * | Reserved | PN IE count | seq num end | seq num start|
  10625. * |--------------------------------------------------------------|
  10626. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10627. * |--------------------------------------------------------------|
  10628. * First DWORD:
  10629. * - MSG_TYPE
  10630. * Bits 7:0
  10631. * Purpose: Identifies this as an rx pn check indication message
  10632. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10633. * - PEER_ID
  10634. * Bits 23:8 (only bits 18:8 actually used)
  10635. * Purpose: identify which peer
  10636. * Value: (rx) peer ID
  10637. * - TID
  10638. * Bits 31:24 (only bits 27:24 actually used)
  10639. * Purpose: identify traffic identifier
  10640. * Value: traffic identifier
  10641. * Second DWORD:
  10642. * - SEQ_NUM_START
  10643. * Bits 7:0
  10644. * Purpose:
  10645. * Indicates the starting sequence number of the MPDU in this
  10646. * series of MPDUs that went though PN check.
  10647. * Value:
  10648. * The sequence number for the first MPDU in the sequence.
  10649. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10650. * - SEQ_NUM_END
  10651. * Bits 15:8
  10652. * Purpose:
  10653. * Indicates the ending sequence number of the MPDU in this
  10654. * series of MPDUs that went though PN check.
  10655. * Value:
  10656. * The sequence number one larger then the sequence number of the last
  10657. * MPDU being flushed.
  10658. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10659. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10660. * for invalid PN numbers and are ready to be released for further processing.
  10661. * Not all MPDUs within this range are necessarily valid - the host
  10662. * must check each sequence number within this range to see if the
  10663. * corresponding MPDU is actually present.
  10664. * - PN_IE_COUNT
  10665. * Bits 23:16
  10666. * Purpose:
  10667. * Used to determine the variable number of PN information elements in this
  10668. * message
  10669. *
  10670. * PN information elements:
  10671. * - PN_IE_x-
  10672. * Purpose:
  10673. * Each PN information element contains the sequence number of the MPDU that
  10674. * has failed the target PN check.
  10675. * Value:
  10676. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10677. * that failed the PN check.
  10678. */
  10679. /* first DWORD */
  10680. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10681. #define HTT_RX_PN_IND_PEER_ID_S 8
  10682. #define HTT_RX_PN_IND_TID_M 0xff000000
  10683. #define HTT_RX_PN_IND_TID_S 24
  10684. /* second DWORD */
  10685. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10686. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10687. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10688. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10689. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10690. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10691. #define HTT_RX_PN_IND_BYTES 8
  10692. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10693. do { \
  10694. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10695. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10696. } while (0)
  10697. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10698. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10699. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10700. do { \
  10701. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10702. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10703. } while (0)
  10704. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10705. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10706. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10707. do { \
  10708. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10709. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10710. } while (0)
  10711. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10712. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10713. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10714. do { \
  10715. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10716. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10717. } while (0)
  10718. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10719. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10720. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10721. do { \
  10722. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10723. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10724. } while (0)
  10725. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10726. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10727. /*
  10728. * @brief target -> host rx offload deliver message for LL system
  10729. *
  10730. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10731. *
  10732. * @details
  10733. * In a low latency system this message is sent whenever the offload
  10734. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10735. * The DMA of the actual packets into host memory is done before sending out
  10736. * this message. This message indicates only how many MSDUs to reap. The
  10737. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10738. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10739. * DMA'd by the MAC directly into host memory these packets do not contain
  10740. * the MAC descriptors in the header portion of the packet. Instead they contain
  10741. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10742. * message, the packets are delivered directly to the NW stack without going
  10743. * through the regular reorder buffering and PN checking path since it has
  10744. * already been done in target.
  10745. *
  10746. * |31 24|23 16|15 8|7 0|
  10747. * |-----------------------------------------------------------------------|
  10748. * | Total MSDU count | reserved | msg type |
  10749. * |-----------------------------------------------------------------------|
  10750. *
  10751. * @brief target -> host rx offload deliver message for HL system
  10752. *
  10753. * @details
  10754. * In a high latency system this message is sent whenever the offload manager
  10755. * flushes out the packets it has coalesced in its coalescing buffer. The
  10756. * actual packets are also carried along with this message. When the host
  10757. * receives this message, it is expected to deliver these packets to the NW
  10758. * stack directly instead of routing them through the reorder buffering and
  10759. * PN checking path since it has already been done in target.
  10760. *
  10761. * |31 24|23 16|15 8|7 0|
  10762. * |-----------------------------------------------------------------------|
  10763. * | Total MSDU count | reserved | msg type |
  10764. * |-----------------------------------------------------------------------|
  10765. * | peer ID | MSDU length |
  10766. * |-----------------------------------------------------------------------|
  10767. * | MSDU payload | FW Desc | tid | vdev ID |
  10768. * |-----------------------------------------------------------------------|
  10769. * | MSDU payload contd. |
  10770. * |-----------------------------------------------------------------------|
  10771. * | peer ID | MSDU length |
  10772. * |-----------------------------------------------------------------------|
  10773. * | MSDU payload | FW Desc | tid | vdev ID |
  10774. * |-----------------------------------------------------------------------|
  10775. * | MSDU payload contd. |
  10776. * |-----------------------------------------------------------------------|
  10777. *
  10778. */
  10779. /* first DWORD */
  10780. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10781. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10782. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10783. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10784. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10785. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10786. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10787. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10788. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10789. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10790. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10791. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10792. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10793. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10795. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10797. do { \
  10798. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10799. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10800. } while (0)
  10801. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10802. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10804. do { \
  10805. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10806. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10807. } while (0)
  10808. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10809. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10810. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10811. do { \
  10812. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10813. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10814. } while (0)
  10815. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10816. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10817. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10818. do { \
  10819. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10820. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10821. } while (0)
  10822. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10823. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10824. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10825. do { \
  10826. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10827. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10828. } while (0)
  10829. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10830. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10831. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10832. do { \
  10833. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10834. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10835. } while (0)
  10836. /**
  10837. * @brief target -> host rx peer map/unmap message definition
  10838. *
  10839. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10840. *
  10841. * @details
  10842. * The following diagram shows the format of the rx peer map message sent
  10843. * from the target to the host. This layout assumes the target operates
  10844. * as little-endian.
  10845. *
  10846. * This message always contains a SW peer ID. The main purpose of the
  10847. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10848. * with, so that the host can use that peer ID to determine which peer
  10849. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10850. * other purposes, such as identifying during tx completions which peer
  10851. * the tx frames in question were transmitted to.
  10852. *
  10853. * In certain generations of chips, the peer map message also contains
  10854. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10855. * to identify which peer the frame needs to be forwarded to (i.e. the
  10856. * peer assocated with the Destination MAC Address within the packet),
  10857. * and particularly which vdev needs to transmit the frame (for cases
  10858. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10859. * meaning as AST_INDEX_0.
  10860. * This DA-based peer ID that is provided for certain rx frames
  10861. * (the rx frames that need to be re-transmitted as tx frames)
  10862. * is the ID that the HW uses for referring to the peer in question,
  10863. * rather than the peer ID that the SW+FW use to refer to the peer.
  10864. *
  10865. *
  10866. * |31 24|23 16|15 8|7 0|
  10867. * |-----------------------------------------------------------------------|
  10868. * | SW peer ID | VDEV ID | msg type |
  10869. * |-----------------------------------------------------------------------|
  10870. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10871. * |-----------------------------------------------------------------------|
  10872. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10873. * |-----------------------------------------------------------------------|
  10874. *
  10875. *
  10876. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10877. *
  10878. * The following diagram shows the format of the rx peer unmap message sent
  10879. * from the target to the host.
  10880. *
  10881. * |31 24|23 16|15 8|7 0|
  10882. * |-----------------------------------------------------------------------|
  10883. * | SW peer ID | VDEV ID | msg type |
  10884. * |-----------------------------------------------------------------------|
  10885. *
  10886. * The following field definitions describe the format of the rx peer map
  10887. * and peer unmap messages sent from the target to the host.
  10888. * - MSG_TYPE
  10889. * Bits 7:0
  10890. * Purpose: identifies this as an rx peer map or peer unmap message
  10891. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10892. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10893. * - VDEV_ID
  10894. * Bits 15:8
  10895. * Purpose: Indicates which virtual device the peer is associated
  10896. * with.
  10897. * Value: vdev ID (used in the host to look up the vdev object)
  10898. * - PEER_ID (a.k.a. SW_PEER_ID)
  10899. * Bits 31:16
  10900. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10901. * freeing (unmap)
  10902. * Value: (rx) peer ID
  10903. * - MAC_ADDR_L32 (peer map only)
  10904. * Bits 31:0
  10905. * Purpose: Identifies which peer node the peer ID is for.
  10906. * Value: lower 4 bytes of peer node's MAC address
  10907. * - MAC_ADDR_U16 (peer map only)
  10908. * Bits 15:0
  10909. * Purpose: Identifies which peer node the peer ID is for.
  10910. * Value: upper 2 bytes of peer node's MAC address
  10911. * - HW_PEER_ID
  10912. * Bits 31:16
  10913. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10914. * address, so for rx frames marked for rx --> tx forwarding, the
  10915. * host can determine from the HW peer ID provided as meta-data with
  10916. * the rx frame which peer the frame is supposed to be forwarded to.
  10917. * Value: ID used by the MAC HW to identify the peer
  10918. */
  10919. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10920. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10921. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10922. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10923. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10924. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10925. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10926. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10927. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10928. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10929. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10930. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10931. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10932. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10933. do { \
  10934. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10935. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10936. } while (0)
  10937. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10938. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10939. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10940. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10941. do { \
  10942. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10943. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10944. } while (0)
  10945. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10946. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10947. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10948. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10949. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10950. do { \
  10951. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10952. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10953. } while (0)
  10954. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10955. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10956. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10957. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10958. #define HTT_RX_PEER_MAP_BYTES 12
  10959. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10960. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10961. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10962. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10963. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10964. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10965. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10966. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10967. #define HTT_RX_PEER_UNMAP_BYTES 4
  10968. /**
  10969. * @brief target -> host rx peer map V2 message definition
  10970. *
  10971. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10972. *
  10973. * @details
  10974. * The following diagram shows the format of the rx peer map v2 message sent
  10975. * from the target to the host. This layout assumes the target operates
  10976. * as little-endian.
  10977. *
  10978. * This message always contains a SW peer ID. The main purpose of the
  10979. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10980. * with, so that the host can use that peer ID to determine which peer
  10981. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10982. * other purposes, such as identifying during tx completions which peer
  10983. * the tx frames in question were transmitted to.
  10984. *
  10985. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10986. * is used during rx --> tx frame forwarding to identify which peer the
  10987. * frame needs to be forwarded to (i.e. the peer assocated with the
  10988. * Destination MAC Address within the packet), and particularly which vdev
  10989. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10990. * This DA-based peer ID that is provided for certain rx frames
  10991. * (the rx frames that need to be re-transmitted as tx frames)
  10992. * is the ID that the HW uses for referring to the peer in question,
  10993. * rather than the peer ID that the SW+FW use to refer to the peer.
  10994. *
  10995. * The HW peer id here is the same meaning as AST_INDEX_0.
  10996. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10997. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10998. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10999. * AST is valid.
  11000. *
  11001. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11002. * |-------------------------------------------------------------------------|
  11003. * | SW peer ID | VDEV ID | msg type |
  11004. * |-------------------------------------------------------------------------|
  11005. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11006. * |-------------------------------------------------------------------------|
  11007. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11008. * |-------------------------------------------------------------------------|
  11009. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11010. * |-------------------------------------------------------------------------|
  11011. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11012. * |-------------------------------------------------------------------------|
  11013. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11014. * |-------------------------------------------------------------------------|
  11015. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11016. * |-------------------------------------------------------------------------|
  11017. * | Reserved_2 |
  11018. * |-------------------------------------------------------------------------|
  11019. * Where:
  11020. * NH = Next Hop
  11021. * ASTVM = AST valid mask
  11022. * OA = on-chip AST valid bit
  11023. * ASTFM = AST flow mask
  11024. *
  11025. * The following field definitions describe the format of the rx peer map v2
  11026. * messages sent from the target to the host.
  11027. * - MSG_TYPE
  11028. * Bits 7:0
  11029. * Purpose: identifies this as an rx peer map v2 message
  11030. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11031. * - VDEV_ID
  11032. * Bits 15:8
  11033. * Purpose: Indicates which virtual device the peer is associated with.
  11034. * Value: vdev ID (used in the host to look up the vdev object)
  11035. * - SW_PEER_ID
  11036. * Bits 31:16
  11037. * Purpose: The peer ID (index) that WAL is allocating
  11038. * Value: (rx) peer ID
  11039. * - MAC_ADDR_L32
  11040. * Bits 31:0
  11041. * Purpose: Identifies which peer node the peer ID is for.
  11042. * Value: lower 4 bytes of peer node's MAC address
  11043. * - MAC_ADDR_U16
  11044. * Bits 15:0
  11045. * Purpose: Identifies which peer node the peer ID is for.
  11046. * Value: upper 2 bytes of peer node's MAC address
  11047. * - HW_PEER_ID / AST_INDEX_0
  11048. * Bits 31:16
  11049. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11050. * address, so for rx frames marked for rx --> tx forwarding, the
  11051. * host can determine from the HW peer ID provided as meta-data with
  11052. * the rx frame which peer the frame is supposed to be forwarded to.
  11053. * Value: ID used by the MAC HW to identify the peer
  11054. * - AST_HASH_VALUE
  11055. * Bits 15:0
  11056. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11057. * override feature.
  11058. * - NEXT_HOP
  11059. * Bit 16
  11060. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11061. * (Wireless Distribution System).
  11062. * - AST_VALID_MASK
  11063. * Bits 19:17
  11064. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11065. * - ONCHIP_AST_VALID_FLAG
  11066. * Bit 20
  11067. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11068. * is valid.
  11069. * - AST_INDEX_1
  11070. * Bits 15:0
  11071. * Purpose: indicate the second AST index for this peer
  11072. * - AST_0_FLOW_MASK
  11073. * Bits 19:16
  11074. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11075. * - AST_1_FLOW_MASK
  11076. * Bits 23:20
  11077. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11078. * - AST_2_FLOW_MASK
  11079. * Bits 27:24
  11080. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11081. * - AST_3_FLOW_MASK
  11082. * Bits 31:28
  11083. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11084. * - AST_INDEX_2
  11085. * Bits 15:0
  11086. * Purpose: indicate the third AST index for this peer
  11087. * - TID_VALID_HI_PRI
  11088. * Bits 23:16
  11089. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11090. * - TID_VALID_LOW_PRI
  11091. * Bits 31:24
  11092. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11093. * - AST_INDEX_3
  11094. * Bits 15:0
  11095. * Purpose: indicate the fourth AST index for this peer
  11096. * - ONCHIP_AST_IDX / RESERVED
  11097. * Bits 31:16
  11098. * Purpose: This field is valid only when split AST feature is enabled.
  11099. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11100. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11101. * address, this ast_idx is used for LMAC modules for RXPCU.
  11102. * Value: ID used by the LMAC HW to identify the peer
  11103. */
  11104. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11105. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11106. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11107. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11108. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11109. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11110. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11111. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11112. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11113. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11114. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11115. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11116. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11117. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11118. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11119. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11120. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11121. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11122. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11123. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11124. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11125. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11126. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11127. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11128. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11129. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11130. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11131. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11132. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11133. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11134. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11135. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11136. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11137. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11138. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11139. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11140. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11141. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11142. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11143. do { \
  11144. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11145. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11146. } while (0)
  11147. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11148. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11149. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11150. do { \
  11151. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11152. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11153. } while (0)
  11154. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11155. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11156. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11157. do { \
  11158. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11159. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11160. } while (0)
  11161. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11162. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11163. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11164. do { \
  11165. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11166. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11167. } while (0)
  11168. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11169. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11170. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11171. do { \
  11172. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11173. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11174. } while (0)
  11175. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11176. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11177. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11178. do { \
  11179. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11180. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11181. } while (0)
  11182. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11183. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11184. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11185. do { \
  11186. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11187. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11188. } while (0)
  11189. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11190. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11191. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11192. do { \
  11193. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11194. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11195. } while (0)
  11196. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11197. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11198. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11199. do { \
  11200. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11201. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11202. } while (0)
  11203. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11204. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11205. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11206. do { \
  11207. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11208. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11209. } while (0)
  11210. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11211. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11212. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11213. do { \
  11214. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11215. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11216. } while (0)
  11217. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11218. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11219. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11220. do { \
  11221. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11222. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11223. } while (0)
  11224. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11225. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11226. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11227. do { \
  11228. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11229. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11230. } while (0)
  11231. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11232. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11233. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11234. do { \
  11235. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11236. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11237. } while (0)
  11238. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11239. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11240. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11241. do { \
  11242. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11243. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11244. } while (0)
  11245. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11246. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11247. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11248. do { \
  11249. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11250. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11251. } while (0)
  11252. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11253. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11254. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11255. do { \
  11256. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11257. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11258. } while (0)
  11259. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11260. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11261. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11262. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11263. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11264. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11265. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11266. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11267. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11268. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11269. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11270. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11271. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11272. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11273. /**
  11274. * @brief target -> host rx peer map V3 message definition
  11275. *
  11276. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11277. *
  11278. * @details
  11279. * The following diagram shows the format of the rx peer map v3 message sent
  11280. * from the target to the host.
  11281. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11282. * This layout assumes the target operates as little-endian.
  11283. *
  11284. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11285. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11286. * | SW peer ID | VDEV ID | msg type |
  11287. * |-----------------+--------------------+-----------------+-----------------|
  11288. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11289. * |-----------------+--------------------+-----------------+-----------------|
  11290. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11291. * |-----------------+--------+-----------+-----------------+-----------------|
  11292. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11293. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11294. * | (8bits) | | (4bits) | |
  11295. * |-----------------+--------+--+--+--+--------------------------------------|
  11296. * | RESERVED |E |O | | |
  11297. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11298. * | |V |V | | |
  11299. * |-----------------+--------------------+-----------------------------------|
  11300. * | HTT_MSDU_IDX_ | RESERVED | |
  11301. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11302. * | (8bits) | | |
  11303. * |-----------------+--------------------+-----------------------------------|
  11304. * | Reserved_2 |
  11305. * |--------------------------------------------------------------------------|
  11306. * | Reserved_3 |
  11307. * |--------------------------------------------------------------------------|
  11308. *
  11309. * Where:
  11310. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11311. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11312. * NH = Next Hop
  11313. * The following field definitions describe the format of the rx peer map v3
  11314. * messages sent from the target to the host.
  11315. * - MSG_TYPE
  11316. * Bits 7:0
  11317. * Purpose: identifies this as a peer map v3 message
  11318. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11319. * - VDEV_ID
  11320. * Bits 15:8
  11321. * Purpose: Indicates which virtual device the peer is associated with.
  11322. * - SW_PEER_ID
  11323. * Bits 31:16
  11324. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11325. * - MAC_ADDR_L32
  11326. * Bits 31:0
  11327. * Purpose: Identifies which peer node the peer ID is for.
  11328. * Value: lower 4 bytes of peer node's MAC address
  11329. * - MAC_ADDR_U16
  11330. * Bits 15:0
  11331. * Purpose: Identifies which peer node the peer ID is for.
  11332. * Value: upper 2 bytes of peer node's MAC address
  11333. * - MULTICAST_SW_PEER_ID
  11334. * Bits 31:16
  11335. * Purpose: The multicast peer ID (index)
  11336. * Value: set to HTT_INVALID_PEER if not valid
  11337. * - HW_PEER_ID / AST_INDEX
  11338. * Bits 15:0
  11339. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11340. * address, so for rx frames marked for rx --> tx forwarding, the
  11341. * host can determine from the HW peer ID provided as meta-data with
  11342. * the rx frame which peer the frame is supposed to be forwarded to.
  11343. * - CACHE_SET_NUM
  11344. * Bits 19:16
  11345. * Purpose: Cache Set Number for AST_INDEX
  11346. * Cache set number that should be used to cache the index based
  11347. * search results, for address and flow search.
  11348. * This value should be equal to LSB 4 bits of the hash value
  11349. * of match data, in case of search index points to an entry which
  11350. * may be used in content based search also. The value can be
  11351. * anything when the entry pointed by search index will not be
  11352. * used for content based search.
  11353. * - HTT_MSDU_IDX_VALID_MASK
  11354. * Bits 31:24
  11355. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11356. * - ONCHIP_AST_IDX / RESERVED
  11357. * Bits 15:0
  11358. * Purpose: This field is valid only when split AST feature is enabled.
  11359. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11360. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11361. * address, this ast_idx is used for LMAC modules for RXPCU.
  11362. * - NEXT_HOP
  11363. * Bits 16
  11364. * Purpose: Flag indicates next_hop AST entry used for WDS
  11365. * (Wireless Distribution System).
  11366. * - ONCHIP_AST_VALID
  11367. * Bits 17
  11368. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11369. * - EXT_AST_VALID
  11370. * Bits 18
  11371. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11372. * - EXT_AST_INDEX
  11373. * Bits 15:0
  11374. * Purpose: This field describes Extended AST index
  11375. * Valid if EXT_AST_VALID flag set
  11376. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11377. * Bits 31:24
  11378. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11379. */
  11380. /* dword 0 */
  11381. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11382. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11383. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11384. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11385. /* dword 1 */
  11386. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11387. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11388. /* dword 2 */
  11389. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11390. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11391. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11392. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11393. /* dword 3 */
  11394. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11395. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11396. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11397. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11398. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11399. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11400. /* dword 4 */
  11401. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11402. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11403. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11404. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11405. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11406. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11407. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11408. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11409. /* dword 5 */
  11410. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11411. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11412. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11413. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11414. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11415. do { \
  11416. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11417. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11418. } while (0)
  11419. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11420. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11421. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11422. do { \
  11423. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11424. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11425. } while (0)
  11426. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11427. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11428. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11429. do { \
  11430. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11431. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11432. } while (0)
  11433. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11434. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11435. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11436. do { \
  11437. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11438. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11439. } while (0)
  11440. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11441. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11442. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11443. do { \
  11444. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11445. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11446. } while (0)
  11447. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11448. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11449. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11450. do { \
  11451. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11452. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11453. } while (0)
  11454. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11455. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11456. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11457. do { \
  11458. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11459. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11460. } while (0)
  11461. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11462. (((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)
  11463. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11464. do { \
  11465. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11466. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11467. } while (0)
  11468. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11469. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11470. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11471. do { \
  11472. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11473. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11474. } while (0)
  11475. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11476. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11477. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11478. do { \
  11479. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11480. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11481. } while (0)
  11482. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11483. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11484. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11485. do { \
  11486. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11487. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11488. } while (0)
  11489. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11490. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11491. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11492. do { \
  11493. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11494. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11495. } while (0)
  11496. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11497. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11498. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11499. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11500. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11501. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11502. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11503. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11504. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11505. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11506. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11507. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11508. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11509. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11510. /**
  11511. * @brief target -> host rx peer unmap V2 message definition
  11512. *
  11513. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11514. *
  11515. * The following diagram shows the format of the rx peer unmap message sent
  11516. * from the target to the host.
  11517. *
  11518. * |31 24|23 16|15 8|7 0|
  11519. * |-----------------------------------------------------------------------|
  11520. * | SW peer ID | VDEV ID | msg type |
  11521. * |-----------------------------------------------------------------------|
  11522. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11523. * |-----------------------------------------------------------------------|
  11524. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11525. * |-----------------------------------------------------------------------|
  11526. * | Peer Delete Duration |
  11527. * |-----------------------------------------------------------------------|
  11528. * | Reserved_0 | WDS Free Count |
  11529. * |-----------------------------------------------------------------------|
  11530. * | Reserved_1 |
  11531. * |-----------------------------------------------------------------------|
  11532. * | Reserved_2 |
  11533. * |-----------------------------------------------------------------------|
  11534. *
  11535. *
  11536. * The following field definitions describe the format of the rx peer unmap
  11537. * messages sent from the target to the host.
  11538. * - MSG_TYPE
  11539. * Bits 7:0
  11540. * Purpose: identifies this as an rx peer unmap v2 message
  11541. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11542. * - VDEV_ID
  11543. * Bits 15:8
  11544. * Purpose: Indicates which virtual device the peer is associated
  11545. * with.
  11546. * Value: vdev ID (used in the host to look up the vdev object)
  11547. * - SW_PEER_ID
  11548. * Bits 31:16
  11549. * Purpose: The peer ID (index) that WAL is freeing
  11550. * Value: (rx) peer ID
  11551. * - MAC_ADDR_L32
  11552. * Bits 31:0
  11553. * Purpose: Identifies which peer node the peer ID is for.
  11554. * Value: lower 4 bytes of peer node's MAC address
  11555. * - MAC_ADDR_U16
  11556. * Bits 15:0
  11557. * Purpose: Identifies which peer node the peer ID is for.
  11558. * Value: upper 2 bytes of peer node's MAC address
  11559. * - NEXT_HOP
  11560. * Bits 16
  11561. * Purpose: Bit indicates next_hop AST entry used for WDS
  11562. * (Wireless Distribution System).
  11563. * - PEER_DELETE_DURATION
  11564. * Bits 31:0
  11565. * Purpose: Time taken to delete peer, in msec,
  11566. * Used for monitoring / debugging PEER delete response delay
  11567. * - PEER_WDS_FREE_COUNT
  11568. * Bits 15:0
  11569. * Purpose: Count of WDS entries deleted associated to peer deleted
  11570. */
  11571. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11572. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11573. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11574. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11575. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11576. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11577. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11578. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11579. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11580. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11581. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11582. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11583. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11584. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11585. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11586. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11587. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11588. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11589. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11590. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11591. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11592. do { \
  11593. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11594. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11595. } while (0)
  11596. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11597. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11598. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11599. do { \
  11600. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11601. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11602. } while (0)
  11603. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11604. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11605. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11606. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11607. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11608. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11609. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11610. /**
  11611. * @brief target -> host rx peer mlo map message definition
  11612. *
  11613. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11614. *
  11615. * @details
  11616. * The following diagram shows the format of the rx mlo peer map message sent
  11617. * from the target to the host. This layout assumes the target operates
  11618. * as little-endian.
  11619. *
  11620. * MCC:
  11621. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11622. *
  11623. * WIN:
  11624. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11625. * It will be sent on the Assoc Link.
  11626. *
  11627. * This message always contains a MLO peer ID. The main purpose of the
  11628. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11629. * with, so that the host can use that MLO peer ID to determine which peer
  11630. * transmitted the rx frame.
  11631. *
  11632. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11633. * |-------------------------------------------------------------------------|
  11634. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11635. * |-------------------------------------------------------------------------|
  11636. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11637. * |-------------------------------------------------------------------------|
  11638. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11639. * |-------------------------------------------------------------------------|
  11640. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11641. * |-------------------------------------------------------------------------|
  11642. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11643. * |-------------------------------------------------------------------------|
  11644. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11645. * |-------------------------------------------------------------------------|
  11646. * |RSVD |
  11647. * |-------------------------------------------------------------------------|
  11648. * |RSVD |
  11649. * |-------------------------------------------------------------------------|
  11650. * | htt_tlv_hdr_t |
  11651. * |-------------------------------------------------------------------------|
  11652. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11653. * |-------------------------------------------------------------------------|
  11654. * | htt_tlv_hdr_t |
  11655. * |-------------------------------------------------------------------------|
  11656. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11657. * |-------------------------------------------------------------------------|
  11658. * | htt_tlv_hdr_t |
  11659. * |-------------------------------------------------------------------------|
  11660. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11661. * |-------------------------------------------------------------------------|
  11662. *
  11663. * Where:
  11664. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11665. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11666. * V (valid) - 1 Bit Bit17
  11667. * CHIPID - 3 Bits
  11668. * TIDMASK - 8 Bits
  11669. * CACHE_SET_NUM - 8 Bits
  11670. *
  11671. * The following field definitions describe the format of the rx MLO peer map
  11672. * messages sent from the target to the host.
  11673. * - MSG_TYPE
  11674. * Bits 7:0
  11675. * Purpose: identifies this as an rx mlo peer map message
  11676. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11677. *
  11678. * - MLO_PEER_ID
  11679. * Bits 23:8
  11680. * Purpose: The MLO peer ID (index).
  11681. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11682. * Value: MLO peer ID
  11683. *
  11684. * - NUMLINK
  11685. * Bits: 26:24 (3Bits)
  11686. * Purpose: Indicate the max number of logical links supported per client.
  11687. * Value: number of logical links
  11688. *
  11689. * - PRC
  11690. * Bits: 29:27 (3Bits)
  11691. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11692. * if there is migration of the primary chip.
  11693. * Value: Primary REO CHIPID
  11694. *
  11695. * - MAC_ADDR_L32
  11696. * Bits 31:0
  11697. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11698. * Value: lower 4 bytes of peer node's MAC address
  11699. *
  11700. * - MAC_ADDR_U16
  11701. * Bits 15:0
  11702. * Purpose: Identifies which peer node the peer ID is for.
  11703. * Value: upper 2 bytes of peer node's MAC address
  11704. *
  11705. * - PRIMARY_TCL_AST_IDX
  11706. * Bits 15:0
  11707. * Purpose: Primary TCL AST index for this peer.
  11708. *
  11709. * - V
  11710. * 1 Bit Position 16
  11711. * Purpose: If the ast idx is valid.
  11712. *
  11713. * - CHIPID
  11714. * Bits 19:17
  11715. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11716. *
  11717. * - TIDMASK
  11718. * Bits 27:20
  11719. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11720. *
  11721. * - CACHE_SET_NUM
  11722. * Bits 31:28
  11723. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11724. * Cache set number that should be used to cache the index based
  11725. * search results, for address and flow search.
  11726. * This value should be equal to LSB four bits of the hash value
  11727. * of match data, in case of search index points to an entry which
  11728. * may be used in content based search also. The value can be
  11729. * anything when the entry pointed by search index will not be
  11730. * used for content based search.
  11731. *
  11732. * - htt_tlv_hdr_t
  11733. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11734. *
  11735. * Bits 11:0
  11736. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11737. *
  11738. * Bits 23:12
  11739. * Purpose: Length, Length of the value that follows the header
  11740. *
  11741. * Bits 31:28
  11742. * Purpose: Reserved.
  11743. *
  11744. *
  11745. * - SW_PEER_ID
  11746. * Bits 15:0
  11747. * Purpose: The peer ID (index) that WAL is allocating
  11748. * Value: (rx) peer ID
  11749. *
  11750. * - VDEV_ID
  11751. * Bits 23:16
  11752. * Purpose: Indicates which virtual device the peer is associated with.
  11753. * Value: vdev ID (used in the host to look up the vdev object)
  11754. *
  11755. * - CHIPID
  11756. * Bits 26:24
  11757. * Purpose: Indicates which Chip id the peer is associated with.
  11758. * Value: chip ID (Provided by Host as part of QMI exchange)
  11759. */
  11760. typedef enum {
  11761. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11762. } MLO_PEER_MAP_TLV_TAG_ID;
  11763. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11764. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11765. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11766. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11767. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11768. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11769. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11770. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11771. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11772. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11773. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11774. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11775. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11776. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11777. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11778. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11779. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11780. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11781. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11782. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11783. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11784. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11785. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11786. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11787. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11788. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11789. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11790. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11791. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11792. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11793. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11794. do { \
  11795. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11796. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11797. } while (0)
  11798. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11799. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11800. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11801. do { \
  11802. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11803. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11804. } while (0)
  11805. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11806. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11807. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11808. do { \
  11809. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11810. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11811. } while (0)
  11812. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11813. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11814. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11815. do { \
  11816. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11817. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11818. } while (0)
  11819. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11820. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11821. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11822. do { \
  11823. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11824. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11825. } while (0)
  11826. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11827. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11828. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11829. do { \
  11830. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11831. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11832. } while (0)
  11833. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11834. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11835. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11836. do { \
  11837. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11838. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11839. } while (0)
  11840. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11841. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11842. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11843. do { \
  11844. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11845. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11846. } while (0)
  11847. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11848. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11849. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11850. do { \
  11851. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11852. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11853. } while (0)
  11854. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11855. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11856. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11857. do { \
  11858. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11859. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11860. } while (0)
  11861. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11862. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11863. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11864. do { \
  11865. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11866. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11867. } while (0)
  11868. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11869. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11870. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11871. do { \
  11872. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11873. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11874. } while (0)
  11875. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11876. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11877. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11878. do { \
  11879. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11880. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11881. } while (0)
  11882. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11883. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11884. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11885. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11886. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11887. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11888. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11889. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11890. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11891. *
  11892. * The following diagram shows the format of the rx mlo peer unmap message sent
  11893. * from the target to the host.
  11894. *
  11895. * |31 24|23 16|15 8|7 0|
  11896. * |-----------------------------------------------------------------------|
  11897. * | RSVD_24_31 | MLO peer ID | msg type |
  11898. * |-----------------------------------------------------------------------|
  11899. */
  11900. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11901. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11902. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11903. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11904. /**
  11905. * @brief target -> host message specifying security parameters
  11906. *
  11907. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11908. *
  11909. * @details
  11910. * The following diagram shows the format of the security specification
  11911. * message sent from the target to the host.
  11912. * This security specification message tells the host whether a PN check is
  11913. * necessary on rx data frames, and if so, how large the PN counter is.
  11914. * This message also tells the host about the security processing to apply
  11915. * to defragmented rx frames - specifically, whether a Message Integrity
  11916. * Check is required, and the Michael key to use.
  11917. *
  11918. * |31 24|23 16|15|14 8|7 0|
  11919. * |-----------------------------------------------------------------------|
  11920. * | peer ID | U| security type | msg type |
  11921. * |-----------------------------------------------------------------------|
  11922. * | Michael Key K0 |
  11923. * |-----------------------------------------------------------------------|
  11924. * | Michael Key K1 |
  11925. * |-----------------------------------------------------------------------|
  11926. * | WAPI RSC Low0 |
  11927. * |-----------------------------------------------------------------------|
  11928. * | WAPI RSC Low1 |
  11929. * |-----------------------------------------------------------------------|
  11930. * | WAPI RSC Hi0 |
  11931. * |-----------------------------------------------------------------------|
  11932. * | WAPI RSC Hi1 |
  11933. * |-----------------------------------------------------------------------|
  11934. *
  11935. * The following field definitions describe the format of the security
  11936. * indication message sent from the target to the host.
  11937. * - MSG_TYPE
  11938. * Bits 7:0
  11939. * Purpose: identifies this as a security specification message
  11940. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11941. * - SEC_TYPE
  11942. * Bits 14:8
  11943. * Purpose: specifies which type of security applies to the peer
  11944. * Value: htt_sec_type enum value
  11945. * - UNICAST
  11946. * Bit 15
  11947. * Purpose: whether this security is applied to unicast or multicast data
  11948. * Value: 1 -> unicast, 0 -> multicast
  11949. * - PEER_ID
  11950. * Bits 31:16
  11951. * Purpose: The ID number for the peer the security specification is for
  11952. * Value: peer ID
  11953. * - MICHAEL_KEY_K0
  11954. * Bits 31:0
  11955. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11956. * Value: Michael Key K0 (if security type is TKIP)
  11957. * - MICHAEL_KEY_K1
  11958. * Bits 31:0
  11959. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11960. * Value: Michael Key K1 (if security type is TKIP)
  11961. * - WAPI_RSC_LOW0
  11962. * Bits 31:0
  11963. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11964. * Value: WAPI RSC Low0 (if security type is WAPI)
  11965. * - WAPI_RSC_LOW1
  11966. * Bits 31:0
  11967. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11968. * Value: WAPI RSC Low1 (if security type is WAPI)
  11969. * - WAPI_RSC_HI0
  11970. * Bits 31:0
  11971. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11972. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11973. * - WAPI_RSC_HI1
  11974. * Bits 31:0
  11975. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11976. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11977. */
  11978. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11979. #define HTT_SEC_IND_SEC_TYPE_S 8
  11980. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11981. #define HTT_SEC_IND_UNICAST_S 15
  11982. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11983. #define HTT_SEC_IND_PEER_ID_S 16
  11984. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11985. do { \
  11986. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11987. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11988. } while (0)
  11989. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11990. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11991. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11992. do { \
  11993. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11994. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11995. } while (0)
  11996. #define HTT_SEC_IND_UNICAST_GET(word) \
  11997. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11998. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11999. do { \
  12000. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12001. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12002. } while (0)
  12003. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12004. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12005. #define HTT_SEC_IND_BYTES 28
  12006. /**
  12007. * @brief target -> host rx ADDBA / DELBA message definitions
  12008. *
  12009. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12010. *
  12011. * @details
  12012. * The following diagram shows the format of the rx ADDBA message sent
  12013. * from the target to the host:
  12014. *
  12015. * |31 20|19 16|15 8|7 0|
  12016. * |---------------------------------------------------------------------|
  12017. * | peer ID | TID | window size | msg type |
  12018. * |---------------------------------------------------------------------|
  12019. *
  12020. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12021. *
  12022. * The following diagram shows the format of the rx DELBA message sent
  12023. * from the target to the host:
  12024. *
  12025. * |31 20|19 16|15 10|9 8|7 0|
  12026. * |---------------------------------------------------------------------|
  12027. * | peer ID | TID | window size | IR| msg type |
  12028. * |---------------------------------------------------------------------|
  12029. *
  12030. * The following field definitions describe the format of the rx ADDBA
  12031. * and DELBA messages sent from the target to the host.
  12032. * - MSG_TYPE
  12033. * Bits 7:0
  12034. * Purpose: identifies this as an rx ADDBA or DELBA message
  12035. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12036. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12037. * - IR (initiator / recipient)
  12038. * Bits 9:8 (DELBA only)
  12039. * Purpose: specify whether the DELBA handshake was initiated by the
  12040. * local STA/AP, or by the peer STA/AP
  12041. * Value:
  12042. * 0 - unspecified
  12043. * 1 - initiator (a.k.a. originator)
  12044. * 2 - recipient (a.k.a. responder)
  12045. * 3 - unused / reserved
  12046. * - WIN_SIZE
  12047. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12048. * Purpose: Specifies the length of the block ack window (max = 64).
  12049. * Value:
  12050. * block ack window length specified by the received ADDBA/DELBA
  12051. * management message.
  12052. * - TID
  12053. * Bits 19:16
  12054. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12055. * Value:
  12056. * TID specified by the received ADDBA or DELBA management message.
  12057. * - PEER_ID
  12058. * Bits 31:20
  12059. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12060. * Value:
  12061. * ID (hash value) used by the host for fast, direct lookup of
  12062. * host SW peer info, including rx reorder states.
  12063. */
  12064. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12065. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12066. #define HTT_RX_ADDBA_TID_M 0xf0000
  12067. #define HTT_RX_ADDBA_TID_S 16
  12068. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12069. #define HTT_RX_ADDBA_PEER_ID_S 20
  12070. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12071. do { \
  12072. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12073. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12074. } while (0)
  12075. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12076. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12077. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12078. do { \
  12079. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12080. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12081. } while (0)
  12082. #define HTT_RX_ADDBA_TID_GET(word) \
  12083. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12084. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12085. do { \
  12086. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12087. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12088. } while (0)
  12089. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12090. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12091. #define HTT_RX_ADDBA_BYTES 4
  12092. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12093. #define HTT_RX_DELBA_INITIATOR_S 8
  12094. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12095. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12096. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12097. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12098. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12099. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12100. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12101. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12102. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12103. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12104. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12105. do { \
  12106. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12107. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12108. } while (0)
  12109. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12110. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12111. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12112. do { \
  12113. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12114. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12115. } while (0)
  12116. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12117. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12118. #define HTT_RX_DELBA_BYTES 4
  12119. /**
  12120. * @brief target -> host rx ADDBA / DELBA message definitions
  12121. *
  12122. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12123. *
  12124. * @details
  12125. * The following diagram shows the format of the rx ADDBA extn message sent
  12126. * from the target to the host:
  12127. *
  12128. * |31 20|19 16|15 13|12 8|7 0|
  12129. * |---------------------------------------------------------------------|
  12130. * | peer ID | TID | reserved | msg type |
  12131. * |---------------------------------------------------------------------|
  12132. * | reserved | window size |
  12133. * |---------------------------------------------------------------------|
  12134. *
  12135. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12136. *
  12137. * The following diagram shows the format of the rx DELBA message sent
  12138. * from the target to the host:
  12139. *
  12140. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12141. * |---------------------------------------------------------------------|
  12142. * | peer ID | TID | reserved | IR| msg type |
  12143. * |---------------------------------------------------------------------|
  12144. * | reserved | window size |
  12145. * |---------------------------------------------------------------------|
  12146. *
  12147. * The following field definitions describe the format of the rx ADDBA
  12148. * and DELBA messages sent from the target to the host.
  12149. * - MSG_TYPE
  12150. * Bits 7:0
  12151. * Purpose: identifies this as an rx ADDBA or DELBA message
  12152. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12153. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12154. * - IR (initiator / recipient)
  12155. * Bits 9:8 (DELBA only)
  12156. * Purpose: specify whether the DELBA handshake was initiated by the
  12157. * local STA/AP, or by the peer STA/AP
  12158. * Value:
  12159. * 0 - unspecified
  12160. * 1 - initiator (a.k.a. originator)
  12161. * 2 - recipient (a.k.a. responder)
  12162. * 3 - unused / reserved
  12163. * Value:
  12164. * block ack window length specified by the received ADDBA/DELBA
  12165. * management message.
  12166. * - TID
  12167. * Bits 19:16
  12168. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12169. * Value:
  12170. * TID specified by the received ADDBA or DELBA management message.
  12171. * - PEER_ID
  12172. * Bits 31:20
  12173. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12174. * Value:
  12175. * ID (hash value) used by the host for fast, direct lookup of
  12176. * host SW peer info, including rx reorder states.
  12177. * == DWORD 1
  12178. * - WIN_SIZE
  12179. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12180. * Purpose: Specifies the length of the block ack window (max = 8191).
  12181. */
  12182. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12183. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12184. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12185. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12186. /*--- Dword 0 ---*/
  12187. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12188. do { \
  12189. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12190. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12191. } while (0)
  12192. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12193. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12194. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12195. do { \
  12196. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12197. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12198. } while (0)
  12199. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12200. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12201. /*--- Dword 1 ---*/
  12202. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12203. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12204. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12205. do { \
  12206. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12207. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12208. } while (0)
  12209. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12210. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12211. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12212. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12213. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12214. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12215. #define HTT_RX_DELBA_EXTN_TID_S 16
  12216. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12217. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12218. /*--- Dword 0 ---*/
  12219. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12220. do { \
  12221. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12222. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12223. } while (0)
  12224. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12225. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12226. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12227. do { \
  12228. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12229. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12230. } while (0)
  12231. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12232. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12233. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12234. do { \
  12235. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12236. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12237. } while (0)
  12238. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12239. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12240. /*--- Dword 1 ---*/
  12241. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12242. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12243. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12244. do { \
  12245. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12246. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12247. } while (0)
  12248. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12249. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12250. #define HTT_RX_DELBA_EXTN_BYTES 8
  12251. /**
  12252. * @brief tx queue group information element definition
  12253. *
  12254. * @details
  12255. * The following diagram shows the format of the tx queue group
  12256. * information element, which can be included in target --> host
  12257. * messages to specify the number of tx "credits" (tx descriptors
  12258. * for LL, or tx buffers for HL) available to a particular group
  12259. * of host-side tx queues, and which host-side tx queues belong to
  12260. * the group.
  12261. *
  12262. * |31|30 24|23 16|15|14|13 0|
  12263. * |------------------------------------------------------------------------|
  12264. * | X| reserved | tx queue grp ID | A| S| credit count |
  12265. * |------------------------------------------------------------------------|
  12266. * | vdev ID mask | AC mask |
  12267. * |------------------------------------------------------------------------|
  12268. *
  12269. * The following definitions describe the fields within the tx queue group
  12270. * information element:
  12271. * - credit_count
  12272. * Bits 13:1
  12273. * Purpose: specify how many tx credits are available to the tx queue group
  12274. * Value: An absolute or relative, positive or negative credit value
  12275. * The 'A' bit specifies whether the value is absolute or relative.
  12276. * The 'S' bit specifies whether the value is positive or negative.
  12277. * A negative value can only be relative, not absolute.
  12278. * An absolute value replaces any prior credit value the host has for
  12279. * the tx queue group in question.
  12280. * A relative value is added to the prior credit value the host has for
  12281. * the tx queue group in question.
  12282. * - sign
  12283. * Bit 14
  12284. * Purpose: specify whether the credit count is positive or negative
  12285. * Value: 0 -> positive, 1 -> negative
  12286. * - absolute
  12287. * Bit 15
  12288. * Purpose: specify whether the credit count is absolute or relative
  12289. * Value: 0 -> relative, 1 -> absolute
  12290. * - txq_group_id
  12291. * Bits 23:16
  12292. * Purpose: indicate which tx queue group's credit and/or membership are
  12293. * being specified
  12294. * Value: 0 to max_tx_queue_groups-1
  12295. * - reserved
  12296. * Bits 30:16
  12297. * Value: 0x0
  12298. * - eXtension
  12299. * Bit 31
  12300. * Purpose: specify whether another tx queue group info element follows
  12301. * Value: 0 -> no more tx queue group information elements
  12302. * 1 -> another tx queue group information element immediately follows
  12303. * - ac_mask
  12304. * Bits 15:0
  12305. * Purpose: specify which Access Categories belong to the tx queue group
  12306. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12307. * the tx queue group.
  12308. * The AC bit-mask values are obtained by left-shifting by the
  12309. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12310. * - vdev_id_mask
  12311. * Bits 31:16
  12312. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12313. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12314. * belong to the tx queue group.
  12315. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12316. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12317. */
  12318. PREPACK struct htt_txq_group {
  12319. A_UINT32
  12320. credit_count: 14,
  12321. sign: 1,
  12322. absolute: 1,
  12323. tx_queue_group_id: 8,
  12324. reserved0: 7,
  12325. extension: 1;
  12326. A_UINT32
  12327. ac_mask: 16,
  12328. vdev_id_mask: 16;
  12329. } POSTPACK;
  12330. /* first word */
  12331. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12332. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12333. #define HTT_TXQ_GROUP_SIGN_S 14
  12334. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12335. #define HTT_TXQ_GROUP_ABS_S 15
  12336. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12337. #define HTT_TXQ_GROUP_ID_S 16
  12338. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12339. #define HTT_TXQ_GROUP_EXT_S 31
  12340. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12341. /* second word */
  12342. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12343. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12344. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12345. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12346. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12347. do { \
  12348. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12349. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12350. } while (0)
  12351. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12352. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12353. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12354. do { \
  12355. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12356. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12357. } while (0)
  12358. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12359. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12360. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12361. do { \
  12362. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12363. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12364. } while (0)
  12365. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12366. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12367. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12368. do { \
  12369. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12370. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12371. } while (0)
  12372. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12373. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12374. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12375. do { \
  12376. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12377. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12378. } while (0)
  12379. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12380. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12381. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12382. do { \
  12383. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12384. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12385. } while (0)
  12386. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12387. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12388. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12389. do { \
  12390. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12391. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12392. } while (0)
  12393. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12394. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12395. /**
  12396. * @brief target -> host TX completion indication message definition
  12397. *
  12398. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12399. *
  12400. * @details
  12401. * The following diagram shows the format of the TX completion indication sent
  12402. * from the target to the host
  12403. *
  12404. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12405. * |-------------------------------------------------------------------|
  12406. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12407. * |-------------------------------------------------------------------|
  12408. * payload:| MSDU1 ID | MSDU0 ID |
  12409. * |-------------------------------------------------------------------|
  12410. * : MSDU3 ID | MSDU2 ID :
  12411. * |-------------------------------------------------------------------|
  12412. * | struct htt_tx_compl_ind_append_retries |
  12413. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12414. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12415. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12416. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12417. * |-------------------------------------------------------------------|
  12418. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12419. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12420. * | MSDU0 tx_tsf64_low |
  12421. * |-------------------------------------------------------------------|
  12422. * | MSDU0 tx_tsf64_high |
  12423. * |-------------------------------------------------------------------|
  12424. * | MSDU1 tx_tsf64_low |
  12425. * |-------------------------------------------------------------------|
  12426. * | MSDU1 tx_tsf64_high |
  12427. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12428. * | phy_timestamp |
  12429. * |-------------------------------------------------------------------|
  12430. * | rate specs (see below) |
  12431. * |-------------------------------------------------------------------|
  12432. * | seqctrl | framectrl |
  12433. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12434. * Where:
  12435. * A0 = append (a.k.a. append0)
  12436. * A1 = append1
  12437. * TP = MSDU tx power presence
  12438. * A2 = append2
  12439. * A3 = append3
  12440. * A4 = append4
  12441. *
  12442. * The following field definitions describe the format of the TX completion
  12443. * indication sent from the target to the host
  12444. * Header fields:
  12445. * - msg_type
  12446. * Bits 7:0
  12447. * Purpose: identifies this as HTT TX completion indication
  12448. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12449. * - status
  12450. * Bits 10:8
  12451. * Purpose: the TX completion status of payload fragmentations descriptors
  12452. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12453. * - tid
  12454. * Bits 14:11
  12455. * Purpose: the tid associated with those fragmentation descriptors. It is
  12456. * valid or not, depending on the tid_invalid bit.
  12457. * Value: 0 to 15
  12458. * - tid_invalid
  12459. * Bits 15:15
  12460. * Purpose: this bit indicates whether the tid field is valid or not
  12461. * Value: 0 indicates valid; 1 indicates invalid
  12462. * - num
  12463. * Bits 23:16
  12464. * Purpose: the number of payload in this indication
  12465. * Value: 1 to 255
  12466. * - append (a.k.a. append0)
  12467. * Bits 24:24
  12468. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12469. * the number of tx retries for one MSDU at the end of this message
  12470. * Value: 0 indicates no appending; 1 indicates appending
  12471. * - append1
  12472. * Bits 25:25
  12473. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12474. * contains the timestamp info for each TX msdu id in payload.
  12475. * The order of the timestamps matches the order of the MSDU IDs.
  12476. * Note that a big-endian host needs to account for the reordering
  12477. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12478. * conversion) when determining which tx timestamp corresponds to
  12479. * which MSDU ID.
  12480. * Value: 0 indicates no appending; 1 indicates appending
  12481. * - msdu_tx_power_presence
  12482. * Bits 26:26
  12483. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12484. * for each MSDU referenced by the TX_COMPL_IND message.
  12485. * The tx power is reported in 0.5 dBm units.
  12486. * The order of the per-MSDU tx power reports matches the order
  12487. * of the MSDU IDs.
  12488. * Note that a big-endian host needs to account for the reordering
  12489. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12490. * conversion) when determining which Tx Power corresponds to
  12491. * which MSDU ID.
  12492. * Value: 0 indicates MSDU tx power reports are not appended,
  12493. * 1 indicates MSDU tx power reports are appended
  12494. * - append2
  12495. * Bits 27:27
  12496. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12497. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12498. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12499. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12500. * for each MSDU, for convenience.
  12501. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12502. * this append2 bit is set).
  12503. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12504. * dB above the noise floor.
  12505. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12506. * 1 indicates MSDU ACK RSSI values are appended.
  12507. * - append3
  12508. * Bits 28:28
  12509. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12510. * contains the tx tsf info based on wlan global TSF for
  12511. * each TX msdu id in payload.
  12512. * The order of the tx tsf matches the order of the MSDU IDs.
  12513. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12514. * values to indicate the the lower 32 bits and higher 32 bits of
  12515. * the tx tsf.
  12516. * The tx_tsf64 here represents the time MSDU was acked and the
  12517. * tx_tsf64 has microseconds units.
  12518. * Value: 0 indicates no appending; 1 indicates appending
  12519. * - append4
  12520. * Bits 29:29
  12521. * Purpose: Indicate whether data frame control fields and fields required
  12522. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12523. * message. The order of the this message matches the order of
  12524. * the MSDU IDs.
  12525. * Value: 0 indicates frame control fields and fields required for
  12526. * radio tap header values are not appended,
  12527. * 1 indicates frame control fields and fields required for
  12528. * radio tap header values are appended.
  12529. * Payload fields:
  12530. * - hmsdu_id
  12531. * Bits 15:0
  12532. * Purpose: this ID is used to track the Tx buffer in host
  12533. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12534. */
  12535. PREPACK struct htt_tx_data_hdr_information {
  12536. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12537. A_UINT32 /* word 1 */
  12538. /* preamble:
  12539. * 0-OFDM,
  12540. * 1-CCk,
  12541. * 2-HT,
  12542. * 3-VHT
  12543. */
  12544. preamble: 2, /* [1:0] */
  12545. /* mcs:
  12546. * In case of HT preamble interpret
  12547. * MCS along with NSS.
  12548. * Valid values for HT are 0 to 7.
  12549. * HT mcs 0 with NSS 2 is mcs 8.
  12550. * Valid values for VHT are 0 to 9.
  12551. */
  12552. mcs: 4, /* [5:2] */
  12553. /* rate:
  12554. * This is applicable only for
  12555. * CCK and OFDM preamble type
  12556. * rate 0: OFDM 48 Mbps,
  12557. * 1: OFDM 24 Mbps,
  12558. * 2: OFDM 12 Mbps
  12559. * 3: OFDM 6 Mbps
  12560. * 4: OFDM 54 Mbps
  12561. * 5: OFDM 36 Mbps
  12562. * 6: OFDM 18 Mbps
  12563. * 7: OFDM 9 Mbps
  12564. * rate 0: CCK 11 Mbps Long
  12565. * 1: CCK 5.5 Mbps Long
  12566. * 2: CCK 2 Mbps Long
  12567. * 3: CCK 1 Mbps Long
  12568. * 4: CCK 11 Mbps Short
  12569. * 5: CCK 5.5 Mbps Short
  12570. * 6: CCK 2 Mbps Short
  12571. */
  12572. rate : 3, /* [ 8: 6] */
  12573. rssi : 8, /* [16: 9] units=dBm */
  12574. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12575. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12576. stbc : 1, /* [22] */
  12577. sgi : 1, /* [23] */
  12578. ldpc : 1, /* [24] */
  12579. beamformed: 1, /* [25] */
  12580. /* tx_retry_cnt:
  12581. * Indicates retry count of data tx frames provided by the host.
  12582. */
  12583. tx_retry_cnt: 6; /* [31:26] */
  12584. A_UINT32 /* word 2 */
  12585. framectrl:16, /* [15: 0] */
  12586. seqno:16; /* [31:16] */
  12587. } POSTPACK;
  12588. #define HTT_TX_COMPL_IND_STATUS_S 8
  12589. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12590. #define HTT_TX_COMPL_IND_TID_S 11
  12591. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12592. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12593. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12594. #define HTT_TX_COMPL_IND_NUM_S 16
  12595. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12596. #define HTT_TX_COMPL_IND_APPEND_S 24
  12597. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12598. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12599. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12600. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12601. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12602. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12603. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12604. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12605. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12606. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12607. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12608. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12609. do { \
  12610. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12611. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12612. } while (0)
  12613. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12614. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12615. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12616. do { \
  12617. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12618. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12619. } while (0)
  12620. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12621. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12622. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12623. do { \
  12624. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12625. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12626. } while (0)
  12627. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12628. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12629. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12630. do { \
  12631. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12632. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12633. } while (0)
  12634. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12635. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12636. HTT_TX_COMPL_IND_TID_INV_S)
  12637. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12638. do { \
  12639. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12640. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12641. } while (0)
  12642. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12643. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12644. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12645. do { \
  12646. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12647. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12648. } while (0)
  12649. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12650. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12651. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12652. do { \
  12653. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12654. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12655. } while (0)
  12656. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12657. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12658. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12659. do { \
  12660. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12661. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12662. } while (0)
  12663. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12664. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12665. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12666. do { \
  12667. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12668. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12669. } while (0)
  12670. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12671. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12672. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12673. do { \
  12674. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12675. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12676. } while (0)
  12677. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12678. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12679. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12680. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12681. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12682. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12683. #define HTT_TX_COMPL_IND_STAT_OK 0
  12684. /* DISCARD:
  12685. * current meaning:
  12686. * MSDUs were queued for transmission but filtered by HW or SW
  12687. * without any over the air attempts
  12688. * legacy meaning (HL Rome):
  12689. * MSDUs were discarded by the target FW without any over the air
  12690. * attempts due to lack of space
  12691. */
  12692. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12693. /* NO_ACK:
  12694. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12695. */
  12696. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12697. /* POSTPONE:
  12698. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12699. * be downloaded again later (in the appropriate order), when they are
  12700. * deliverable.
  12701. */
  12702. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12703. /*
  12704. * The PEER_DEL tx completion status is used for HL cases
  12705. * where the peer the frame is for has been deleted.
  12706. * The host has already discarded its copy of the frame, but
  12707. * it still needs the tx completion to restore its credit.
  12708. */
  12709. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12710. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12711. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12712. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12713. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12714. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12715. PREPACK struct htt_tx_compl_ind_base {
  12716. A_UINT32 hdr;
  12717. A_UINT16 payload[1/*or more*/];
  12718. } POSTPACK;
  12719. PREPACK struct htt_tx_compl_ind_append_retries {
  12720. A_UINT16 msdu_id;
  12721. A_UINT8 tx_retries;
  12722. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12723. 0: this is the last append_retries struct */
  12724. } POSTPACK;
  12725. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12726. A_UINT32 timestamp[1/*or more*/];
  12727. } POSTPACK;
  12728. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12729. A_UINT32 tx_tsf64_low;
  12730. A_UINT32 tx_tsf64_high;
  12731. } POSTPACK;
  12732. /* htt_tx_data_hdr_information payload extension fields: */
  12733. /* DWORD zero */
  12734. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12735. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12736. /* DWORD one */
  12737. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12738. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12739. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12740. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12741. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12742. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12743. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12744. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12745. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12746. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12747. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12748. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12749. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12750. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12751. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12752. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12753. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12754. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12755. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12756. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12757. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12758. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12759. /* DWORD two */
  12760. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12761. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12762. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12763. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12764. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12765. do { \
  12766. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12767. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12768. } while (0)
  12769. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12770. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12771. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12772. do { \
  12773. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12774. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12775. } while (0)
  12776. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12777. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12778. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12779. do { \
  12780. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12781. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12782. } while (0)
  12783. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12784. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12785. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12786. do { \
  12787. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12788. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12789. } while (0)
  12790. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12791. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12792. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12793. do { \
  12794. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12795. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12796. } while (0)
  12797. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12798. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12799. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12800. do { \
  12801. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12802. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12803. } while (0)
  12804. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12805. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12806. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12807. do { \
  12808. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12809. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12810. } while (0)
  12811. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12812. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12813. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12814. do { \
  12815. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12816. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12817. } while (0)
  12818. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12819. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12820. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12821. do { \
  12822. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12823. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12824. } while (0)
  12825. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12826. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12827. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12828. do { \
  12829. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12830. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12831. } while (0)
  12832. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12833. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12834. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12835. do { \
  12836. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12837. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12838. } while (0)
  12839. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12840. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12841. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12842. do { \
  12843. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12844. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12845. } while (0)
  12846. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12847. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12848. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12849. do { \
  12850. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12851. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12852. } while (0)
  12853. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12854. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12855. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12856. do { \
  12857. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12858. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12859. } while (0)
  12860. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12861. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12862. /**
  12863. * @brief target -> host rate-control update indication message
  12864. *
  12865. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12866. *
  12867. * @details
  12868. * The following diagram shows the format of the RC Update message
  12869. * sent from the target to the host, while processing the tx-completion
  12870. * of a transmitted PPDU.
  12871. *
  12872. * |31 24|23 16|15 8|7 0|
  12873. * |-------------------------------------------------------------|
  12874. * | peer ID | vdev ID | msg_type |
  12875. * |-------------------------------------------------------------|
  12876. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12877. * |-------------------------------------------------------------|
  12878. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12879. * |-------------------------------------------------------------|
  12880. * | : |
  12881. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12882. * | : |
  12883. * |-------------------------------------------------------------|
  12884. * | : |
  12885. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12886. * | : |
  12887. * |-------------------------------------------------------------|
  12888. * : :
  12889. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12890. *
  12891. */
  12892. typedef struct {
  12893. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12894. A_UINT32 rate_code_flags;
  12895. A_UINT32 flags; /* Encodes information such as excessive
  12896. retransmission, aggregate, some info
  12897. from .11 frame control,
  12898. STBC, LDPC, (SGI and Tx Chain Mask
  12899. are encoded in ptx_rc->flags field),
  12900. AMPDU truncation (BT/time based etc.),
  12901. RTS/CTS attempt */
  12902. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12903. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12904. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12905. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12906. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12907. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12908. } HTT_RC_TX_DONE_PARAMS;
  12909. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12910. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12911. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12912. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12913. #define HTT_RC_UPDATE_VDEVID_S 8
  12914. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12915. #define HTT_RC_UPDATE_PEERID_S 16
  12916. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12917. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12918. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12919. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12920. do { \
  12921. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12922. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12923. } while (0)
  12924. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12925. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12926. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12927. do { \
  12928. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12929. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12930. } while (0)
  12931. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12932. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12933. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12934. do { \
  12935. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12936. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12937. } while (0)
  12938. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12939. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12940. /**
  12941. * @brief target -> host rx fragment indication message definition
  12942. *
  12943. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12944. *
  12945. * @details
  12946. * The following field definitions describe the format of the rx fragment
  12947. * indication message sent from the target to the host.
  12948. * The rx fragment indication message shares the format of the
  12949. * rx indication message, but not all fields from the rx indication message
  12950. * are relevant to the rx fragment indication message.
  12951. *
  12952. *
  12953. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12954. * |-----------+-------------------+---------------------+-------------|
  12955. * | peer ID | |FV| ext TID | msg type |
  12956. * |-------------------------------------------------------------------|
  12957. * | | flush | flush |
  12958. * | | end | start |
  12959. * | | seq num | seq num |
  12960. * |-------------------------------------------------------------------|
  12961. * | reserved | FW rx desc bytes |
  12962. * |-------------------------------------------------------------------|
  12963. * | | FW MSDU Rx |
  12964. * | | desc B0 |
  12965. * |-------------------------------------------------------------------|
  12966. * Header fields:
  12967. * - MSG_TYPE
  12968. * Bits 7:0
  12969. * Purpose: identifies this as an rx fragment indication message
  12970. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12971. * - EXT_TID
  12972. * Bits 12:8
  12973. * Purpose: identify the traffic ID of the rx data, including
  12974. * special "extended" TID values for multicast, broadcast, and
  12975. * non-QoS data frames
  12976. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12977. * - FLUSH_VALID (FV)
  12978. * Bit 13
  12979. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12980. * is valid
  12981. * Value:
  12982. * 1 -> flush IE is valid and needs to be processed
  12983. * 0 -> flush IE is not valid and should be ignored
  12984. * - PEER_ID
  12985. * Bits 31:16
  12986. * Purpose: Identify, by ID, which peer sent the rx data
  12987. * Value: ID of the peer who sent the rx data
  12988. * - FLUSH_SEQ_NUM_START
  12989. * Bits 5:0
  12990. * Purpose: Indicate the start of a series of MPDUs to flush
  12991. * Not all MPDUs within this series are necessarily valid - the host
  12992. * must check each sequence number within this range to see if the
  12993. * corresponding MPDU is actually present.
  12994. * This field is only valid if the FV bit is set.
  12995. * Value:
  12996. * The sequence number for the first MPDUs to check to flush.
  12997. * The sequence number is masked by 0x3f.
  12998. * - FLUSH_SEQ_NUM_END
  12999. * Bits 11:6
  13000. * Purpose: Indicate the end of a series of MPDUs to flush
  13001. * Value:
  13002. * The sequence number one larger than the sequence number of the
  13003. * last MPDU to check to flush.
  13004. * The sequence number is masked by 0x3f.
  13005. * Not all MPDUs within this series are necessarily valid - the host
  13006. * must check each sequence number within this range to see if the
  13007. * corresponding MPDU is actually present.
  13008. * This field is only valid if the FV bit is set.
  13009. * Rx descriptor fields:
  13010. * - FW_RX_DESC_BYTES
  13011. * Bits 15:0
  13012. * Purpose: Indicate how many bytes in the Rx indication are used for
  13013. * FW Rx descriptors
  13014. * Value: 1
  13015. */
  13016. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13017. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13018. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13019. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13020. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13021. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13022. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13023. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13024. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13025. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13026. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13027. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13028. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13029. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13030. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13031. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13032. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13033. #define HTT_RX_FRAG_IND_BYTES \
  13034. (4 /* msg hdr */ + \
  13035. 4 /* flush spec */ + \
  13036. 4 /* (unused) FW rx desc bytes spec */ + \
  13037. 4 /* FW rx desc */)
  13038. /**
  13039. * @brief target -> host test message definition
  13040. *
  13041. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13042. *
  13043. * @details
  13044. * The following field definitions describe the format of the test
  13045. * message sent from the target to the host.
  13046. * The message consists of a 4-octet header, followed by a variable
  13047. * number of 32-bit integer values, followed by a variable number
  13048. * of 8-bit character values.
  13049. *
  13050. * |31 16|15 8|7 0|
  13051. * |-----------------------------------------------------------|
  13052. * | num chars | num ints | msg type |
  13053. * |-----------------------------------------------------------|
  13054. * | int 0 |
  13055. * |-----------------------------------------------------------|
  13056. * | int 1 |
  13057. * |-----------------------------------------------------------|
  13058. * | ... |
  13059. * |-----------------------------------------------------------|
  13060. * | char 3 | char 2 | char 1 | char 0 |
  13061. * |-----------------------------------------------------------|
  13062. * | | | ... | char 4 |
  13063. * |-----------------------------------------------------------|
  13064. * - MSG_TYPE
  13065. * Bits 7:0
  13066. * Purpose: identifies this as a test message
  13067. * Value: HTT_MSG_TYPE_TEST
  13068. * - NUM_INTS
  13069. * Bits 15:8
  13070. * Purpose: indicate how many 32-bit integers follow the message header
  13071. * - NUM_CHARS
  13072. * Bits 31:16
  13073. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13074. */
  13075. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13076. #define HTT_RX_TEST_NUM_INTS_S 8
  13077. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13078. #define HTT_RX_TEST_NUM_CHARS_S 16
  13079. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13080. do { \
  13081. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13082. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13083. } while (0)
  13084. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13085. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13086. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13087. do { \
  13088. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13089. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13090. } while (0)
  13091. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13092. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13093. /**
  13094. * @brief target -> host packet log message
  13095. *
  13096. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13097. *
  13098. * @details
  13099. * The following field definitions describe the format of the packet log
  13100. * message sent from the target to the host.
  13101. * The message consists of a 4-octet header,followed by a variable number
  13102. * of 32-bit character values.
  13103. *
  13104. * |31 16|15 12|11 10|9 8|7 0|
  13105. * |------------------------------------------------------------------|
  13106. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13107. * |------------------------------------------------------------------|
  13108. * | payload |
  13109. * |------------------------------------------------------------------|
  13110. * - MSG_TYPE
  13111. * Bits 7:0
  13112. * Purpose: identifies this as a pktlog message
  13113. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13114. * - mac_id
  13115. * Bits 9:8
  13116. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13117. * Value: 0-3
  13118. * - pdev_id
  13119. * Bits 11:10
  13120. * Purpose: pdev_id
  13121. * Value: 0-3
  13122. * 0 (for rings at SOC level),
  13123. * 1/2/3 PDEV -> 0/1/2
  13124. * - payload_size
  13125. * Bits 31:16
  13126. * Purpose: explicitly specify the payload size
  13127. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13128. */
  13129. PREPACK struct htt_pktlog_msg {
  13130. A_UINT32 header;
  13131. A_UINT32 payload[1/* or more */];
  13132. } POSTPACK;
  13133. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13134. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13135. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13136. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13137. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13138. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13139. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13140. do { \
  13141. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13142. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13143. } while (0)
  13144. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13145. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13146. HTT_T2H_PKTLOG_MAC_ID_S)
  13147. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13148. do { \
  13149. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13150. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13151. } while (0)
  13152. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13153. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13154. HTT_T2H_PKTLOG_PDEV_ID_S)
  13155. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13156. do { \
  13157. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13158. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13159. } while (0)
  13160. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13161. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13162. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13163. /*
  13164. * Rx reorder statistics
  13165. * NB: all the fields must be defined in 4 octets size.
  13166. */
  13167. struct rx_reorder_stats {
  13168. /* Non QoS MPDUs received */
  13169. A_UINT32 deliver_non_qos;
  13170. /* MPDUs received in-order */
  13171. A_UINT32 deliver_in_order;
  13172. /* Flush due to reorder timer expired */
  13173. A_UINT32 deliver_flush_timeout;
  13174. /* Flush due to move out of window */
  13175. A_UINT32 deliver_flush_oow;
  13176. /* Flush due to DELBA */
  13177. A_UINT32 deliver_flush_delba;
  13178. /* MPDUs dropped due to FCS error */
  13179. A_UINT32 fcs_error;
  13180. /* MPDUs dropped due to monitor mode non-data packet */
  13181. A_UINT32 mgmt_ctrl;
  13182. /* Unicast-data MPDUs dropped due to invalid peer */
  13183. A_UINT32 invalid_peer;
  13184. /* MPDUs dropped due to duplication (non aggregation) */
  13185. A_UINT32 dup_non_aggr;
  13186. /* MPDUs dropped due to processed before */
  13187. A_UINT32 dup_past;
  13188. /* MPDUs dropped due to duplicate in reorder queue */
  13189. A_UINT32 dup_in_reorder;
  13190. /* Reorder timeout happened */
  13191. A_UINT32 reorder_timeout;
  13192. /* invalid bar ssn */
  13193. A_UINT32 invalid_bar_ssn;
  13194. /* reorder reset due to bar ssn */
  13195. A_UINT32 ssn_reset;
  13196. /* Flush due to delete peer */
  13197. A_UINT32 deliver_flush_delpeer;
  13198. /* Flush due to offload*/
  13199. A_UINT32 deliver_flush_offload;
  13200. /* Flush due to out of buffer*/
  13201. A_UINT32 deliver_flush_oob;
  13202. /* MPDUs dropped due to PN check fail */
  13203. A_UINT32 pn_fail;
  13204. /* MPDUs dropped due to unable to allocate memory */
  13205. A_UINT32 store_fail;
  13206. /* Number of times the tid pool alloc succeeded */
  13207. A_UINT32 tid_pool_alloc_succ;
  13208. /* Number of times the MPDU pool alloc succeeded */
  13209. A_UINT32 mpdu_pool_alloc_succ;
  13210. /* Number of times the MSDU pool alloc succeeded */
  13211. A_UINT32 msdu_pool_alloc_succ;
  13212. /* Number of times the tid pool alloc failed */
  13213. A_UINT32 tid_pool_alloc_fail;
  13214. /* Number of times the MPDU pool alloc failed */
  13215. A_UINT32 mpdu_pool_alloc_fail;
  13216. /* Number of times the MSDU pool alloc failed */
  13217. A_UINT32 msdu_pool_alloc_fail;
  13218. /* Number of times the tid pool freed */
  13219. A_UINT32 tid_pool_free;
  13220. /* Number of times the MPDU pool freed */
  13221. A_UINT32 mpdu_pool_free;
  13222. /* Number of times the MSDU pool freed */
  13223. A_UINT32 msdu_pool_free;
  13224. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13225. A_UINT32 msdu_queued;
  13226. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13227. A_UINT32 msdu_recycled;
  13228. /* Number of MPDUs with invalid peer but A2 found in AST */
  13229. A_UINT32 invalid_peer_a2_in_ast;
  13230. /* Number of MPDUs with invalid peer but A3 found in AST */
  13231. A_UINT32 invalid_peer_a3_in_ast;
  13232. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13233. A_UINT32 invalid_peer_bmc_mpdus;
  13234. /* Number of MSDUs with err attention word */
  13235. A_UINT32 rxdesc_err_att;
  13236. /* Number of MSDUs with flag of peer_idx_invalid */
  13237. A_UINT32 rxdesc_err_peer_idx_inv;
  13238. /* Number of MSDUs with flag of peer_idx_timeout */
  13239. A_UINT32 rxdesc_err_peer_idx_to;
  13240. /* Number of MSDUs with flag of overflow */
  13241. A_UINT32 rxdesc_err_ov;
  13242. /* Number of MSDUs with flag of msdu_length_err */
  13243. A_UINT32 rxdesc_err_msdu_len;
  13244. /* Number of MSDUs with flag of mpdu_length_err */
  13245. A_UINT32 rxdesc_err_mpdu_len;
  13246. /* Number of MSDUs with flag of tkip_mic_err */
  13247. A_UINT32 rxdesc_err_tkip_mic;
  13248. /* Number of MSDUs with flag of decrypt_err */
  13249. A_UINT32 rxdesc_err_decrypt;
  13250. /* Number of MSDUs with flag of fcs_err */
  13251. A_UINT32 rxdesc_err_fcs;
  13252. /* Number of Unicast (bc_mc bit is not set in attention word)
  13253. * frames with invalid peer handler
  13254. */
  13255. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13256. /* Number of unicast frame directly (direct bit is set in attention word)
  13257. * to DUT with invalid peer handler
  13258. */
  13259. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13260. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13261. * frames with invalid peer handler
  13262. */
  13263. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13264. /* Number of MSDUs dropped due to no first MSDU flag */
  13265. A_UINT32 rxdesc_no_1st_msdu;
  13266. /* Number of MSDUs droped due to ring overflow */
  13267. A_UINT32 msdu_drop_ring_ov;
  13268. /* Number of MSDUs dropped due to FC mismatch */
  13269. A_UINT32 msdu_drop_fc_mismatch;
  13270. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13271. A_UINT32 msdu_drop_mgmt_remote_ring;
  13272. /* Number of MSDUs dropped due to errors not reported in attention word */
  13273. A_UINT32 msdu_drop_misc;
  13274. /* Number of MSDUs go to offload before reorder */
  13275. A_UINT32 offload_msdu_wal;
  13276. /* Number of data frame dropped by offload after reorder */
  13277. A_UINT32 offload_msdu_reorder;
  13278. /* Number of MPDUs with sequence number in the past and within the BA window */
  13279. A_UINT32 dup_past_within_window;
  13280. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13281. A_UINT32 dup_past_outside_window;
  13282. /* Number of MSDUs with decrypt/MIC error */
  13283. A_UINT32 rxdesc_err_decrypt_mic;
  13284. /* Number of data MSDUs received on both local and remote rings */
  13285. A_UINT32 data_msdus_on_both_rings;
  13286. /* MPDUs never filled */
  13287. A_UINT32 holes_not_filled;
  13288. };
  13289. /*
  13290. * Rx Remote buffer statistics
  13291. * NB: all the fields must be defined in 4 octets size.
  13292. */
  13293. struct rx_remote_buffer_mgmt_stats {
  13294. /* Total number of MSDUs reaped for Rx processing */
  13295. A_UINT32 remote_reaped;
  13296. /* MSDUs recycled within firmware */
  13297. A_UINT32 remote_recycled;
  13298. /* MSDUs stored by Data Rx */
  13299. A_UINT32 data_rx_msdus_stored;
  13300. /* Number of HTT indications from WAL Rx MSDU */
  13301. A_UINT32 wal_rx_ind;
  13302. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13303. A_UINT32 wal_rx_ind_unconsumed;
  13304. /* Number of HTT indications from Data Rx MSDU */
  13305. A_UINT32 data_rx_ind;
  13306. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13307. A_UINT32 data_rx_ind_unconsumed;
  13308. /* Number of HTT indications from ATHBUF */
  13309. A_UINT32 athbuf_rx_ind;
  13310. /* Number of remote buffers requested for refill */
  13311. A_UINT32 refill_buf_req;
  13312. /* Number of remote buffers filled by the host */
  13313. A_UINT32 refill_buf_rsp;
  13314. /* Number of times MAC hw_index = f/w write_index */
  13315. A_INT32 mac_no_bufs;
  13316. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13317. A_INT32 fw_indices_equal;
  13318. /* Number of times f/w finds no buffers to post */
  13319. A_INT32 host_no_bufs;
  13320. };
  13321. /*
  13322. * TXBF MU/SU packets and NDPA statistics
  13323. * NB: all the fields must be defined in 4 octets size.
  13324. */
  13325. struct rx_txbf_musu_ndpa_pkts_stats {
  13326. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13327. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13328. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13329. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13330. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13331. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13332. };
  13333. /*
  13334. * htt_dbg_stats_status -
  13335. * present - The requested stats have been delivered in full.
  13336. * This indicates that either the stats information was contained
  13337. * in its entirety within this message, or else this message
  13338. * completes the delivery of the requested stats info that was
  13339. * partially delivered through earlier STATS_CONF messages.
  13340. * partial - The requested stats have been delivered in part.
  13341. * One or more subsequent STATS_CONF messages with the same
  13342. * cookie value will be sent to deliver the remainder of the
  13343. * information.
  13344. * error - The requested stats could not be delivered, for example due
  13345. * to a shortage of memory to construct a message holding the
  13346. * requested stats.
  13347. * invalid - The requested stat type is either not recognized, or the
  13348. * target is configured to not gather the stats type in question.
  13349. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13350. * series_done - This special value indicates that no further stats info
  13351. * elements are present within a series of stats info elems
  13352. * (within a stats upload confirmation message).
  13353. */
  13354. enum htt_dbg_stats_status {
  13355. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13356. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13357. HTT_DBG_STATS_STATUS_ERROR = 2,
  13358. HTT_DBG_STATS_STATUS_INVALID = 3,
  13359. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13360. };
  13361. /**
  13362. * @brief target -> host statistics upload
  13363. *
  13364. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13365. *
  13366. * @details
  13367. * The following field definitions describe the format of the HTT target
  13368. * to host stats upload confirmation message.
  13369. * The message contains a cookie echoed from the HTT host->target stats
  13370. * upload request, which identifies which request the confirmation is
  13371. * for, and a series of tag-length-value stats information elements.
  13372. * The tag-length header for each stats info element also includes a
  13373. * status field, to indicate whether the request for the stat type in
  13374. * question was fully met, partially met, unable to be met, or invalid
  13375. * (if the stat type in question is disabled in the target).
  13376. * A special value of all 1's in this status field is used to indicate
  13377. * the end of the series of stats info elements.
  13378. *
  13379. *
  13380. * |31 16|15 8|7 5|4 0|
  13381. * |------------------------------------------------------------|
  13382. * | reserved | msg type |
  13383. * |------------------------------------------------------------|
  13384. * | cookie LSBs |
  13385. * |------------------------------------------------------------|
  13386. * | cookie MSBs |
  13387. * |------------------------------------------------------------|
  13388. * | stats entry length | reserved | S |stat type|
  13389. * |------------------------------------------------------------|
  13390. * | |
  13391. * | type-specific stats info |
  13392. * | |
  13393. * |------------------------------------------------------------|
  13394. * | stats entry length | reserved | S |stat type|
  13395. * |------------------------------------------------------------|
  13396. * | |
  13397. * | type-specific stats info |
  13398. * | |
  13399. * |------------------------------------------------------------|
  13400. * | n/a | reserved | 111 | n/a |
  13401. * |------------------------------------------------------------|
  13402. * Header fields:
  13403. * - MSG_TYPE
  13404. * Bits 7:0
  13405. * Purpose: identifies this is a statistics upload confirmation message
  13406. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13407. * - COOKIE_LSBS
  13408. * Bits 31:0
  13409. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13410. * message with its preceding host->target stats request message.
  13411. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13412. * - COOKIE_MSBS
  13413. * Bits 31:0
  13414. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13415. * message with its preceding host->target stats request message.
  13416. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13417. *
  13418. * Stats Information Element tag-length header fields:
  13419. * - STAT_TYPE
  13420. * Bits 4:0
  13421. * Purpose: identifies the type of statistics info held in the
  13422. * following information element
  13423. * Value: htt_dbg_stats_type
  13424. * - STATUS
  13425. * Bits 7:5
  13426. * Purpose: indicate whether the requested stats are present
  13427. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13428. * the completion of the stats entry series
  13429. * - LENGTH
  13430. * Bits 31:16
  13431. * Purpose: indicate the stats information size
  13432. * Value: This field specifies the number of bytes of stats information
  13433. * that follows the element tag-length header.
  13434. * It is expected but not required that this length is a multiple of
  13435. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13436. * subsequent stats entry header will begin on a 4-byte aligned
  13437. * boundary.
  13438. */
  13439. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13440. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13441. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13442. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13443. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13444. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13445. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13446. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13447. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13448. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13449. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13450. do { \
  13451. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13452. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13453. } while (0)
  13454. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13455. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13456. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13457. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13458. do { \
  13459. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13460. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13461. } while (0)
  13462. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13463. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13464. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13465. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13466. do { \
  13467. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13468. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13469. } while (0)
  13470. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13471. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13472. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13473. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13474. #define HTT_MAX_AGGR 64
  13475. #define HTT_HL_MAX_AGGR 18
  13476. /**
  13477. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13478. *
  13479. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13480. *
  13481. * @details
  13482. * The following field definitions describe the format of the HTT host
  13483. * to target frag_desc/msdu_ext bank configuration message.
  13484. * The message contains the based address and the min and max id of the
  13485. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13486. * MSDU_EXT/FRAG_DESC.
  13487. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13488. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13489. * the hardware does the mapping/translation.
  13490. *
  13491. * Total banks that can be configured is configured to 16.
  13492. *
  13493. * This should be called before any TX has be initiated by the HTT
  13494. *
  13495. * |31 16|15 8|7 5|4 0|
  13496. * |------------------------------------------------------------|
  13497. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13498. * |------------------------------------------------------------|
  13499. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13500. #if HTT_PADDR64
  13501. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13502. #endif
  13503. * |------------------------------------------------------------|
  13504. * | ... |
  13505. * |------------------------------------------------------------|
  13506. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13507. #if HTT_PADDR64
  13508. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13509. #endif
  13510. * |------------------------------------------------------------|
  13511. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13512. * |------------------------------------------------------------|
  13513. * | ... |
  13514. * |------------------------------------------------------------|
  13515. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13516. * |------------------------------------------------------------|
  13517. * Header fields:
  13518. * - MSG_TYPE
  13519. * Bits 7:0
  13520. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13521. * for systems with 64-bit format for bus addresses:
  13522. * - BANKx_BASE_ADDRESS_LO
  13523. * Bits 31:0
  13524. * Purpose: Provide a mechanism to specify the base address of the
  13525. * MSDU_EXT bank physical/bus address.
  13526. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13527. * - BANKx_BASE_ADDRESS_HI
  13528. * Bits 31:0
  13529. * Purpose: Provide a mechanism to specify the base address of the
  13530. * MSDU_EXT bank physical/bus address.
  13531. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13532. * for systems with 32-bit format for bus addresses:
  13533. * - BANKx_BASE_ADDRESS
  13534. * Bits 31:0
  13535. * Purpose: Provide a mechanism to specify the base address of the
  13536. * MSDU_EXT bank physical/bus address.
  13537. * Value: MSDU_EXT bank physical / bus address
  13538. * - BANKx_MIN_ID
  13539. * Bits 15:0
  13540. * Purpose: Provide a mechanism to specify the min index that needs to
  13541. * mapped.
  13542. * - BANKx_MAX_ID
  13543. * Bits 31:16
  13544. * Purpose: Provide a mechanism to specify the max index that needs to
  13545. * mapped.
  13546. *
  13547. */
  13548. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13549. * safe value.
  13550. * @note MAX supported banks is 16.
  13551. */
  13552. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13553. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13554. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13555. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13556. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13557. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13558. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13559. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13560. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13561. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13562. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13563. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13564. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13565. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13566. do { \
  13567. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13568. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13569. } while (0)
  13570. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13571. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13572. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13573. do { \
  13574. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13575. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13576. } while (0)
  13577. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13578. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13579. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13580. do { \
  13581. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13582. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13583. } while (0)
  13584. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13585. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13586. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13587. do { \
  13588. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13589. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13590. } while (0)
  13591. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13592. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13593. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13594. do { \
  13595. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13596. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13597. } while (0)
  13598. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13599. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13600. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13601. do { \
  13602. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13603. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13604. } while (0)
  13605. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13606. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13607. /*
  13608. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13609. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13610. * addresses are stored in a XXX-bit field.
  13611. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13612. * htt_tx_frag_desc64_bank_cfg_t structs.
  13613. */
  13614. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13615. _paddr_bits_, \
  13616. _paddr__bank_base_address_) \
  13617. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13618. /** word 0 \
  13619. * msg_type: 8, \
  13620. * pdev_id: 2, \
  13621. * swap: 1, \
  13622. * reserved0: 5, \
  13623. * num_banks: 8, \
  13624. * desc_size: 8; \
  13625. */ \
  13626. A_UINT32 word0; \
  13627. /* \
  13628. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13629. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13630. * the second A_UINT32). \
  13631. */ \
  13632. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13633. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13634. } POSTPACK
  13635. /* define htt_tx_frag_desc32_bank_cfg_t */
  13636. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13637. /* define htt_tx_frag_desc64_bank_cfg_t */
  13638. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13639. /*
  13640. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13641. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13642. */
  13643. #if HTT_PADDR64
  13644. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13645. #else
  13646. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13647. #endif
  13648. /**
  13649. * @brief target -> host HTT TX Credit total count update message definition
  13650. *
  13651. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13652. *
  13653. *|31 16|15|14 9| 8 |7 0 |
  13654. *|---------------------+--+----------+-------+----------|
  13655. *|cur htt credit delta | Q| reserved | sign | msg type |
  13656. *|------------------------------------------------------|
  13657. *
  13658. * Header fields:
  13659. * - MSG_TYPE
  13660. * Bits 7:0
  13661. * Purpose: identifies this as a htt tx credit delta update message
  13662. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13663. * - SIGN
  13664. * Bits 8
  13665. * identifies whether credit delta is positive or negative
  13666. * Value:
  13667. * - 0x0: credit delta is positive, rebalance in some buffers
  13668. * - 0x1: credit delta is negative, rebalance out some buffers
  13669. * - reserved
  13670. * Bits 14:9
  13671. * Value: 0x0
  13672. * - TXQ_GRP
  13673. * Bit 15
  13674. * Purpose: indicates whether any tx queue group information elements
  13675. * are appended to the tx credit update message
  13676. * Value: 0 -> no tx queue group information element is present
  13677. * 1 -> a tx queue group information element immediately follows
  13678. * - DELTA_COUNT
  13679. * Bits 31:16
  13680. * Purpose: Specify current htt credit delta absolute count
  13681. */
  13682. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13683. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13684. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13685. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13686. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13687. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13688. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13689. do { \
  13690. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13691. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13692. } while (0)
  13693. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13694. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13695. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13696. do { \
  13697. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13698. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13699. } while (0)
  13700. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13701. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13702. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13703. do { \
  13704. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13705. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13706. } while (0)
  13707. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13708. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13709. #define HTT_TX_CREDIT_MSG_BYTES 4
  13710. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13711. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13712. /**
  13713. * @brief HTT WDI_IPA Operation Response Message
  13714. *
  13715. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13716. *
  13717. * @details
  13718. * HTT WDI_IPA Operation Response message is sent by target
  13719. * to host confirming suspend or resume operation.
  13720. * |31 24|23 16|15 8|7 0|
  13721. * |----------------+----------------+----------------+----------------|
  13722. * | op_code | Rsvd | msg_type |
  13723. * |-------------------------------------------------------------------|
  13724. * | Rsvd | Response len |
  13725. * |-------------------------------------------------------------------|
  13726. * | |
  13727. * | Response-type specific info |
  13728. * | |
  13729. * | |
  13730. * |-------------------------------------------------------------------|
  13731. * Header fields:
  13732. * - MSG_TYPE
  13733. * Bits 7:0
  13734. * Purpose: Identifies this as WDI_IPA Operation Response message
  13735. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13736. * - OP_CODE
  13737. * Bits 31:16
  13738. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13739. * value: = enum htt_wdi_ipa_op_code
  13740. * - RSP_LEN
  13741. * Bits 16:0
  13742. * Purpose: length for the response-type specific info
  13743. * value: = length in bytes for response-type specific info
  13744. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13745. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13746. */
  13747. PREPACK struct htt_wdi_ipa_op_response_t
  13748. {
  13749. /* DWORD 0: flags and meta-data */
  13750. A_UINT32
  13751. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13752. reserved1: 8,
  13753. op_code: 16;
  13754. A_UINT32
  13755. rsp_len: 16,
  13756. reserved2: 16;
  13757. } POSTPACK;
  13758. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13759. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13760. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13761. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13762. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13763. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13764. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13765. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13766. do { \
  13767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13768. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13769. } while (0)
  13770. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13771. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13772. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13773. do { \
  13774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13775. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13776. } while (0)
  13777. enum htt_phy_mode {
  13778. htt_phy_mode_11a = 0,
  13779. htt_phy_mode_11g = 1,
  13780. htt_phy_mode_11b = 2,
  13781. htt_phy_mode_11g_only = 3,
  13782. htt_phy_mode_11na_ht20 = 4,
  13783. htt_phy_mode_11ng_ht20 = 5,
  13784. htt_phy_mode_11na_ht40 = 6,
  13785. htt_phy_mode_11ng_ht40 = 7,
  13786. htt_phy_mode_11ac_vht20 = 8,
  13787. htt_phy_mode_11ac_vht40 = 9,
  13788. htt_phy_mode_11ac_vht80 = 10,
  13789. htt_phy_mode_11ac_vht20_2g = 11,
  13790. htt_phy_mode_11ac_vht40_2g = 12,
  13791. htt_phy_mode_11ac_vht80_2g = 13,
  13792. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13793. htt_phy_mode_11ac_vht160 = 15,
  13794. htt_phy_mode_max,
  13795. };
  13796. /**
  13797. * @brief target -> host HTT channel change indication
  13798. *
  13799. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13800. *
  13801. * @details
  13802. * Specify when a channel change occurs.
  13803. * This allows the host to precisely determine which rx frames arrived
  13804. * on the old channel and which rx frames arrived on the new channel.
  13805. *
  13806. *|31 |7 0 |
  13807. *|-------------------------------------------+----------|
  13808. *| reserved | msg type |
  13809. *|------------------------------------------------------|
  13810. *| primary_chan_center_freq_mhz |
  13811. *|------------------------------------------------------|
  13812. *| contiguous_chan1_center_freq_mhz |
  13813. *|------------------------------------------------------|
  13814. *| contiguous_chan2_center_freq_mhz |
  13815. *|------------------------------------------------------|
  13816. *| phy_mode |
  13817. *|------------------------------------------------------|
  13818. *
  13819. * Header fields:
  13820. * - MSG_TYPE
  13821. * Bits 7:0
  13822. * Purpose: identifies this as a htt channel change indication message
  13823. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13824. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13825. * Bits 31:0
  13826. * Purpose: identify the (center of the) new 20 MHz primary channel
  13827. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13828. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13829. * Bits 31:0
  13830. * Purpose: identify the (center of the) contiguous frequency range
  13831. * comprising the new channel.
  13832. * For example, if the new channel is a 80 MHz channel extending
  13833. * 60 MHz beyond the primary channel, this field would be 30 larger
  13834. * than the primary channel center frequency field.
  13835. * Value: center frequency of the contiguous frequency range comprising
  13836. * the full channel in MHz units
  13837. * (80+80 channels also use the CONTIG_CHAN2 field)
  13838. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13839. * Bits 31:0
  13840. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13841. * within a VHT 80+80 channel.
  13842. * This field is only relevant for VHT 80+80 channels.
  13843. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13844. * channel (arbitrary value for cases besides VHT 80+80)
  13845. * - PHY_MODE
  13846. * Bits 31:0
  13847. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13848. * and band
  13849. * Value: htt_phy_mode enum value
  13850. */
  13851. PREPACK struct htt_chan_change_t
  13852. {
  13853. /* DWORD 0: flags and meta-data */
  13854. A_UINT32
  13855. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13856. reserved1: 24;
  13857. A_UINT32 primary_chan_center_freq_mhz;
  13858. A_UINT32 contig_chan1_center_freq_mhz;
  13859. A_UINT32 contig_chan2_center_freq_mhz;
  13860. A_UINT32 phy_mode;
  13861. } POSTPACK;
  13862. /*
  13863. * Due to historical / backwards-compatibility reasons, maintain the
  13864. * below htt_chan_change_msg struct definition, which needs to be
  13865. * consistent with the above htt_chan_change_t struct definition
  13866. * (aside from the htt_chan_change_t definition including the msg_type
  13867. * dword within the message, and the htt_chan_change_msg only containing
  13868. * the payload of the message that follows the msg_type dword).
  13869. */
  13870. PREPACK struct htt_chan_change_msg {
  13871. A_UINT32 chan_mhz; /* frequency in mhz */
  13872. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13873. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13874. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13875. } POSTPACK;
  13876. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13877. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13878. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13879. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13880. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13881. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13882. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13883. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13884. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13885. do { \
  13886. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13887. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13888. } while (0)
  13889. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13890. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13891. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13892. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13893. do { \
  13894. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13895. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13896. } while (0)
  13897. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13898. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13899. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13900. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13901. do { \
  13902. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13903. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13904. } while (0)
  13905. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13906. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13907. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13908. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13909. do { \
  13910. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13911. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13912. } while (0)
  13913. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13914. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13915. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13916. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13917. /**
  13918. * @brief rx offload packet error message
  13919. *
  13920. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13921. *
  13922. * @details
  13923. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13924. * of target payload like mic err.
  13925. *
  13926. * |31 24|23 16|15 8|7 0|
  13927. * |----------------+----------------+----------------+----------------|
  13928. * | tid | vdev_id | msg_sub_type | msg_type |
  13929. * |-------------------------------------------------------------------|
  13930. * : (sub-type dependent content) :
  13931. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13932. * Header fields:
  13933. * - msg_type
  13934. * Bits 7:0
  13935. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13936. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13937. * - msg_sub_type
  13938. * Bits 15:8
  13939. * Purpose: Identifies which type of rx error is reported by this message
  13940. * value: htt_rx_ofld_pkt_err_type
  13941. * - vdev_id
  13942. * Bits 23:16
  13943. * Purpose: Identifies which vdev received the erroneous rx frame
  13944. * value:
  13945. * - tid
  13946. * Bits 31:24
  13947. * Purpose: Identifies the traffic type of the rx frame
  13948. * value:
  13949. *
  13950. * - The payload fields used if the sub-type == MIC error are shown below.
  13951. * Note - MIC err is per MSDU, while PN is per MPDU.
  13952. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13953. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13954. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13955. * instead of sending separate HTT messages for each wrong MSDU within
  13956. * the MPDU.
  13957. *
  13958. * |31 24|23 16|15 8|7 0|
  13959. * |----------------+----------------+----------------+----------------|
  13960. * | Rsvd | key_id | peer_id |
  13961. * |-------------------------------------------------------------------|
  13962. * | receiver MAC addr 31:0 |
  13963. * |-------------------------------------------------------------------|
  13964. * | Rsvd | receiver MAC addr 47:32 |
  13965. * |-------------------------------------------------------------------|
  13966. * | transmitter MAC addr 31:0 |
  13967. * |-------------------------------------------------------------------|
  13968. * | Rsvd | transmitter MAC addr 47:32 |
  13969. * |-------------------------------------------------------------------|
  13970. * | PN 31:0 |
  13971. * |-------------------------------------------------------------------|
  13972. * | Rsvd | PN 47:32 |
  13973. * |-------------------------------------------------------------------|
  13974. * - peer_id
  13975. * Bits 15:0
  13976. * Purpose: identifies which peer is frame is from
  13977. * value:
  13978. * - key_id
  13979. * Bits 23:16
  13980. * Purpose: identifies key_id of rx frame
  13981. * value:
  13982. * - RA_31_0 (receiver MAC addr 31:0)
  13983. * Bits 31:0
  13984. * Purpose: identifies by MAC address which vdev received the frame
  13985. * value: MAC address lower 4 bytes
  13986. * - RA_47_32 (receiver MAC addr 47:32)
  13987. * Bits 15:0
  13988. * Purpose: identifies by MAC address which vdev received the frame
  13989. * value: MAC address upper 2 bytes
  13990. * - TA_31_0 (transmitter MAC addr 31:0)
  13991. * Bits 31:0
  13992. * Purpose: identifies by MAC address which peer transmitted the frame
  13993. * value: MAC address lower 4 bytes
  13994. * - TA_47_32 (transmitter MAC addr 47:32)
  13995. * Bits 15:0
  13996. * Purpose: identifies by MAC address which peer transmitted the frame
  13997. * value: MAC address upper 2 bytes
  13998. * - PN_31_0
  13999. * Bits 31:0
  14000. * Purpose: Identifies pn of rx frame
  14001. * value: PN lower 4 bytes
  14002. * - PN_47_32
  14003. * Bits 15:0
  14004. * Purpose: Identifies pn of rx frame
  14005. * value:
  14006. * TKIP or CCMP: PN upper 2 bytes
  14007. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14008. */
  14009. enum htt_rx_ofld_pkt_err_type {
  14010. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14011. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14012. };
  14013. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14014. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14015. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14016. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14017. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14018. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14019. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14020. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14021. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14022. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14023. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14024. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14025. do { \
  14026. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14027. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14028. } while (0)
  14029. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14030. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14031. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14032. do { \
  14033. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14034. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14035. } while (0)
  14036. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14037. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14038. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14039. do { \
  14040. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14041. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14042. } while (0)
  14043. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14044. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14045. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14046. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14047. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14048. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14049. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14050. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14051. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14052. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14053. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14055. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14056. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14058. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14060. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14062. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14063. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14065. do { \
  14066. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14067. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14068. } while (0)
  14069. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14070. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14071. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14072. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14073. do { \
  14074. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14075. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14076. } while (0)
  14077. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14078. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14079. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14080. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14081. do { \
  14082. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14083. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14084. } while (0)
  14085. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14086. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14087. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14088. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14089. do { \
  14090. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14091. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14092. } while (0)
  14093. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14094. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14095. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14096. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14097. do { \
  14098. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14099. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14100. } while (0)
  14101. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14102. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14103. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14104. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14105. do { \
  14106. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14107. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14108. } while (0)
  14109. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14110. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14111. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14112. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14113. do { \
  14114. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14115. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14116. } while (0)
  14117. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14118. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14119. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14120. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14121. do { \
  14122. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14123. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14124. } while (0)
  14125. /**
  14126. * @brief target -> host peer rate report message
  14127. *
  14128. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14129. *
  14130. * @details
  14131. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14132. * justified rate of all the peers.
  14133. *
  14134. * |31 24|23 16|15 8|7 0|
  14135. * |----------------+----------------+----------------+----------------|
  14136. * | peer_count | | msg_type |
  14137. * |-------------------------------------------------------------------|
  14138. * : Payload (variant number of peer rate report) :
  14139. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14140. * Header fields:
  14141. * - msg_type
  14142. * Bits 7:0
  14143. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14144. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14145. * - reserved
  14146. * Bits 15:8
  14147. * Purpose:
  14148. * value:
  14149. * - peer_count
  14150. * Bits 31:16
  14151. * Purpose: Specify how many peer rate report elements are present in the payload.
  14152. * value:
  14153. *
  14154. * Payload:
  14155. * There are variant number of peer rate report follow the first 32 bits.
  14156. * The peer rate report is defined as follows.
  14157. *
  14158. * |31 20|19 16|15 0|
  14159. * |-----------------------+---------+---------------------------------|-
  14160. * | reserved | phy | peer_id | \
  14161. * |-------------------------------------------------------------------| -> report #0
  14162. * | rate | /
  14163. * |-----------------------+---------+---------------------------------|-
  14164. * | reserved | phy | peer_id | \
  14165. * |-------------------------------------------------------------------| -> report #1
  14166. * | rate | /
  14167. * |-----------------------+---------+---------------------------------|-
  14168. * | reserved | phy | peer_id | \
  14169. * |-------------------------------------------------------------------| -> report #2
  14170. * | rate | /
  14171. * |-------------------------------------------------------------------|-
  14172. * : :
  14173. * : :
  14174. * : :
  14175. * :-------------------------------------------------------------------:
  14176. *
  14177. * - peer_id
  14178. * Bits 15:0
  14179. * Purpose: identify the peer
  14180. * value:
  14181. * - phy
  14182. * Bits 19:16
  14183. * Purpose: identify which phy is in use
  14184. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14185. * Please see enum htt_peer_report_phy_type for detail.
  14186. * - reserved
  14187. * Bits 31:20
  14188. * Purpose:
  14189. * value:
  14190. * - rate
  14191. * Bits 31:0
  14192. * Purpose: represent the justified rate of the peer specified by peer_id
  14193. * value:
  14194. */
  14195. enum htt_peer_rate_report_phy_type {
  14196. HTT_PEER_RATE_REPORT_11B = 0,
  14197. HTT_PEER_RATE_REPORT_11A_G,
  14198. HTT_PEER_RATE_REPORT_11N,
  14199. HTT_PEER_RATE_REPORT_11AC,
  14200. };
  14201. #define HTT_PEER_RATE_REPORT_SIZE 8
  14202. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14203. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14204. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14205. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14206. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14207. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14208. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14209. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14210. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14211. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14212. do { \
  14213. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14214. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14215. } while (0)
  14216. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14217. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14218. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14219. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14220. do { \
  14221. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14222. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14223. } while (0)
  14224. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14225. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14226. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14227. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14228. do { \
  14229. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14230. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14231. } while (0)
  14232. /**
  14233. * @brief target -> host flow pool map message
  14234. *
  14235. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14236. *
  14237. * @details
  14238. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14239. * a flow of descriptors.
  14240. *
  14241. * This message is in TLV format and indicates the parameters to be setup a
  14242. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14243. * receive descriptors from a specified pool.
  14244. *
  14245. * The message would appear as follows:
  14246. *
  14247. * |31 24|23 16|15 8|7 0|
  14248. * |----------------+----------------+----------------+----------------|
  14249. * header | reserved | num_flows | msg_type |
  14250. * |-------------------------------------------------------------------|
  14251. * | |
  14252. * : payload :
  14253. * | |
  14254. * |-------------------------------------------------------------------|
  14255. *
  14256. * The header field is one DWORD long and is interpreted as follows:
  14257. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14258. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14259. * this message
  14260. * b'16-31 - reserved: These bits are reserved for future use
  14261. *
  14262. * Payload:
  14263. * The payload would contain multiple objects of the following structure. Each
  14264. * object represents a flow.
  14265. *
  14266. * |31 24|23 16|15 8|7 0|
  14267. * |----------------+----------------+----------------+----------------|
  14268. * header | reserved | num_flows | msg_type |
  14269. * |-------------------------------------------------------------------|
  14270. * payload0| flow_type |
  14271. * |-------------------------------------------------------------------|
  14272. * | flow_id |
  14273. * |-------------------------------------------------------------------|
  14274. * | reserved0 | flow_pool_id |
  14275. * |-------------------------------------------------------------------|
  14276. * | reserved1 | flow_pool_size |
  14277. * |-------------------------------------------------------------------|
  14278. * | reserved2 |
  14279. * |-------------------------------------------------------------------|
  14280. * payload1| flow_type |
  14281. * |-------------------------------------------------------------------|
  14282. * | flow_id |
  14283. * |-------------------------------------------------------------------|
  14284. * | reserved0 | flow_pool_id |
  14285. * |-------------------------------------------------------------------|
  14286. * | reserved1 | flow_pool_size |
  14287. * |-------------------------------------------------------------------|
  14288. * | reserved2 |
  14289. * |-------------------------------------------------------------------|
  14290. * | . |
  14291. * | . |
  14292. * | . |
  14293. * |-------------------------------------------------------------------|
  14294. *
  14295. * Each payload is 5 DWORDS long and is interpreted as follows:
  14296. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14297. * this flow is associated. It can be VDEV, peer,
  14298. * or tid (AC). Based on enum htt_flow_type.
  14299. *
  14300. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14301. * object. For flow_type vdev it is set to the
  14302. * vdevid, for peer it is peerid and for tid, it is
  14303. * tid_num.
  14304. *
  14305. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14306. * in the host for this flow
  14307. * b'16:31 - reserved0: This field in reserved for the future. In case
  14308. * we have a hierarchical implementation (HCM) of
  14309. * pools, it can be used to indicate the ID of the
  14310. * parent-pool.
  14311. *
  14312. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14313. * Descriptors for this flow will be
  14314. * allocated from this pool in the host.
  14315. * b'16:31 - reserved1: This field in reserved for the future. In case
  14316. * we have a hierarchical implementation of pools,
  14317. * it can be used to indicate the max number of
  14318. * descriptors in the pool. The b'0:15 can be used
  14319. * to indicate min number of descriptors in the
  14320. * HCM scheme.
  14321. *
  14322. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14323. * we have a hierarchical implementation of pools,
  14324. * b'0:15 can be used to indicate the
  14325. * priority-based borrowing (PBB) threshold of
  14326. * the flow's pool. The b'16:31 are still left
  14327. * reserved.
  14328. */
  14329. enum htt_flow_type {
  14330. FLOW_TYPE_VDEV = 0,
  14331. /* Insert new flow types above this line */
  14332. };
  14333. PREPACK struct htt_flow_pool_map_payload_t {
  14334. A_UINT32 flow_type;
  14335. A_UINT32 flow_id;
  14336. A_UINT32 flow_pool_id:16,
  14337. reserved0:16;
  14338. A_UINT32 flow_pool_size:16,
  14339. reserved1:16;
  14340. A_UINT32 reserved2;
  14341. } POSTPACK;
  14342. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14343. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14344. (sizeof(struct htt_flow_pool_map_payload_t))
  14345. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14346. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14347. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14348. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14349. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14350. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14351. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14352. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14353. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14354. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14355. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14356. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14357. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14358. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14359. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14360. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14361. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14362. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14363. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14364. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14365. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14366. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14367. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14368. do { \
  14369. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14370. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14371. } while (0)
  14372. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14373. do { \
  14374. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14375. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14376. } while (0)
  14377. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14378. do { \
  14379. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14380. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14381. } while (0)
  14382. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14383. do { \
  14384. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14385. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14386. } while (0)
  14387. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14388. do { \
  14389. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14390. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14391. } while (0)
  14392. /**
  14393. * @brief target -> host flow pool unmap message
  14394. *
  14395. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14396. *
  14397. * @details
  14398. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14399. * down a flow of descriptors.
  14400. * This message indicates that for the flow (whose ID is provided) is wanting
  14401. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14402. * pool of descriptors from where descriptors are being allocated for this
  14403. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14404. * be unmapped by the host.
  14405. *
  14406. * The message would appear as follows:
  14407. *
  14408. * |31 24|23 16|15 8|7 0|
  14409. * |----------------+----------------+----------------+----------------|
  14410. * | reserved0 | msg_type |
  14411. * |-------------------------------------------------------------------|
  14412. * | flow_type |
  14413. * |-------------------------------------------------------------------|
  14414. * | flow_id |
  14415. * |-------------------------------------------------------------------|
  14416. * | reserved1 | flow_pool_id |
  14417. * |-------------------------------------------------------------------|
  14418. *
  14419. * The message is interpreted as follows:
  14420. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14421. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14422. * b'8:31 - reserved0: Reserved for future use
  14423. *
  14424. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14425. * this flow is associated. It can be VDEV, peer,
  14426. * or tid (AC). Based on enum htt_flow_type.
  14427. *
  14428. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14429. * object. For flow_type vdev it is set to the
  14430. * vdevid, for peer it is peerid and for tid, it is
  14431. * tid_num.
  14432. *
  14433. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14434. * used in the host for this flow
  14435. * b'16:31 - reserved0: This field in reserved for the future.
  14436. *
  14437. */
  14438. PREPACK struct htt_flow_pool_unmap_t {
  14439. A_UINT32 msg_type:8,
  14440. reserved0:24;
  14441. A_UINT32 flow_type;
  14442. A_UINT32 flow_id;
  14443. A_UINT32 flow_pool_id:16,
  14444. reserved1:16;
  14445. } POSTPACK;
  14446. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14447. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14448. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14449. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14450. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14451. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14452. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14453. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14454. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14455. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14456. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14457. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14458. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14459. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14460. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14461. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14462. do { \
  14463. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14464. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14465. } while (0)
  14466. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14467. do { \
  14468. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14469. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14470. } while (0)
  14471. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14472. do { \
  14473. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14474. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14475. } while (0)
  14476. /**
  14477. * @brief target -> host SRING setup done message
  14478. *
  14479. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14480. *
  14481. * @details
  14482. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14483. * SRNG ring setup is done
  14484. *
  14485. * This message indicates whether the last setup operation is successful.
  14486. * It will be sent to host when host set respose_required bit in
  14487. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14488. * The message would appear as follows:
  14489. *
  14490. * |31 24|23 16|15 8|7 0|
  14491. * |--------------- +----------------+----------------+----------------|
  14492. * | setup_status | ring_id | pdev_id | msg_type |
  14493. * |-------------------------------------------------------------------|
  14494. *
  14495. * The message is interpreted as follows:
  14496. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14497. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14498. * b'8:15 - pdev_id:
  14499. * 0 (for rings at SOC/UMAC level),
  14500. * 1/2/3 mac id (for rings at LMAC level)
  14501. * b'16:23 - ring_id: Identify the ring which is set up
  14502. * More details can be got from enum htt_srng_ring_id
  14503. * b'24:31 - setup_status: Indicate status of setup operation
  14504. * Refer to htt_ring_setup_status
  14505. */
  14506. PREPACK struct htt_sring_setup_done_t {
  14507. A_UINT32 msg_type: 8,
  14508. pdev_id: 8,
  14509. ring_id: 8,
  14510. setup_status: 8;
  14511. } POSTPACK;
  14512. enum htt_ring_setup_status {
  14513. htt_ring_setup_status_ok = 0,
  14514. htt_ring_setup_status_error,
  14515. };
  14516. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14517. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14518. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14519. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14520. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14521. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14522. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14523. do { \
  14524. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14525. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14526. } while (0)
  14527. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14528. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14529. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14530. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14531. HTT_SRING_SETUP_DONE_RING_ID_S)
  14532. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14533. do { \
  14534. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14535. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14536. } while (0)
  14537. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14538. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14539. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14540. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14541. HTT_SRING_SETUP_DONE_STATUS_S)
  14542. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14543. do { \
  14544. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14545. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14546. } while (0)
  14547. /**
  14548. * @brief target -> flow map flow info
  14549. *
  14550. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14551. *
  14552. * @details
  14553. * HTT TX map flow entry with tqm flow pointer
  14554. * Sent from firmware to host to add tqm flow pointer in corresponding
  14555. * flow search entry. Flow metadata is replayed back to host as part of this
  14556. * struct to enable host to find the specific flow search entry
  14557. *
  14558. * The message would appear as follows:
  14559. *
  14560. * |31 28|27 18|17 14|13 8|7 0|
  14561. * |-------+------------------------------------------+----------------|
  14562. * | rsvd0 | fse_hsh_idx | msg_type |
  14563. * |-------------------------------------------------------------------|
  14564. * | rsvd1 | tid | peer_id |
  14565. * |-------------------------------------------------------------------|
  14566. * | tqm_flow_pntr_lo |
  14567. * |-------------------------------------------------------------------|
  14568. * | tqm_flow_pntr_hi |
  14569. * |-------------------------------------------------------------------|
  14570. * | fse_meta_data |
  14571. * |-------------------------------------------------------------------|
  14572. *
  14573. * The message is interpreted as follows:
  14574. *
  14575. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14576. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14577. *
  14578. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14579. * for this flow entry
  14580. *
  14581. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14582. *
  14583. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14584. *
  14585. * dword1 - b'14:17 - tid
  14586. *
  14587. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14588. *
  14589. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14590. *
  14591. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14592. *
  14593. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14594. * given by host
  14595. */
  14596. PREPACK struct htt_tx_map_flow_info {
  14597. A_UINT32
  14598. msg_type: 8,
  14599. fse_hsh_idx: 20,
  14600. rsvd0: 4;
  14601. A_UINT32
  14602. peer_id: 14,
  14603. tid: 4,
  14604. rsvd1: 14;
  14605. A_UINT32 tqm_flow_pntr_lo;
  14606. A_UINT32 tqm_flow_pntr_hi;
  14607. struct htt_tx_flow_metadata fse_meta_data;
  14608. } POSTPACK;
  14609. /* DWORD 0 */
  14610. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14611. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14612. /* DWORD 1 */
  14613. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14614. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14615. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14616. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14617. /* DWORD 0 */
  14618. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14619. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14620. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14621. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14622. do { \
  14623. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14624. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14625. } while (0)
  14626. /* DWORD 1 */
  14627. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14628. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14629. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14630. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14631. do { \
  14632. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14633. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14634. } while (0)
  14635. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14636. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14637. HTT_TX_MAP_FLOW_INFO_TID_S)
  14638. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14639. do { \
  14640. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14641. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14642. } while (0)
  14643. /*
  14644. * htt_dbg_ext_stats_status -
  14645. * present - The requested stats have been delivered in full.
  14646. * This indicates that either the stats information was contained
  14647. * in its entirety within this message, or else this message
  14648. * completes the delivery of the requested stats info that was
  14649. * partially delivered through earlier STATS_CONF messages.
  14650. * partial - The requested stats have been delivered in part.
  14651. * One or more subsequent STATS_CONF messages with the same
  14652. * cookie value will be sent to deliver the remainder of the
  14653. * information.
  14654. * error - The requested stats could not be delivered, for example due
  14655. * to a shortage of memory to construct a message holding the
  14656. * requested stats.
  14657. * invalid - The requested stat type is either not recognized, or the
  14658. * target is configured to not gather the stats type in question.
  14659. */
  14660. enum htt_dbg_ext_stats_status {
  14661. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14662. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14663. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14664. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14665. };
  14666. /**
  14667. * @brief target -> host ppdu stats upload
  14668. *
  14669. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14670. *
  14671. * @details
  14672. * The following field definitions describe the format of the HTT target
  14673. * to host ppdu stats indication message.
  14674. *
  14675. *
  14676. * |31 16|15 12|11 10|9 8|7 0 |
  14677. * |----------------------------------------------------------------------|
  14678. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14679. * |----------------------------------------------------------------------|
  14680. * | ppdu_id |
  14681. * |----------------------------------------------------------------------|
  14682. * | Timestamp in us |
  14683. * |----------------------------------------------------------------------|
  14684. * | reserved |
  14685. * |----------------------------------------------------------------------|
  14686. * | type-specific stats info |
  14687. * | (see htt_ppdu_stats.h) |
  14688. * |----------------------------------------------------------------------|
  14689. * Header fields:
  14690. * - MSG_TYPE
  14691. * Bits 7:0
  14692. * Purpose: Identifies this is a PPDU STATS indication
  14693. * message.
  14694. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14695. * - mac_id
  14696. * Bits 9:8
  14697. * Purpose: mac_id of this ppdu_id
  14698. * Value: 0-3
  14699. * - pdev_id
  14700. * Bits 11:10
  14701. * Purpose: pdev_id of this ppdu_id
  14702. * Value: 0-3
  14703. * 0 (for rings at SOC level),
  14704. * 1/2/3 PDEV -> 0/1/2
  14705. * - payload_size
  14706. * Bits 31:16
  14707. * Purpose: total tlv size
  14708. * Value: payload_size in bytes
  14709. */
  14710. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14711. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14712. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14713. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14714. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14715. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14716. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14717. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14718. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14719. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14720. do { \
  14721. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14722. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14723. } while (0)
  14724. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14725. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14726. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14727. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14728. do { \
  14729. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14730. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14731. } while (0)
  14732. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14733. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14734. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14735. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14736. do { \
  14737. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14738. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14739. } while (0)
  14740. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14741. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14742. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14743. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14744. do { \
  14745. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14746. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14747. } while (0)
  14748. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14749. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14750. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14751. /* htt_t2h_ppdu_stats_ind_hdr_t
  14752. * This struct contains the fields within the header of the
  14753. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14754. * stats info.
  14755. * This struct assumes little-endian layout, and thus is only
  14756. * suitable for use within processors known to be little-endian
  14757. * (such as the target).
  14758. * In contrast, the above macros provide endian-portable methods
  14759. * to get and set the bitfields within this PPDU_STATS_IND header.
  14760. */
  14761. typedef struct {
  14762. A_UINT32 msg_type: 8, /* bits 7:0 */
  14763. mac_id: 2, /* bits 9:8 */
  14764. pdev_id: 2, /* bits 11:10 */
  14765. reserved1: 4, /* bits 15:12 */
  14766. payload_size: 16; /* bits 31:16 */
  14767. A_UINT32 ppdu_id;
  14768. A_UINT32 timestamp_us;
  14769. A_UINT32 reserved2;
  14770. } htt_t2h_ppdu_stats_ind_hdr_t;
  14771. /**
  14772. * @brief target -> host extended statistics upload
  14773. *
  14774. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14775. *
  14776. * @details
  14777. * The following field definitions describe the format of the HTT target
  14778. * to host stats upload confirmation message.
  14779. * The message contains a cookie echoed from the HTT host->target stats
  14780. * upload request, which identifies which request the confirmation is
  14781. * for, and a single stats can span over multiple HTT stats indication
  14782. * due to the HTT message size limitation so every HTT ext stats indication
  14783. * will have tag-length-value stats information elements.
  14784. * The tag-length header for each HTT stats IND message also includes a
  14785. * status field, to indicate whether the request for the stat type in
  14786. * question was fully met, partially met, unable to be met, or invalid
  14787. * (if the stat type in question is disabled in the target).
  14788. * A Done bit 1's indicate the end of the of stats info elements.
  14789. *
  14790. *
  14791. * |31 16|15 12|11|10 8|7 5|4 0|
  14792. * |--------------------------------------------------------------|
  14793. * | reserved | msg type |
  14794. * |--------------------------------------------------------------|
  14795. * | cookie LSBs |
  14796. * |--------------------------------------------------------------|
  14797. * | cookie MSBs |
  14798. * |--------------------------------------------------------------|
  14799. * | stats entry length | rsvd | D| S | stat type |
  14800. * |--------------------------------------------------------------|
  14801. * | type-specific stats info |
  14802. * | (see htt_stats.h) |
  14803. * |--------------------------------------------------------------|
  14804. * Header fields:
  14805. * - MSG_TYPE
  14806. * Bits 7:0
  14807. * Purpose: Identifies this is a extended statistics upload confirmation
  14808. * message.
  14809. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14810. * - COOKIE_LSBS
  14811. * Bits 31:0
  14812. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14813. * message with its preceding host->target stats request message.
  14814. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14815. * - COOKIE_MSBS
  14816. * Bits 31:0
  14817. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14818. * message with its preceding host->target stats request message.
  14819. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14820. *
  14821. * Stats Information Element tag-length header fields:
  14822. * - STAT_TYPE
  14823. * Bits 7:0
  14824. * Purpose: identifies the type of statistics info held in the
  14825. * following information element
  14826. * Value: htt_dbg_ext_stats_type
  14827. * - STATUS
  14828. * Bits 10:8
  14829. * Purpose: indicate whether the requested stats are present
  14830. * Value: htt_dbg_ext_stats_status
  14831. * - DONE
  14832. * Bits 11
  14833. * Purpose:
  14834. * Indicates the completion of the stats entry, this will be the last
  14835. * stats conf HTT segment for the requested stats type.
  14836. * Value:
  14837. * 0 -> the stats retrieval is ongoing
  14838. * 1 -> the stats retrieval is complete
  14839. * - LENGTH
  14840. * Bits 31:16
  14841. * Purpose: indicate the stats information size
  14842. * Value: This field specifies the number of bytes of stats information
  14843. * that follows the element tag-length header.
  14844. * It is expected but not required that this length is a multiple of
  14845. * 4 bytes.
  14846. */
  14847. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14848. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14849. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14850. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14851. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14852. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14853. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14854. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14855. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14856. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14857. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14858. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14859. do { \
  14860. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14861. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14862. } while (0)
  14863. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14864. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14865. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14866. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14867. do { \
  14868. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14869. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14870. } while (0)
  14871. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14872. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14873. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14874. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14875. do { \
  14876. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14877. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14878. } while (0)
  14879. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14880. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14881. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14882. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14883. do { \
  14884. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14885. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14886. } while (0)
  14887. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14888. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14889. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14890. /**
  14891. * @brief target -> host streaming statistics upload
  14892. *
  14893. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14894. *
  14895. * @details
  14896. * The following field definitions describe the format of the HTT target
  14897. * to host streaming stats upload indication message.
  14898. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14899. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14900. * use the STREAMING_STATS_REQ message to halt the target's production of
  14901. * STREAMING_STATS_IND messages.
  14902. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14903. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14904. *
  14905. * |31 8|7 0|
  14906. * |--------------------------------------------------------------|
  14907. * | reserved | msg type |
  14908. * |--------------------------------------------------------------|
  14909. * | type-specific stats info |
  14910. * | (see htt_stats.h) |
  14911. * |--------------------------------------------------------------|
  14912. * Header fields:
  14913. * - MSG_TYPE
  14914. * Bits 7:0
  14915. * Purpose: Identifies this as a streaming statistics upload indication
  14916. * message.
  14917. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14918. */
  14919. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14920. typedef enum {
  14921. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14922. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14923. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14924. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14925. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14926. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14927. /* Reserved from 128 - 255 for target internal use.*/
  14928. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14929. } HTT_PEER_TYPE;
  14930. /** macro to convert MAC address from char array to HTT word format */
  14931. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14932. (phtt_mac_addr)->mac_addr31to0 = \
  14933. (((c_macaddr)[0] << 0) | \
  14934. ((c_macaddr)[1] << 8) | \
  14935. ((c_macaddr)[2] << 16) | \
  14936. ((c_macaddr)[3] << 24)); \
  14937. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14938. } while (0)
  14939. /**
  14940. * @brief target -> host monitor mac header indication message
  14941. *
  14942. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14943. *
  14944. * @details
  14945. * The following diagram shows the format of the monitor mac header message
  14946. * sent from the target to the host.
  14947. * This message is primarily sent when promiscuous rx mode is enabled.
  14948. * One message is sent per rx PPDU.
  14949. *
  14950. * |31 24|23 16|15 8|7 0|
  14951. * |-------------------------------------------------------------|
  14952. * | peer_id | reserved0 | msg_type |
  14953. * |-------------------------------------------------------------|
  14954. * | reserved1 | num_mpdu |
  14955. * |-------------------------------------------------------------|
  14956. * | struct hw_rx_desc |
  14957. * | (see wal_rx_desc.h) |
  14958. * |-------------------------------------------------------------|
  14959. * | struct ieee80211_frame_addr4 |
  14960. * | (see ieee80211_defs.h) |
  14961. * |-------------------------------------------------------------|
  14962. * | struct ieee80211_frame_addr4 |
  14963. * | (see ieee80211_defs.h) |
  14964. * |-------------------------------------------------------------|
  14965. * | ...... |
  14966. * |-------------------------------------------------------------|
  14967. *
  14968. * Header fields:
  14969. * - msg_type
  14970. * Bits 7:0
  14971. * Purpose: Identifies this is a monitor mac header indication message.
  14972. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14973. * - peer_id
  14974. * Bits 31:16
  14975. * Purpose: Software peer id given by host during association,
  14976. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14977. * for rx PPDUs received from unassociated peers.
  14978. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14979. * - num_mpdu
  14980. * Bits 15:0
  14981. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14982. * delivered within the message.
  14983. * Value: 1 to 32
  14984. * num_mpdu is limited to a maximum value of 32, due to buffer
  14985. * size limits. For PPDUs with more than 32 MPDUs, only the
  14986. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14987. * the PPDU will be provided.
  14988. */
  14989. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14990. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14991. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14992. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14993. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14994. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14995. do { \
  14996. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14997. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14998. } while (0)
  14999. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15000. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15001. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15002. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15003. do { \
  15004. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15005. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15006. } while (0)
  15007. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15008. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15009. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15010. /**
  15011. * @brief target -> host flow pool resize Message
  15012. *
  15013. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15014. *
  15015. * @details
  15016. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15017. * the flow pool associated with the specified ID is resized
  15018. *
  15019. * The message would appear as follows:
  15020. *
  15021. * |31 16|15 8|7 0|
  15022. * |---------------------------------+----------------+----------------|
  15023. * | reserved0 | Msg type |
  15024. * |-------------------------------------------------------------------|
  15025. * | flow pool new size | flow pool ID |
  15026. * |-------------------------------------------------------------------|
  15027. *
  15028. * The message is interpreted as follows:
  15029. * b'0:7 - msg_type: This will be set to 0x21
  15030. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15031. *
  15032. * b'0:15 - flow pool ID: Existing flow pool ID
  15033. *
  15034. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15035. *
  15036. */
  15037. PREPACK struct htt_flow_pool_resize_t {
  15038. A_UINT32 msg_type:8,
  15039. reserved0:24;
  15040. A_UINT32 flow_pool_id:16,
  15041. flow_pool_new_size:16;
  15042. } POSTPACK;
  15043. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15044. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15045. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15046. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15047. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15048. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15049. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15050. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15051. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15052. do { \
  15053. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15054. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15055. } while (0)
  15056. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15057. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15058. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15059. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15060. do { \
  15061. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15062. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15063. } while (0)
  15064. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15065. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15066. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15067. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15068. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15069. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15070. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15071. /*
  15072. * The read and write indices point to the data within the host buffer.
  15073. * Because the first 4 bytes of the host buffer is used for the read index and
  15074. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15075. * The read index and write index are the byte offsets from the base of the
  15076. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15077. * Refer the ASCII text picture below.
  15078. */
  15079. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15080. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15081. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15082. /*
  15083. ***************************************************************************
  15084. *
  15085. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15086. *
  15087. ***************************************************************************
  15088. *
  15089. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15090. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15091. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15092. * written into the Host memory region mentioned below.
  15093. *
  15094. * Read index is updated by the Host. At any point of time, the read index will
  15095. * indicate the index that will next be read by the Host. The read index is
  15096. * in units of bytes offset from the base of the meta-data buffer.
  15097. *
  15098. * Write index is updated by the FW. At any point of time, the write index will
  15099. * indicate from where the FW can start writing any new data. The write index is
  15100. * in units of bytes offset from the base of the meta-data buffer.
  15101. *
  15102. * If the Host is not fast enough in reading the CFR data, any new capture data
  15103. * would be dropped if there is no space left to write the new captures.
  15104. *
  15105. * The last 4 bytes of the memory region will have the magic pattern
  15106. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15107. * not overrun the host buffer.
  15108. *
  15109. * ,--------------------. read and write indices store the
  15110. * | | byte offset from the base of the
  15111. * | ,--------+--------. meta-data buffer to the next
  15112. * | | | | location within the data buffer
  15113. * | | v v that will be read / written
  15114. * ************************************************************************
  15115. * * Read * Write * * Magic *
  15116. * * index * index * CFR data1 ...... CFR data N * pattern *
  15117. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15118. * ************************************************************************
  15119. * |<---------- data buffer ---------->|
  15120. *
  15121. * |<----------------- meta-data buffer allocated in Host ----------------|
  15122. *
  15123. * Note:
  15124. * - Considering the 4 bytes needed to store the Read index (R) and the
  15125. * Write index (W), the initial value is as follows:
  15126. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15127. * - Buffer empty condition:
  15128. * R = W
  15129. *
  15130. * Regarding CFR data format:
  15131. * --------------------------
  15132. *
  15133. * Each CFR tone is stored in HW as 16-bits with the following format:
  15134. * {bits[15:12], bits[11:6], bits[5:0]} =
  15135. * {unsigned exponent (4 bits),
  15136. * signed mantissa_real (6 bits),
  15137. * signed mantissa_imag (6 bits)}
  15138. *
  15139. * CFR_real = mantissa_real * 2^(exponent-5)
  15140. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15141. *
  15142. *
  15143. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15144. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15145. *
  15146. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15147. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15148. * .
  15149. * .
  15150. * .
  15151. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15152. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15153. */
  15154. /* Bandwidth of peer CFR captures */
  15155. typedef enum {
  15156. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15157. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15158. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15159. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15160. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15161. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15162. } HTT_PEER_CFR_CAPTURE_BW;
  15163. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15164. * was captured
  15165. */
  15166. typedef enum {
  15167. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15168. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15169. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15170. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15171. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15172. } HTT_PEER_CFR_CAPTURE_MODE;
  15173. typedef enum {
  15174. /* This message type is currently used for the below purpose:
  15175. *
  15176. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15177. * wmi_peer_cfr_capture_cmd.
  15178. * If payload_present bit is set to 0 then the associated memory region
  15179. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15180. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15181. * message; the CFR dump will be present at the end of the message,
  15182. * after the chan_phy_mode.
  15183. */
  15184. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15185. /* Always keep this last */
  15186. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15187. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15188. /**
  15189. * @brief target -> host CFR dump completion indication message definition
  15190. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15191. *
  15192. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15193. *
  15194. * @details
  15195. * The following diagram shows the format of the Channel Frequency Response
  15196. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15197. * the channel capture of a peer is copied by Firmware into the Host memory
  15198. *
  15199. * **************************************************************************
  15200. *
  15201. * Message format when the CFR capture message type is
  15202. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15203. *
  15204. * **************************************************************************
  15205. *
  15206. * |31 16|15 |8|7 0|
  15207. * |----------------------------------------------------------------|
  15208. * header: | reserved |P| msg_type |
  15209. * word 0 | | | |
  15210. * |----------------------------------------------------------------|
  15211. * payload: | cfr_capture_msg_type |
  15212. * word 1 | |
  15213. * |----------------------------------------------------------------|
  15214. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15215. * word 2 | | | | | | | | |
  15216. * |----------------------------------------------------------------|
  15217. * | mac_addr31to0 |
  15218. * word 3 | |
  15219. * |----------------------------------------------------------------|
  15220. * | unused / reserved | mac_addr47to32 |
  15221. * word 4 | | |
  15222. * |----------------------------------------------------------------|
  15223. * | index |
  15224. * word 5 | |
  15225. * |----------------------------------------------------------------|
  15226. * | length |
  15227. * word 6 | |
  15228. * |----------------------------------------------------------------|
  15229. * | timestamp |
  15230. * word 7 | |
  15231. * |----------------------------------------------------------------|
  15232. * | counter |
  15233. * word 8 | |
  15234. * |----------------------------------------------------------------|
  15235. * | chan_mhz |
  15236. * word 9 | |
  15237. * |----------------------------------------------------------------|
  15238. * | band_center_freq1 |
  15239. * word 10 | |
  15240. * |----------------------------------------------------------------|
  15241. * | band_center_freq2 |
  15242. * word 11 | |
  15243. * |----------------------------------------------------------------|
  15244. * | chan_phy_mode |
  15245. * word 12 | |
  15246. * |----------------------------------------------------------------|
  15247. * where,
  15248. * P - payload present bit (payload_present explained below)
  15249. * req_id - memory request id (mem_req_id explained below)
  15250. * S - status field (status explained below)
  15251. * capbw - capture bandwidth (capture_bw explained below)
  15252. * mode - mode of capture (mode explained below)
  15253. * sts - space time streams (sts_count explained below)
  15254. * chbw - channel bandwidth (channel_bw explained below)
  15255. * captype - capture type (cap_type explained below)
  15256. *
  15257. * The following field definitions describe the format of the CFR dump
  15258. * completion indication sent from the target to the host
  15259. *
  15260. * Header fields:
  15261. *
  15262. * Word 0
  15263. * - msg_type
  15264. * Bits 7:0
  15265. * Purpose: Identifies this as CFR TX completion indication
  15266. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15267. * - payload_present
  15268. * Bit 8
  15269. * Purpose: Identifies how CFR data is sent to host
  15270. * Value: 0 - If CFR Payload is written to host memory
  15271. * 1 - If CFR Payload is sent as part of HTT message
  15272. * (This is the requirement for SDIO/USB where it is
  15273. * not possible to write CFR data to host memory)
  15274. * - reserved
  15275. * Bits 31:9
  15276. * Purpose: Reserved
  15277. * Value: 0
  15278. *
  15279. * Payload fields:
  15280. *
  15281. * Word 1
  15282. * - cfr_capture_msg_type
  15283. * Bits 31:0
  15284. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15285. * to specify the format used for the remainder of the message
  15286. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15287. * (currently only MSG_TYPE_1 is defined)
  15288. *
  15289. * Word 2
  15290. * - mem_req_id
  15291. * Bits 6:0
  15292. * Purpose: Contain the mem request id of the region where the CFR capture
  15293. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15294. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15295. this value is invalid)
  15296. * - status
  15297. * Bit 7
  15298. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15299. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15300. * - capture_bw
  15301. * Bits 10:8
  15302. * Purpose: Carry the bandwidth of the CFR capture
  15303. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15304. * - mode
  15305. * Bits 13:11
  15306. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15307. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15308. * - sts_count
  15309. * Bits 16:14
  15310. * Purpose: Carry the number of space time streams
  15311. * Value: Number of space time streams
  15312. * - channel_bw
  15313. * Bits 19:17
  15314. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15315. * measurement
  15316. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15317. * - cap_type
  15318. * Bits 23:20
  15319. * Purpose: Carry the type of the capture
  15320. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15321. * - vdev_id
  15322. * Bits 31:24
  15323. * Purpose: Carry the virtual device id
  15324. * Value: vdev ID
  15325. *
  15326. * Word 3
  15327. * - mac_addr31to0
  15328. * Bits 31:0
  15329. * Purpose: Contain the bits 31:0 of the peer MAC address
  15330. * Value: Bits 31:0 of the peer MAC address
  15331. *
  15332. * Word 4
  15333. * - mac_addr47to32
  15334. * Bits 15:0
  15335. * Purpose: Contain the bits 47:32 of the peer MAC address
  15336. * Value: Bits 47:32 of the peer MAC address
  15337. *
  15338. * Word 5
  15339. * - index
  15340. * Bits 31:0
  15341. * Purpose: Contain the index at which this CFR dump was written in the Host
  15342. * allocated memory. This index is the number of bytes from the base address.
  15343. * Value: Index position
  15344. *
  15345. * Word 6
  15346. * - length
  15347. * Bits 31:0
  15348. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15349. * Value: Length of the CFR capture of the peer
  15350. *
  15351. * Word 7
  15352. * - timestamp
  15353. * Bits 31:0
  15354. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15355. * clock used for this timestamp is private to the target and not visible to
  15356. * the host i.e., Host can interpret only the relative timestamp deltas from
  15357. * one message to the next, but can't interpret the absolute timestamp from a
  15358. * single message.
  15359. * Value: Timestamp in microseconds
  15360. *
  15361. * Word 8
  15362. * - counter
  15363. * Bits 31:0
  15364. * Purpose: Carry the count of the current CFR capture from FW. This is
  15365. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15366. * in host memory)
  15367. * Value: Count of the current CFR capture
  15368. *
  15369. * Word 9
  15370. * - chan_mhz
  15371. * Bits 31:0
  15372. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15373. * Value: Primary 20 channel frequency
  15374. *
  15375. * Word 10
  15376. * - band_center_freq1
  15377. * Bits 31:0
  15378. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15379. * Value: Center frequency 1 in MHz
  15380. *
  15381. * Word 11
  15382. * - band_center_freq2
  15383. * Bits 31:0
  15384. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15385. * the VDEV
  15386. * 80plus80 mode
  15387. * Value: Center frequency 2 in MHz
  15388. *
  15389. * Word 12
  15390. * - chan_phy_mode
  15391. * Bits 31:0
  15392. * Purpose: Carry the phy mode of the channel, of the VDEV
  15393. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15394. */
  15395. PREPACK struct htt_cfr_dump_ind_type_1 {
  15396. A_UINT32 mem_req_id:7,
  15397. status:1,
  15398. capture_bw:3,
  15399. mode:3,
  15400. sts_count:3,
  15401. channel_bw:3,
  15402. cap_type:4,
  15403. vdev_id:8;
  15404. htt_mac_addr addr;
  15405. A_UINT32 index;
  15406. A_UINT32 length;
  15407. A_UINT32 timestamp;
  15408. A_UINT32 counter;
  15409. struct htt_chan_change_msg chan;
  15410. } POSTPACK;
  15411. PREPACK struct htt_cfr_dump_compl_ind {
  15412. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15413. union {
  15414. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15415. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15416. /* If there is a need to change the memory layout and its associated
  15417. * HTT indication format, a new CFR capture message type can be
  15418. * introduced and added into this union.
  15419. */
  15420. };
  15421. } POSTPACK;
  15422. /*
  15423. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15424. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15425. */
  15426. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15427. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15428. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15429. do { \
  15430. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15431. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15432. } while(0)
  15433. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15434. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15435. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15436. /*
  15437. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15438. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15439. */
  15440. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15441. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15442. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15443. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15444. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15445. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15446. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15447. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15448. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15449. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15450. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15451. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15452. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15453. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15454. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15455. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15456. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15457. do { \
  15458. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15459. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15460. } while (0)
  15461. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15462. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15463. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15464. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15465. do { \
  15466. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15467. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15468. } while (0)
  15469. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15470. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15471. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15472. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15473. do { \
  15474. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15475. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15476. } while (0)
  15477. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15478. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15479. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15480. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15481. do { \
  15482. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15483. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15484. } while (0)
  15485. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15486. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15487. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15488. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15489. do { \
  15490. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15491. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15492. } while (0)
  15493. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15494. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15495. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15496. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15497. do { \
  15498. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15499. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15500. } while (0)
  15501. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15502. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15503. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15504. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15505. do { \
  15506. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15507. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15508. } while (0)
  15509. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15510. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15511. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15512. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15513. do { \
  15514. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15515. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15516. } while (0)
  15517. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15518. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15519. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15520. /**
  15521. * @brief target -> host peer (PPDU) stats message
  15522. *
  15523. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15524. *
  15525. * @details
  15526. * This message is generated by FW when FW is sending stats to host
  15527. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15528. * This message is sent autonomously by the target rather than upon request
  15529. * by the host.
  15530. * The following field definitions describe the format of the HTT target
  15531. * to host peer stats indication message.
  15532. *
  15533. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15534. * or more PPDU stats records.
  15535. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15536. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15537. * then the message would start with the
  15538. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15539. * below.
  15540. *
  15541. * |31 16|15|14|13 11|10 9|8|7 0|
  15542. * |-------------------------------------------------------------|
  15543. * | reserved |MSG_TYPE |
  15544. * |-------------------------------------------------------------|
  15545. * rec 0 | TLV header |
  15546. * rec 0 |-------------------------------------------------------------|
  15547. * rec 0 | ppdu successful bytes |
  15548. * rec 0 |-------------------------------------------------------------|
  15549. * rec 0 | ppdu retry bytes |
  15550. * rec 0 |-------------------------------------------------------------|
  15551. * rec 0 | ppdu failed bytes |
  15552. * rec 0 |-------------------------------------------------------------|
  15553. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15554. * rec 0 |-------------------------------------------------------------|
  15555. * rec 0 | retried MSDUs | successful MSDUs |
  15556. * rec 0 |-------------------------------------------------------------|
  15557. * rec 0 | TX duration | failed MSDUs |
  15558. * rec 0 |-------------------------------------------------------------|
  15559. * ...
  15560. * |-------------------------------------------------------------|
  15561. * rec N | TLV header |
  15562. * rec N |-------------------------------------------------------------|
  15563. * rec N | ppdu successful bytes |
  15564. * rec N |-------------------------------------------------------------|
  15565. * rec N | ppdu retry bytes |
  15566. * rec N |-------------------------------------------------------------|
  15567. * rec N | ppdu failed bytes |
  15568. * rec N |-------------------------------------------------------------|
  15569. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15570. * rec N |-------------------------------------------------------------|
  15571. * rec N | retried MSDUs | successful MSDUs |
  15572. * rec N |-------------------------------------------------------------|
  15573. * rec N | TX duration | failed MSDUs |
  15574. * rec N |-------------------------------------------------------------|
  15575. *
  15576. * where:
  15577. * A = is A-MPDU flag
  15578. * BA = block-ack failure flags
  15579. * BW = bandwidth spec
  15580. * SG = SGI enabled spec
  15581. * S = skipped rate ctrl
  15582. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15583. *
  15584. * Header
  15585. * ------
  15586. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15587. * dword0 - b'8:31 - reserved : Reserved for future use
  15588. *
  15589. * payload include below peer_stats information
  15590. * --------------------------------------------
  15591. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15592. * @tx_success_bytes : total successful bytes in the PPDU.
  15593. * @tx_retry_bytes : total retried bytes in the PPDU.
  15594. * @tx_failed_bytes : total failed bytes in the PPDU.
  15595. * @tx_ratecode : rate code used for the PPDU.
  15596. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15597. * @ba_ack_failed : BA/ACK failed for this PPDU
  15598. * b00 -> BA received
  15599. * b01 -> BA failed once
  15600. * b10 -> BA failed twice, when HW retry is enabled.
  15601. * @bw : BW
  15602. * b00 -> 20 MHz
  15603. * b01 -> 40 MHz
  15604. * b10 -> 80 MHz
  15605. * b11 -> 160 MHz (or 80+80)
  15606. * @sg : SGI enabled
  15607. * @s : skipped ratectrl
  15608. * @peer_id : peer id
  15609. * @tx_success_msdus : successful MSDUs
  15610. * @tx_retry_msdus : retried MSDUs
  15611. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15612. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15613. */
  15614. /**
  15615. * @brief target -> host backpressure event
  15616. *
  15617. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15618. *
  15619. * @details
  15620. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15621. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15622. * This message will only be sent if the backpressure condition has existed
  15623. * continuously for an initial period (100 ms).
  15624. * Repeat messages with updated information will be sent after each
  15625. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15626. * This message indicates the ring id along with current head and tail index
  15627. * locations (i.e. write and read indices).
  15628. * The backpressure time indicates the time in ms for which continous
  15629. * backpressure has been observed in the ring.
  15630. *
  15631. * The message format is as follows:
  15632. *
  15633. * |31 24|23 16|15 8|7 0|
  15634. * |----------------+----------------+----------------+----------------|
  15635. * | ring_id | ring_type | pdev_id | msg_type |
  15636. * |-------------------------------------------------------------------|
  15637. * | tail_idx | head_idx |
  15638. * |-------------------------------------------------------------------|
  15639. * | backpressure_time_ms |
  15640. * |-------------------------------------------------------------------|
  15641. *
  15642. * The message is interpreted as follows:
  15643. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15644. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15645. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15646. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15647. the msg is for LMAC ring.
  15648. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15649. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15650. * htt_backpressure_lmac_ring_id. This represents
  15651. * the ring id for which continous backpressure is seen
  15652. *
  15653. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15654. * the ring indicated by the ring_id
  15655. *
  15656. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15657. * the ring indicated by the ring id
  15658. *
  15659. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15660. * backpressure has been seen in the ring
  15661. * indicated by the ring_id.
  15662. * Units = milliseconds
  15663. */
  15664. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15665. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15666. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15667. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15668. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15669. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15670. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15671. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15672. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15673. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15674. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15675. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15676. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15677. do { \
  15678. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15679. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15680. } while (0)
  15681. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15682. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15683. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15684. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15685. do { \
  15686. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15687. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15688. } while (0)
  15689. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15690. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15691. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15692. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15693. do { \
  15694. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15695. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15696. } while (0)
  15697. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15698. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15699. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15700. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15701. do { \
  15702. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15703. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15704. } while (0)
  15705. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15706. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15707. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15708. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15709. do { \
  15710. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15711. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15712. } while (0)
  15713. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15714. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15715. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15716. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15717. do { \
  15718. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15719. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15720. } while (0)
  15721. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15722. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15723. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15724. enum htt_backpressure_ring_type {
  15725. HTT_SW_RING_TYPE_UMAC,
  15726. HTT_SW_RING_TYPE_LMAC,
  15727. HTT_SW_RING_TYPE_MAX,
  15728. };
  15729. /* Ring id for which the message is sent to host */
  15730. enum htt_backpressure_umac_ringid {
  15731. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15732. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15733. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15734. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15735. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15736. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15737. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15738. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15739. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15740. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15741. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15742. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15743. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15744. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15745. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15746. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15747. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15748. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15749. HTT_SW_UMAC_RING_IDX_MAX,
  15750. };
  15751. enum htt_backpressure_lmac_ringid {
  15752. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15753. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15754. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15755. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15756. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15757. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15758. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15759. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15760. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15761. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15762. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15763. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15764. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15765. HTT_SW_LMAC_RING_IDX_MAX,
  15766. };
  15767. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15768. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15769. pdev_id: 8,
  15770. ring_type: 8, /* htt_backpressure_ring_type */
  15771. /*
  15772. * ring_id holds an enum value from either
  15773. * htt_backpressure_umac_ringid or
  15774. * htt_backpressure_lmac_ringid, based on
  15775. * the ring_type setting.
  15776. */
  15777. ring_id: 8;
  15778. A_UINT16 head_idx;
  15779. A_UINT16 tail_idx;
  15780. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15781. } POSTPACK;
  15782. /*
  15783. * Defines two 32 bit words that can be used by the target to indicate a per
  15784. * user RU allocation and rate information.
  15785. *
  15786. * This information is currently provided in the "sw_response_reference_ptr"
  15787. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15788. * "rx_ppdu_end_user_stats" TLV.
  15789. *
  15790. * VALID:
  15791. * The consumer of these words must explicitly check the valid bit,
  15792. * and only attempt interpretation of any of the remaining fields if
  15793. * the valid bit is set to 1.
  15794. *
  15795. * VERSION:
  15796. * The consumer of these words must also explicitly check the version bit,
  15797. * and only use the V0 definition if the VERSION field is set to 0.
  15798. *
  15799. * Version 1 is currently undefined, with the exception of the VALID and
  15800. * VERSION fields.
  15801. *
  15802. * Version 0:
  15803. *
  15804. * The fields below are duplicated per BW.
  15805. *
  15806. * The consumer must determine which BW field to use, based on the UL OFDMA
  15807. * PPDU BW indicated by HW.
  15808. *
  15809. * RU_START: RU26 start index for the user.
  15810. * Note that this is always using the RU26 index, regardless
  15811. * of the actual RU assigned to the user
  15812. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15813. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15814. *
  15815. * For example, 20MHz (the value in the top row is RU_START)
  15816. *
  15817. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15818. * RU Size 1 (52): | | | | | |
  15819. * RU Size 2 (106): | | | |
  15820. * RU Size 3 (242): | |
  15821. *
  15822. * RU_SIZE: Indicates the RU size, as defined by enum
  15823. * htt_ul_ofdma_user_info_ru_size.
  15824. *
  15825. * LDPC: LDPC enabled (if 0, BCC is used)
  15826. *
  15827. * DCM: DCM enabled
  15828. *
  15829. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15830. * |---------------------------------+--------------------------------|
  15831. * |Ver|Valid| FW internal |
  15832. * |---------------------------------+--------------------------------|
  15833. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15834. * |---------------------------------+--------------------------------|
  15835. */
  15836. enum htt_ul_ofdma_user_info_ru_size {
  15837. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15838. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15839. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15840. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15841. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15842. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15843. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15844. };
  15845. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15846. struct htt_ul_ofdma_user_info_v0 {
  15847. A_UINT32 word0;
  15848. A_UINT32 word1;
  15849. };
  15850. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15851. A_UINT32 w0_fw_rsvd:30; \
  15852. A_UINT32 w0_valid:1; \
  15853. A_UINT32 w0_version:1;
  15854. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15855. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15856. };
  15857. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15858. A_UINT32 w1_nss:3; \
  15859. A_UINT32 w1_mcs:4; \
  15860. A_UINT32 w1_ldpc:1; \
  15861. A_UINT32 w1_dcm:1; \
  15862. A_UINT32 w1_ru_start:7; \
  15863. A_UINT32 w1_ru_size:3; \
  15864. A_UINT32 w1_trig_type:4; \
  15865. A_UINT32 w1_unused:9;
  15866. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15867. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15868. };
  15869. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15870. A_UINT32 w0_fw_rsvd:27; \
  15871. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15872. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15873. 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) */
  15874. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15875. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15876. };
  15877. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15878. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15879. A_UINT32 w1_trig_type:4; \
  15880. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15881. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15882. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15883. };
  15884. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15885. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15886. union {
  15887. A_UINT32 word0;
  15888. struct {
  15889. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15890. };
  15891. };
  15892. union {
  15893. A_UINT32 word1;
  15894. struct {
  15895. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15896. };
  15897. };
  15898. } POSTPACK;
  15899. /*
  15900. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15901. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15902. * this should be picked.
  15903. */
  15904. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15905. union {
  15906. A_UINT32 word0;
  15907. struct {
  15908. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15909. };
  15910. };
  15911. union {
  15912. A_UINT32 word1;
  15913. struct {
  15914. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15915. };
  15916. };
  15917. } POSTPACK;
  15918. enum HTT_UL_OFDMA_TRIG_TYPE {
  15919. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15920. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15921. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15922. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15923. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15924. };
  15925. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15926. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15927. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15928. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15929. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15930. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15931. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15932. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15933. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15934. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15935. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15936. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15937. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15938. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15939. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15940. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15941. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15942. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15943. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15944. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15945. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15946. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15947. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15948. /*--- word 0 ---*/
  15949. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15950. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15951. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15952. do { \
  15953. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15954. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15955. } while (0)
  15956. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15957. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15958. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15959. do { \
  15960. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15961. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15962. } while (0)
  15963. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15964. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15965. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15966. do { \
  15967. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15968. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15969. } while (0)
  15970. /*--- word 1 ---*/
  15971. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15972. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15973. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15974. do { \
  15975. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15976. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15977. } while (0)
  15978. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15979. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15980. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15981. do { \
  15982. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15983. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15984. } while (0)
  15985. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15986. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15987. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15988. do { \
  15989. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15990. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15991. } while (0)
  15992. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15993. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15994. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15995. do { \
  15996. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15997. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15998. } while (0)
  15999. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16000. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16001. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16002. do { \
  16003. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16004. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16005. } while (0)
  16006. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16007. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16008. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16009. do { \
  16010. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16011. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16012. } while (0)
  16013. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16014. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16015. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16016. do { \
  16017. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16018. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16019. } while (0)
  16020. /**
  16021. * @brief target -> host channel calibration data message
  16022. *
  16023. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16024. *
  16025. * @brief host -> target channel calibration data message
  16026. *
  16027. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16028. *
  16029. * @details
  16030. * The following field definitions describe the format of the channel
  16031. * calibration data message sent from the target to the host when
  16032. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16033. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16034. * The message is defined as htt_chan_caldata_msg followed by a variable
  16035. * number of 32-bit character values.
  16036. *
  16037. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16038. * |------------------------------------------------------------------|
  16039. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16040. * |------------------------------------------------------------------|
  16041. * | payload size | mhz |
  16042. * |------------------------------------------------------------------|
  16043. * | center frequency 2 | center frequency 1 |
  16044. * |------------------------------------------------------------------|
  16045. * | check sum |
  16046. * |------------------------------------------------------------------|
  16047. * | payload |
  16048. * |------------------------------------------------------------------|
  16049. * message info field:
  16050. * - MSG_TYPE
  16051. * Bits 7:0
  16052. * Purpose: identifies this as a channel calibration data message
  16053. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16054. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16055. * - SUB_TYPE
  16056. * Bits 11:8
  16057. * Purpose: T2H: indicates whether target is providing chan cal data
  16058. * to the host to store, or requesting that the host
  16059. * download previously-stored data.
  16060. * H2T: indicates whether the host is providing the requested
  16061. * channel cal data, or if it is rejecting the data
  16062. * request because it does not have the requested data.
  16063. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16064. * - CHKSUM_VALID
  16065. * Bit 12
  16066. * Purpose: indicates if the checksum field is valid
  16067. * value:
  16068. * - FRAG
  16069. * Bit 19:16
  16070. * Purpose: indicates the fragment index for message
  16071. * value: 0 for first fragment, 1 for second fragment, ...
  16072. * - APPEND
  16073. * Bit 20
  16074. * Purpose: indicates if this is the last fragment
  16075. * value: 0 = final fragment, 1 = more fragments will be appended
  16076. *
  16077. * channel and payload size field
  16078. * - MHZ
  16079. * Bits 15:0
  16080. * Purpose: indicates the channel primary frequency
  16081. * Value:
  16082. * - PAYLOAD_SIZE
  16083. * Bits 31:16
  16084. * Purpose: indicates the bytes of calibration data in payload
  16085. * Value:
  16086. *
  16087. * center frequency field
  16088. * - CENTER FREQUENCY 1
  16089. * Bits 15:0
  16090. * Purpose: indicates the channel center frequency
  16091. * Value: channel center frequency, in MHz units
  16092. * - CENTER FREQUENCY 2
  16093. * Bits 31:16
  16094. * Purpose: indicates the secondary channel center frequency,
  16095. * only for 11acvht 80plus80 mode
  16096. * Value: secondary channel center frequeny, in MHz units, if applicable
  16097. *
  16098. * checksum field
  16099. * - CHECK_SUM
  16100. * Bits 31:0
  16101. * Purpose: check the payload data, it is just for this fragment.
  16102. * This is intended for the target to check that the channel
  16103. * calibration data returned by the host is the unmodified data
  16104. * that was previously provided to the host by the target.
  16105. * value: checksum of fragment payload
  16106. */
  16107. PREPACK struct htt_chan_caldata_msg {
  16108. /* DWORD 0: message info */
  16109. A_UINT32
  16110. msg_type: 8,
  16111. sub_type: 4 ,
  16112. chksum_valid: 1, /** 1:valid, 0:invalid */
  16113. reserved1: 3,
  16114. frag_idx: 4, /** fragment index for calibration data */
  16115. appending: 1, /** 0: no fragment appending,
  16116. * 1: extra fragment appending */
  16117. reserved2: 11;
  16118. /* DWORD 1: channel and payload size */
  16119. A_UINT32
  16120. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16121. payload_size: 16; /** unit: bytes */
  16122. /* DWORD 2: center frequency */
  16123. A_UINT32
  16124. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16125. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16126. * valid only for 11acvht 80plus80 mode */
  16127. /* DWORD 3: check sum */
  16128. A_UINT32 chksum;
  16129. /* variable length for calibration data */
  16130. A_UINT32 payload[1/* or more */];
  16131. } POSTPACK;
  16132. /* T2H SUBTYPE */
  16133. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16134. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16135. /* H2T SUBTYPE */
  16136. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16137. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16138. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16139. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16140. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16141. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16142. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16143. do { \
  16144. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16145. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16146. } while (0)
  16147. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16148. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16149. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16150. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16151. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16152. do { \
  16153. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16154. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16155. } while (0)
  16156. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16157. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16158. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16159. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16160. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16161. do { \
  16162. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16163. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16164. } while (0)
  16165. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16166. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16167. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16168. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16169. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16170. do { \
  16171. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16172. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16173. } while (0)
  16174. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16175. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16176. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16177. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16178. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16179. do { \
  16180. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16181. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16182. } while (0)
  16183. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16184. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16185. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16186. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16187. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16188. do { \
  16189. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16190. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16191. } while (0)
  16192. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16193. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16194. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16195. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16196. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16197. do { \
  16198. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16199. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16200. } while (0)
  16201. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16202. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16203. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16204. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16205. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16206. do { \
  16207. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16208. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16209. } while (0)
  16210. /**
  16211. * @brief target -> host FSE CMEM based send
  16212. *
  16213. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16214. *
  16215. * @details
  16216. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16217. * FSE placement in CMEM is enabled.
  16218. *
  16219. * This message sends the non-secure CMEM base address.
  16220. * It will be sent to host in response to message
  16221. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16222. * The message would appear as follows:
  16223. *
  16224. * |31 24|23 16|15 8|7 0|
  16225. * |----------------+----------------+----------------+----------------|
  16226. * | reserved | num_entries | msg_type |
  16227. * |----------------+----------------+----------------+----------------|
  16228. * | base_address_lo |
  16229. * |----------------+----------------+----------------+----------------|
  16230. * | base_address_hi |
  16231. * |-------------------------------------------------------------------|
  16232. *
  16233. * The message is interpreted as follows:
  16234. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16235. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16236. * b'8:15 - number_entries: Indicated the number of entries
  16237. * programmed.
  16238. * b'16:31 - reserved.
  16239. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16240. * CMEM base address
  16241. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16242. * CMEM base address
  16243. */
  16244. PREPACK struct htt_cmem_base_send_t {
  16245. A_UINT32 msg_type: 8,
  16246. num_entries: 8,
  16247. reserved: 16;
  16248. A_UINT32 base_address_lo;
  16249. A_UINT32 base_address_hi;
  16250. } POSTPACK;
  16251. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16252. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16253. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16254. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16255. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16256. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16257. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16258. do { \
  16259. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16260. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16261. } while (0)
  16262. /**
  16263. * @brief - HTT PPDU ID format
  16264. *
  16265. * @details
  16266. * The following field definitions describe the format of the PPDU ID.
  16267. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16268. *
  16269. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16270. * +--------------------------------------------------------------------------
  16271. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16272. * +--------------------------------------------------------------------------
  16273. *
  16274. * sch id :Schedule command id
  16275. * Bits [11 : 0] : monotonically increasing counter to track the
  16276. * PPDU posted to a specific transmit queue.
  16277. *
  16278. * hwq_id: Hardware Queue ID.
  16279. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16280. *
  16281. * mac_id: MAC ID
  16282. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16283. *
  16284. * seq_idx: Sequence index.
  16285. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16286. * a particular TXOP.
  16287. *
  16288. * tqm_cmd: HWSCH/TQM flag.
  16289. * Bit [23] : Always set to 0.
  16290. *
  16291. * seq_cmd_type: Sequence command type.
  16292. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16293. * Refer to enum HTT_STATS_FTYPE for values.
  16294. */
  16295. PREPACK struct htt_ppdu_id {
  16296. A_UINT32
  16297. sch_id: 12,
  16298. hwq_id: 5,
  16299. mac_id: 2,
  16300. seq_idx: 2,
  16301. reserved1: 2,
  16302. tqm_cmd: 1,
  16303. seq_cmd_type: 6,
  16304. reserved2: 2;
  16305. } POSTPACK;
  16306. #define HTT_PPDU_ID_SCH_ID_S 0
  16307. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16308. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16309. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16310. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16311. do { \
  16312. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16313. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16314. } while (0)
  16315. #define HTT_PPDU_ID_HWQ_ID_S 12
  16316. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16317. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16318. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16319. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16320. do { \
  16321. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16322. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16323. } while (0)
  16324. #define HTT_PPDU_ID_MAC_ID_S 17
  16325. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16326. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16327. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16328. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16329. do { \
  16330. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16331. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16332. } while (0)
  16333. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16334. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16335. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16336. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16337. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16338. do { \
  16339. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16340. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16341. } while (0)
  16342. #define HTT_PPDU_ID_TQM_CMD_S 23
  16343. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16344. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16345. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16346. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16347. do { \
  16348. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16349. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16350. } while (0)
  16351. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16352. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16353. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16354. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16355. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16356. do { \
  16357. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16358. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16359. } while (0)
  16360. /**
  16361. * @brief target -> RX PEER METADATA V0 format
  16362. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16363. * message from target, and will confirm to the target which peer metadata
  16364. * version to use in the wmi_init message.
  16365. *
  16366. * The following diagram shows the format of the RX PEER METADATA.
  16367. *
  16368. * |31 24|23 16|15 8|7 0|
  16369. * |-----------------------------------------------------------------------|
  16370. * | Reserved | VDEV ID | PEER ID |
  16371. * |-----------------------------------------------------------------------|
  16372. */
  16373. PREPACK struct htt_rx_peer_metadata_v0 {
  16374. A_UINT32
  16375. peer_id: 16,
  16376. vdev_id: 8,
  16377. reserved1: 8;
  16378. } POSTPACK;
  16379. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16380. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16381. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16382. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16383. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16384. do { \
  16385. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16386. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16387. } while (0)
  16388. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16389. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16390. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16391. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16392. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16393. do { \
  16394. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16395. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16396. } while (0)
  16397. /**
  16398. * @brief target -> RX PEER METADATA V1 format
  16399. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16400. * message from target, and will confirm to the target which peer metadata
  16401. * version to use in the wmi_init message.
  16402. *
  16403. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16404. *
  16405. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16406. * |-----------------------------------------------------------------------|
  16407. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16408. * |-----------------------------------------------------------------------|
  16409. */
  16410. PREPACK struct htt_rx_peer_metadata_v1 {
  16411. A_UINT32
  16412. peer_id: 13,
  16413. ml_peer_valid: 1,
  16414. reserved1: 2,
  16415. vdev_id: 8,
  16416. lmac_id: 2,
  16417. chip_id: 3,
  16418. reserved2: 3;
  16419. } POSTPACK;
  16420. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16421. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16422. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16423. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16424. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16425. do { \
  16426. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16427. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16428. } while (0)
  16429. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16430. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16431. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16432. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16433. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16434. do { \
  16435. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16436. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16437. } while (0)
  16438. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16439. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16440. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16441. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16442. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16443. do { \
  16444. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16445. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16446. } while (0)
  16447. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16448. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16449. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16450. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16451. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16452. do { \
  16453. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16454. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16455. } while (0)
  16456. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16457. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16458. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16459. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16460. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16461. do { \
  16462. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16463. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16464. } while (0)
  16465. /*
  16466. * In some systems, the host SW wants to specify priorities between
  16467. * different MSDU / flow queues within the same peer-TID.
  16468. * The below enums are used for the host to identify to the target
  16469. * which MSDU queue's priority it wants to adjust.
  16470. */
  16471. /*
  16472. * The MSDUQ index describe index of TCL HW, where each index is
  16473. * used for queuing particular types of MSDUs.
  16474. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16475. */
  16476. enum HTT_MSDUQ_INDEX {
  16477. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16478. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16479. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16480. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16481. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16482. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16483. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16484. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16485. HTT_MSDUQ_MAX_INDEX,
  16486. };
  16487. /* MSDU qtype definition */
  16488. enum HTT_MSDU_QTYPE {
  16489. /*
  16490. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16491. * relative priority. Instead, the relative priority of CRIT_0 versus
  16492. * CRIT_1 is controlled by the FW, through the configuration parameters
  16493. * it applies to the queues.
  16494. */
  16495. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16496. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16497. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16498. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16499. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16500. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16501. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16502. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16503. /* New MSDU_QTYPE should be added above this line */
  16504. /*
  16505. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16506. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16507. * any host/target message definitions. The QTYPE_MAX value can
  16508. * only be used internally within the host or within the target.
  16509. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16510. * it must regard the unexpected value as a default qtype value,
  16511. * or ignore it.
  16512. */
  16513. HTT_MSDU_QTYPE_MAX,
  16514. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16515. };
  16516. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16517. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16518. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16519. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16520. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16521. };
  16522. /**
  16523. * @brief target -> host mlo timestamp offset indication
  16524. *
  16525. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16526. *
  16527. * @details
  16528. * The following field definitions describe the format of the HTT target
  16529. * to host mlo timestamp offset indication message.
  16530. *
  16531. *
  16532. * |31 16|15 12|11 10|9 8|7 0 |
  16533. * |----------------------------------------------------------------------|
  16534. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16535. * |----------------------------------------------------------------------|
  16536. * | Sync time stamp lo in us |
  16537. * |----------------------------------------------------------------------|
  16538. * | Sync time stamp hi in us |
  16539. * |----------------------------------------------------------------------|
  16540. * | mlo time stamp offset lo in us |
  16541. * |----------------------------------------------------------------------|
  16542. * | mlo time stamp offset hi in us |
  16543. * |----------------------------------------------------------------------|
  16544. * | mlo time stamp offset clocks in clock ticks |
  16545. * |----------------------------------------------------------------------|
  16546. * |31 26|25 16|15 0 |
  16547. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16548. * | | compensation in clks | |
  16549. * |----------------------------------------------------------------------|
  16550. * |31 22|21 0 |
  16551. * | rsvd 3 | mlo time stamp comp timer period |
  16552. * |----------------------------------------------------------------------|
  16553. * The message is interpreted as follows:
  16554. *
  16555. * dword0 - b'0:7 - msg_type: This will be set to
  16556. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16557. * value: 0x28
  16558. *
  16559. * dword0 - b'9:8 - pdev_id
  16560. *
  16561. * dword0 - b'11:10 - chip_id
  16562. *
  16563. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16564. *
  16565. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16566. *
  16567. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16568. * which last sync interrupt was received
  16569. *
  16570. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16571. * which last sync interrupt was received
  16572. *
  16573. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16574. *
  16575. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16576. *
  16577. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16578. *
  16579. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16580. *
  16581. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16582. * for sub us resolution
  16583. *
  16584. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16585. *
  16586. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16587. * is applied, in us
  16588. *
  16589. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16590. */
  16591. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16592. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16593. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16594. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16595. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16596. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16597. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16598. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16599. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16600. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16601. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16602. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16603. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16604. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16605. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16606. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16607. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16608. do { \
  16609. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16610. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16611. } while (0)
  16612. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16613. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16614. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16615. do { \
  16616. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16617. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16618. } while (0)
  16619. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16620. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16621. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16622. do { \
  16623. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16624. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16625. } while (0)
  16626. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16627. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16628. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16629. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16630. do { \
  16631. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16632. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16633. } while (0)
  16634. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16635. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16636. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16637. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16638. do { \
  16639. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16640. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16641. } while (0)
  16642. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16643. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16644. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16645. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16646. do { \
  16647. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16648. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16649. } while (0)
  16650. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16651. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16652. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16653. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16654. do { \
  16655. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16656. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16657. } while (0)
  16658. typedef struct {
  16659. A_UINT32 msg_type: 8, /* bits 7:0 */
  16660. pdev_id: 2, /* bits 9:8 */
  16661. chip_id: 2, /* bits 11:10 */
  16662. reserved1: 4, /* bits 15:12 */
  16663. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16664. A_UINT32 sync_timestamp_lo_us;
  16665. A_UINT32 sync_timestamp_hi_us;
  16666. A_UINT32 mlo_timestamp_offset_lo_us;
  16667. A_UINT32 mlo_timestamp_offset_hi_us;
  16668. A_UINT32 mlo_timestamp_offset_clks;
  16669. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16670. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16671. reserved2: 6; /* bits 31:26 */
  16672. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16673. reserved3: 10; /* bits 31:22 */
  16674. } htt_t2h_mlo_offset_ind_t;
  16675. /*
  16676. * @brief target -> host VDEV TX RX STATS
  16677. *
  16678. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16679. *
  16680. * @details
  16681. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16682. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16683. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16684. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16685. * periodically by target even in the absence of any further HTT request
  16686. * messages from host.
  16687. *
  16688. * The message is formatted as follows:
  16689. *
  16690. * |31 16|15 8|7 0|
  16691. * |---------------------------------+----------------+----------------|
  16692. * | payload_size | pdev_id | msg_type |
  16693. * |---------------------------------+----------------+----------------|
  16694. * | reserved0 |
  16695. * |-------------------------------------------------------------------|
  16696. * | reserved1 |
  16697. * |-------------------------------------------------------------------|
  16698. * | reserved2 |
  16699. * |-------------------------------------------------------------------|
  16700. * | |
  16701. * | VDEV specific Tx Rx stats info |
  16702. * | |
  16703. * |-------------------------------------------------------------------|
  16704. *
  16705. * The message is interpreted as follows:
  16706. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16707. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16708. * b'8:15 - pdev_id
  16709. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16710. * message header fields (msg_type through reserved2)
  16711. * dword1 - b'0:31 - reserved0.
  16712. * dword2 - b'0:31 - reserved1.
  16713. * dword3 - b'0:31 - reserved2.
  16714. */
  16715. typedef struct {
  16716. A_UINT32 msg_type: 8,
  16717. pdev_id: 8,
  16718. payload_size: 16;
  16719. A_UINT32 reserved0;
  16720. A_UINT32 reserved1;
  16721. A_UINT32 reserved2;
  16722. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16723. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16724. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16725. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16726. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16727. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16728. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16729. do { \
  16730. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16731. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16732. } while (0)
  16733. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16734. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16735. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16736. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16737. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16738. do { \
  16739. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16740. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16741. } while (0)
  16742. /* SOC related stats */
  16743. typedef struct {
  16744. htt_tlv_hdr_t tlv_hdr;
  16745. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16746. * This can be due to either the peer is deleted or deletion is ongoing
  16747. * */
  16748. A_UINT32 inv_peers_msdu_drop_count_lo;
  16749. A_UINT32 inv_peers_msdu_drop_count_hi;
  16750. } htt_t2h_soc_txrx_stats_common_tlv;
  16751. /* VDEV HW Tx/Rx stats */
  16752. typedef struct {
  16753. htt_tlv_hdr_t tlv_hdr;
  16754. A_UINT32 vdev_id;
  16755. /* Rx msdu byte cnt */
  16756. A_UINT32 rx_msdu_byte_cnt_lo;
  16757. A_UINT32 rx_msdu_byte_cnt_hi;
  16758. /* Rx msdu cnt */
  16759. A_UINT32 rx_msdu_cnt_lo;
  16760. A_UINT32 rx_msdu_cnt_hi;
  16761. /* tx msdu byte cnt */
  16762. A_UINT32 tx_msdu_byte_cnt_lo;
  16763. A_UINT32 tx_msdu_byte_cnt_hi;
  16764. /* tx msdu cnt */
  16765. A_UINT32 tx_msdu_cnt_lo;
  16766. A_UINT32 tx_msdu_cnt_hi;
  16767. /* tx excessive retry discarded msdu cnt */
  16768. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16769. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16770. /* TX congestion ctrl msdu drop cnt */
  16771. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16772. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16773. /* discarded tx msdus cnt coz of time to live expiry */
  16774. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16775. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16776. /* tx excessive retry discarded msdu byte cnt */
  16777. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16778. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16779. /* TX congestion ctrl msdu drop byte cnt */
  16780. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16781. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16782. /* discarded tx msdus byte cnt coz of time to live expiry */
  16783. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16784. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16785. /* TQM bypass frame cnt */
  16786. A_UINT32 tqm_bypass_frame_cnt_lo;
  16787. A_UINT32 tqm_bypass_frame_cnt_hi;
  16788. /* TQM bypass byte cnt */
  16789. A_UINT32 tqm_bypass_byte_cnt_lo;
  16790. A_UINT32 tqm_bypass_byte_cnt_hi;
  16791. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16792. /*
  16793. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16794. *
  16795. * @details
  16796. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16797. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16798. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16799. * the default MSDU queues of each of the specified TIDs for the peer
  16800. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16801. * If the default MSDU queues of a given TID within the peer are not linked
  16802. * to a service class, the svc_class_id field for that TID will have a
  16803. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16804. * queues for that TID are not mapped to any service class.
  16805. *
  16806. * |31 16|15 8|7 0|
  16807. * |------------------------------+--------------+--------------|
  16808. * | peer ID | reserved | msg type |
  16809. * |------------------------------+--------------+------+-------|
  16810. * | reserved | svc class ID | TID |
  16811. * |------------------------------------------------------------|
  16812. * ...
  16813. * |------------------------------------------------------------|
  16814. * | reserved | svc class ID | TID |
  16815. * |------------------------------------------------------------|
  16816. * Header fields:
  16817. * dword0 - b'7:0 - msg_type: This will be set to
  16818. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16819. * b'31:16 - peer ID
  16820. * dword1 - b'7:0 - TID
  16821. * b'15:8 - svc class ID
  16822. * (dword2, etc. same format as dword1)
  16823. */
  16824. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16825. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16826. A_UINT32 msg_type :8,
  16827. reserved0 :8,
  16828. peer_id :16;
  16829. struct {
  16830. A_UINT32 tid :8,
  16831. svc_class_id :8,
  16832. reserved1 :16;
  16833. } tid_reports[1/*or more*/];
  16834. } POSTPACK;
  16835. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16836. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16837. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16838. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16839. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16840. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16841. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16842. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16843. do { \
  16844. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16845. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16846. } while (0)
  16847. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16848. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16849. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16850. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16851. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16852. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16853. do { \
  16854. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16855. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16856. } while (0)
  16857. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16858. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16859. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16860. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16861. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16862. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16863. do { \
  16864. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16865. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16866. } while (0)
  16867. /*
  16868. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16869. *
  16870. * @details
  16871. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16872. * flow if the flow is seen the associated service class is conveyed to the
  16873. * target via TCL Data Command. Target on the other hand internally creates the
  16874. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16875. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16876. * the newly created MSDUQ
  16877. *
  16878. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16879. * |------------------------------+------------------------+--------------|
  16880. * | peer ID | HTT qtype | msg type |
  16881. * |---------------------------------+--------------+--+---+-------+------|
  16882. * | reserved |AST list index|FO|WC | HLOS | remap|
  16883. * | | | | | TID | TID |
  16884. * |---------------------+------------------------------------------------|
  16885. * | reserved1 | tgt_opaque_id |
  16886. * |---------------------+------------------------------------------------|
  16887. *
  16888. * Header fields:
  16889. *
  16890. * dword0 - b'7:0 - msg_type: This will be set to
  16891. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16892. * b'15:8 - HTT qtype
  16893. * b'31:16 - peer ID
  16894. *
  16895. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16896. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16897. * hlos_tid : Common to Lithium and Beryllium
  16898. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16899. * TCL Data Command : Beryllium
  16900. * b10 - flow_override (FO), as sent by host in
  16901. * TCL Data Command: Beryllium
  16902. * b11:14 - ast_list_idx
  16903. * Array index into the list of extension AST entries
  16904. * (not the actual AST 16-bit index).
  16905. * The ast_list_idx is one-based, with the following
  16906. * range of values:
  16907. * - legacy targets supporting 16 user-defined
  16908. * MSDU queues: 1-2
  16909. * - legacy targets supporting 48 user-defined
  16910. * MSDU queues: 1-6
  16911. * - new targets: 0 (peer_id is used instead)
  16912. * Note that since ast_list_idx is one-based,
  16913. * the host will need to subtract 1 to use it as an
  16914. * index into a list of extension AST entries.
  16915. * b15:31 - reserved
  16916. *
  16917. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16918. * unique MSDUQ id in firmware
  16919. * b'24:31 - reserved1
  16920. */
  16921. PREPACK struct htt_t2h_sawf_msduq_event {
  16922. A_UINT32 msg_type : 8,
  16923. htt_qtype : 8,
  16924. peer_id :16;
  16925. A_UINT32 remap_tid : 4,
  16926. hlos_tid : 4,
  16927. who_classify_info_sel : 2,
  16928. flow_override : 1,
  16929. ast_list_idx : 4,
  16930. reserved :17;
  16931. A_UINT32 tgt_opaque_id :24,
  16932. reserved1 : 8;
  16933. } POSTPACK;
  16934. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16935. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16936. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16937. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16938. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16939. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16940. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16941. do { \
  16942. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16943. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16944. } while (0)
  16945. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16946. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16947. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16948. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16949. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16950. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16951. do { \
  16952. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16953. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16954. } while (0)
  16955. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16956. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16957. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16958. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16959. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16960. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16961. do { \
  16962. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16963. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16964. } while (0)
  16965. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16966. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16967. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16968. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16969. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16970. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16971. do { \
  16972. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16973. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16974. } while (0)
  16975. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16976. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16977. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16978. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16979. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16980. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16981. do { \
  16982. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16983. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16984. } while (0)
  16985. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16986. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16987. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16988. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16989. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16990. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16991. do { \
  16992. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16993. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16994. } while (0)
  16995. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  16996. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  16997. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  16998. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  16999. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17000. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17001. do { \
  17002. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17003. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17004. } while (0)
  17005. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17006. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17007. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17008. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17009. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17010. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17011. do { \
  17012. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17013. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17014. } while (0)
  17015. /**
  17016. * @brief target -> PPDU id format indication
  17017. *
  17018. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17019. *
  17020. * @details
  17021. * The following field definitions describe the format of the HTT target
  17022. * to host PPDU ID format indication message.
  17023. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17024. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17025. * seq_idx :- Sequence control index of this PPDU.
  17026. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17027. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17028. * tqm_cmd:-
  17029. *
  17030. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17031. * |--------------------------------------------------+------------------------|
  17032. * | rsvd0 | msg type |
  17033. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17034. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17035. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17036. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17037. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17038. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17039. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17040. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17041. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17042. * Where: OF = bit offset, NB = number of bits, V = valid
  17043. * The message is interpreted as follows:
  17044. *
  17045. * dword0 - b'7:0 - msg_type: This will be set to
  17046. * HTT_T2H_PPDU_ID_FMT_IND
  17047. * value: 0x30
  17048. *
  17049. * dword0 - b'31:8 - reserved
  17050. *
  17051. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17052. *
  17053. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17054. *
  17055. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17056. *
  17057. * dword1 - b'15:11 - reserved for future use
  17058. *
  17059. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17060. *
  17061. * dword1 - b'21:17 - number of bits in ring_id
  17062. *
  17063. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17064. *
  17065. * dword1 - b'31:27 - reserved for future use
  17066. *
  17067. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17068. *
  17069. * dword2 - b'5:1 - number of bits in sequence index
  17070. *
  17071. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17072. *
  17073. * dword2 - b'15:11 - reserved for future use
  17074. *
  17075. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17076. *
  17077. * dword2 - b'21:17 - number of bits in link_id
  17078. *
  17079. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17080. *
  17081. * dword2 - b'31:27 - reserved for future use
  17082. *
  17083. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17084. *
  17085. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17086. *
  17087. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17088. *
  17089. * dword3 - b'15:11 - reserved for future use
  17090. *
  17091. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17092. *
  17093. * dword3 - b'21:17 - number of bits in tqm_cmd
  17094. *
  17095. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17096. *
  17097. * dword3 - b'31:27 - reserved for future use
  17098. *
  17099. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17100. *
  17101. * dword4 - b'5:1 - number of bits in mac_id
  17102. *
  17103. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17104. *
  17105. * dword4 - b'15:11 - reserved for future use
  17106. *
  17107. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17108. *
  17109. * dword4 - b'21:17 - number of bits in crc
  17110. *
  17111. * dword4 - b'26:22 - offset of crc (in number of bits)
  17112. *
  17113. * dword4 - b'31:27 - reserved for future use
  17114. *
  17115. */
  17116. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17117. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17118. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17119. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17120. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17121. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17122. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17123. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17124. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17125. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17126. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17127. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17128. /* macros for accessing lower 16 bits in dword */
  17129. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17130. do { \
  17131. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17132. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17133. } while (0)
  17134. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17135. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17136. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17137. do { \
  17138. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17139. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17140. } while (0)
  17141. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17142. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17143. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17144. do { \
  17145. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17146. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17147. } while (0)
  17148. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17149. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17150. /* macros for accessing upper 16 bits in dword */
  17151. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17152. do { \
  17153. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17154. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17155. } while (0)
  17156. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17157. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17158. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17159. do { \
  17160. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17161. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17162. } while (0)
  17163. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17164. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17165. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17166. do { \
  17167. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17168. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17169. } while (0)
  17170. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17171. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17172. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17173. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17174. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17175. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17176. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17177. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17178. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17179. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17180. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17181. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17182. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17183. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17184. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17185. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17186. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17187. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17188. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17189. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17190. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17191. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17192. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17193. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17194. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17195. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17196. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17197. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17198. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17199. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17200. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17201. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17202. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17203. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17204. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17205. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17206. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17207. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17208. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17209. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17210. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17211. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17212. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17213. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17214. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17215. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17216. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17217. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17218. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17219. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17220. /* offsets in number dwords */
  17221. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17222. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17223. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17224. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17225. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17226. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17227. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17228. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17229. typedef struct {
  17230. A_UINT32 msg_type: 8, /* bits 7:0 */
  17231. rsvd0: 24;/* bits 31:8 */
  17232. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17233. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17234. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17235. rsvd1: 5, /* bits 15:11 */
  17236. ring_id_valid: 1, /* bits 16:16 */
  17237. ring_id_bits: 5, /* bits 21:17 */
  17238. ring_id_offset: 5, /* bits 26:22 */
  17239. rsvd2: 5; /* bits 31:27 */
  17240. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17241. seq_idx_bits: 5, /* bits 5:1 */
  17242. seq_idx_offset: 5, /* bits 10:6 */
  17243. rsvd3: 5, /* bits 15:11 */
  17244. link_id_valid: 1, /* bits 16:16 */
  17245. link_id_bits: 5, /* bits 21:17 */
  17246. link_id_offset: 5, /* bits 26:22 */
  17247. rsvd4: 5; /* bits 31:27 */
  17248. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17249. seq_cmd_type_bits: 5, /* bits 5:1 */
  17250. seq_cmd_type_offset: 5, /* bits 10:6 */
  17251. rsvd5: 5, /* bits 15:11 */
  17252. tqm_cmd_valid: 1, /* bits 16:16 */
  17253. tqm_cmd_bits: 5, /* bits 21:17 */
  17254. tqm_cmd_offset: 5, /* bits 26:12 */
  17255. rsvd6: 5; /* bits 31:27 */
  17256. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17257. mac_id_bits: 5, /* bits 5:1 */
  17258. mac_id_offset: 5, /* bits 10:6 */
  17259. rsvd8: 5, /* bits 15:11 */
  17260. crc_valid: 1, /* bits 16:16 */
  17261. crc_bits: 5, /* bits 21:17 */
  17262. crc_offset: 5, /* bits 26:12 */
  17263. rsvd9: 5; /* bits 31:27 */
  17264. } htt_t2h_ppdu_id_fmt_ind_t;
  17265. #endif