htt.h 882 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167
  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. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. */
  232. #define HTT_CURRENT_VERSION_MAJOR 3
  233. #define HTT_CURRENT_VERSION_MINOR 110
  234. #define HTT_NUM_TX_FRAG_DESC 1024
  235. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  236. #define HTT_CHECK_SET_VAL(field, val) \
  237. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  238. /* macros to assist in sign-extending fields from HTT messages */
  239. #define HTT_SIGN_BIT_MASK(field) \
  240. ((field ## _M + (1 << field ## _S)) >> 1)
  241. #define HTT_SIGN_BIT(_val, field) \
  242. (_val & HTT_SIGN_BIT_MASK(field))
  243. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  244. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  245. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  246. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  247. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  248. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  249. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  250. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  251. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  252. /*
  253. * TEMPORARY:
  254. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  255. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  256. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  257. * updated.
  258. */
  259. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  260. /*
  261. * TEMPORARY:
  262. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  263. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  264. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  265. * updated.
  266. */
  267. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  268. /**
  269. * htt_dbg_stats_type -
  270. * bit positions for each stats type within a stats type bitmask
  271. * The bitmask contains 24 bits.
  272. */
  273. enum htt_dbg_stats_type {
  274. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  275. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  276. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  277. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  278. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  279. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  280. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  281. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  282. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  283. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  284. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  285. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  286. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  287. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  288. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  289. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  290. /* bits 16-23 currently reserved */
  291. /* keep this last */
  292. HTT_DBG_NUM_STATS
  293. };
  294. /*=== HTT option selection TLVs ===
  295. * Certain HTT messages have alternatives or options.
  296. * For such cases, the host and target need to agree on which option to use.
  297. * Option specification TLVs can be appended to the VERSION_REQ and
  298. * VERSION_CONF messages to select options other than the default.
  299. * These TLVs are entirely optional - if they are not provided, there is a
  300. * well-defined default for each option. If they are provided, they can be
  301. * provided in any order. Each TLV can be present or absent independent of
  302. * the presence / absence of other TLVs.
  303. *
  304. * The HTT option selection TLVs use the following format:
  305. * |31 16|15 8|7 0|
  306. * |---------------------------------+----------------+----------------|
  307. * | value (payload) | length | tag |
  308. * |-------------------------------------------------------------------|
  309. * The value portion need not be only 2 bytes; it can be extended by any
  310. * integer number of 4-byte units. The total length of the TLV, including
  311. * the tag and length fields, must be a multiple of 4 bytes. The length
  312. * field specifies the total TLV size in 4-byte units. Thus, the typical
  313. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  314. * field, would store 0x1 in its length field, to show that the TLV occupies
  315. * a single 4-byte unit.
  316. */
  317. /*--- TLV header format - applies to all HTT option TLVs ---*/
  318. enum HTT_OPTION_TLV_TAGS {
  319. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  320. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  321. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  322. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  323. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  324. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  325. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  326. };
  327. #define HTT_TCL_METADATA_VER_SZ 4
  328. PREPACK struct htt_option_tlv_header_t {
  329. A_UINT8 tag;
  330. A_UINT8 length;
  331. } POSTPACK;
  332. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  333. #define HTT_OPTION_TLV_TAG_S 0
  334. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  335. #define HTT_OPTION_TLV_LENGTH_S 8
  336. /*
  337. * value0 - 16 bit value field stored in word0
  338. * The TLV's value field may be longer than 2 bytes, in which case
  339. * the remainder of the value is stored in word1, word2, etc.
  340. */
  341. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  342. #define HTT_OPTION_TLV_VALUE0_S 16
  343. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  344. do { \
  345. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  346. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  347. } while (0)
  348. #define HTT_OPTION_TLV_TAG_GET(word) \
  349. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  350. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  356. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  357. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  358. do { \
  359. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  360. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  361. } while (0)
  362. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  363. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  364. /*--- format of specific HTT option TLVs ---*/
  365. /*
  366. * HTT option TLV for specifying LL bus address size
  367. * Some chips require bus addresses used by the target to access buffers
  368. * within the host's memory to be 32 bits; others require bus addresses
  369. * used by the target to access buffers within the host's memory to be
  370. * 64 bits.
  371. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  372. * a suffix to the VERSION_CONF message to specify which bus address format
  373. * the target requires.
  374. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  375. * default to providing bus addresses to the target in 32-bit format.
  376. */
  377. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  379. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  380. };
  381. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  382. struct htt_option_tlv_header_t hdr;
  383. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  384. } POSTPACK;
  385. /*
  386. * HTT option TLV for specifying whether HL systems should indicate
  387. * over-the-air tx completion for individual frames, or should instead
  388. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  389. * requests an OTA tx completion for a particular tx frame.
  390. * This option does not apply to LL systems, where the TX_COMPL_IND
  391. * is mandatory.
  392. * This option is primarily intended for HL systems in which the tx frame
  393. * downloads over the host --> target bus are as slow as or slower than
  394. * the transmissions over the WLAN PHY. For cases where the bus is faster
  395. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  396. * and consquently will send one TX_COMPL_IND message that covers several
  397. * tx frames. For cases where the WLAN PHY is faster than the bus,
  398. * the target will end up transmitting very short A-MPDUs, and consequently
  399. * sending many TX_COMPL_IND messages, which each cover a very small number
  400. * of tx frames.
  401. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  402. * a suffix to the VERSION_REQ message to request whether the host desires to
  403. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  404. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  405. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  406. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  407. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  408. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  409. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  410. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  411. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  412. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  413. * TLV.
  414. */
  415. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  416. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  417. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  418. };
  419. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  420. struct htt_option_tlv_header_t hdr;
  421. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  422. } POSTPACK;
  423. /*
  424. * HTT option TLV for specifying how many tx queue groups the target
  425. * may establish.
  426. * This TLV specifies the maximum value the target may send in the
  427. * txq_group_id field of any TXQ_GROUP information elements sent by
  428. * the target to the host. This allows the host to pre-allocate an
  429. * appropriate number of tx queue group structs.
  430. *
  431. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  432. * a suffix to the VERSION_REQ message to specify whether the host supports
  433. * tx queue groups at all, and if so if there is any limit on the number of
  434. * tx queue groups that the host supports.
  435. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  436. * a suffix to the VERSION_CONF message. If the host has specified in the
  437. * VER_REQ message a limit on the number of tx queue groups the host can
  438. * supprt, the target shall limit its specification of the maximum tx groups
  439. * to be no larger than this host-specified limit.
  440. *
  441. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  442. * shall preallocate 4 tx queue group structs, and the target shall not
  443. * specify a txq_group_id larger than 3.
  444. */
  445. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  446. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  447. /*
  448. * values 1 through N specify the max number of tx queue groups
  449. * the sender supports
  450. */
  451. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  452. };
  453. /* TEMPORARY backwards-compatibility alias for a typo fix -
  454. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  455. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  456. * to support the old name (with the typo) until all references to the
  457. * old name are replaced with the new name.
  458. */
  459. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  460. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  461. struct htt_option_tlv_header_t hdr;
  462. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  463. } POSTPACK;
  464. /*
  465. * HTT option TLV for specifying whether the target supports an extended
  466. * version of the HTT tx descriptor. If the target provides this TLV
  467. * and specifies in the TLV that the target supports an extended version
  468. * of the HTT tx descriptor, the target must check the "extension" bit in
  469. * the HTT tx descriptor, and if the extension bit is set, to expect a
  470. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  471. * descriptor. Furthermore, the target must provide room for the HTT
  472. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  473. * This option is intended for systems where the host needs to explicitly
  474. * control the transmission parameters such as tx power for individual
  475. * tx frames.
  476. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  477. * as a suffix to the VERSION_CONF message to explicitly specify whether
  478. * the target supports the HTT tx MSDU extension descriptor.
  479. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  480. * by the host as lack of target support for the HTT tx MSDU extension
  481. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  482. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  483. * the HTT tx MSDU extension descriptor.
  484. * The host is not required to provide the HTT tx MSDU extension descriptor
  485. * just because the target supports it; the target must check the
  486. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  487. * extension descriptor is present.
  488. */
  489. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  491. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  492. };
  493. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  494. struct htt_option_tlv_header_t hdr;
  495. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  496. } POSTPACK;
  497. /*
  498. * For the tcl data command V2 and higher support added a new
  499. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  500. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  501. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  502. * HTT option TLV for specifying which version of the TCL metadata struct
  503. * should be used:
  504. * V1 -> use htt_tx_tcl_metadata struct
  505. * V2 -> use htt_tx_tcl_metadata_v2 struct
  506. * Old FW will only support V1.
  507. * New FW will support V2. New FW will still support V1, at least during
  508. * a transition period.
  509. * Similarly, old host will only support V1, and new host will support V1 + V2.
  510. *
  511. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  512. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  513. * of TCL metadata the host supports. If the host doesn't provide a
  514. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  515. * is implicitly understood that the host only supports V1.
  516. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  517. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  518. * the host shall use. The target shall only select one of the versions
  519. * supported by the host. If the target doesn't provide a
  520. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  521. * is implicitly understood that the V1 TCL metadata shall be used.
  522. */
  523. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  524. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  525. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  526. };
  527. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  528. struct htt_option_tlv_header_t hdr;
  529. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  530. } POSTPACK;
  531. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  532. HTT_OPTION_TLV_VALUE0_SET(word, value)
  533. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  534. HTT_OPTION_TLV_VALUE0_GET(word)
  535. typedef struct {
  536. union {
  537. /* BIT [11 : 0] :- tag
  538. * BIT [23 : 12] :- length
  539. * BIT [31 : 24] :- reserved
  540. */
  541. A_UINT32 tag__length;
  542. /*
  543. * The following struct is not endian-portable.
  544. * It is suitable for use within the target, which is known to be
  545. * little-endian.
  546. * The host should use the above endian-portable macros to access
  547. * the tag and length bitfields in an endian-neutral manner.
  548. */
  549. struct {
  550. A_UINT32 tag : 12, /* BIT [11 : 0] */
  551. length : 12, /* BIT [23 : 12] */
  552. reserved : 8; /* BIT [31 : 24] */
  553. };
  554. };
  555. } htt_tlv_hdr_t;
  556. /** HTT stats TLV tag values */
  557. typedef enum {
  558. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  559. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  560. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  561. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  562. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  563. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  564. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  565. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  568. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  569. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  570. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  571. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  572. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  573. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  574. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  575. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  578. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  579. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  580. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  581. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  582. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  583. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  584. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  585. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  586. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  587. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  588. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  589. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  590. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  591. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  592. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  593. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  594. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  595. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  596. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  597. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  598. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  599. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  600. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  601. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  602. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  603. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  604. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  608. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  611. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  612. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  613. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  614. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  615. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  616. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  617. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  618. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  619. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  620. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  621. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  622. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  623. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  624. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  625. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  626. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  627. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  628. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  629. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  630. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  631. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  632. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  633. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  634. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  635. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  636. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  637. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  638. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  639. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  640. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  641. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  642. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  643. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  644. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  645. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  646. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  647. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  648. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  649. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  650. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  651. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  652. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  655. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  656. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  657. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  658. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  659. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  660. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  661. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  662. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  665. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  666. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  667. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  668. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  669. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  670. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  671. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  674. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  675. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  676. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  677. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  678. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  679. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  680. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  681. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  682. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  683. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  684. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  685. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  686. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  687. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  688. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  689. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  690. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  691. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  692. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  693. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  694. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  697. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  698. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  699. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  700. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  701. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  702. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  703. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  704. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  705. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  713. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  714. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  715. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  716. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  717. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  718. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  719. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  720. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  721. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  722. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  723. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  724. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  725. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  726. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  727. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v */
  728. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  729. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  730. HTT_STATS_MAX_TAG,
  731. } htt_stats_tlv_tag_t;
  732. /* retain deprecated enum name as an alias for the current enum name */
  733. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  734. #define HTT_STATS_TLV_TAG_M 0x00000fff
  735. #define HTT_STATS_TLV_TAG_S 0
  736. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  737. #define HTT_STATS_TLV_LENGTH_S 12
  738. #define HTT_STATS_TLV_TAG_GET(_var) \
  739. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  740. HTT_STATS_TLV_TAG_S)
  741. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  742. do { \
  743. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  744. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  745. } while (0)
  746. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  747. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  748. HTT_STATS_TLV_LENGTH_S)
  749. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  750. do { \
  751. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  752. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  753. } while (0)
  754. /*=== host -> target messages ===============================================*/
  755. enum htt_h2t_msg_type {
  756. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  757. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  758. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  759. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  760. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  761. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  762. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  763. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  764. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  765. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  766. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  767. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  768. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  769. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  770. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  771. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  772. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  773. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  774. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  775. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  776. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  777. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  778. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  779. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  780. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  781. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  782. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  783. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  784. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  785. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  786. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  787. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  788. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  789. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  790. /* keep this last */
  791. HTT_H2T_NUM_MSGS
  792. };
  793. /*
  794. * HTT host to target message type -
  795. * stored in bits 7:0 of the first word of the message
  796. */
  797. #define HTT_H2T_MSG_TYPE_M 0xff
  798. #define HTT_H2T_MSG_TYPE_S 0
  799. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  800. do { \
  801. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  802. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  803. } while (0)
  804. #define HTT_H2T_MSG_TYPE_GET(word) \
  805. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  806. /**
  807. * @brief host -> target version number request message definition
  808. *
  809. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  810. *
  811. *
  812. * |31 24|23 16|15 8|7 0|
  813. * |----------------+----------------+----------------+----------------|
  814. * | reserved | msg type |
  815. * |-------------------------------------------------------------------|
  816. * : option request TLV (optional) |
  817. * :...................................................................:
  818. *
  819. * The VER_REQ message may consist of a single 4-byte word, or may be
  820. * extended with TLVs that specify which HTT options the host is requesting
  821. * from the target.
  822. * The following option TLVs may be appended to the VER_REQ message:
  823. * - HL_SUPPRESS_TX_COMPL_IND
  824. * - HL_MAX_TX_QUEUE_GROUPS
  825. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  826. * may be appended to the VER_REQ message (but only one TLV of each type).
  827. *
  828. * Header fields:
  829. * - MSG_TYPE
  830. * Bits 7:0
  831. * Purpose: identifies this as a version number request message
  832. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  833. */
  834. #define HTT_VER_REQ_BYTES 4
  835. /* TBDXXX: figure out a reasonable number */
  836. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  837. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  838. /**
  839. * @brief HTT tx MSDU descriptor
  840. *
  841. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  842. *
  843. * @details
  844. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  845. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  846. * the target firmware needs for the FW's tx processing, particularly
  847. * for creating the HW msdu descriptor.
  848. * The same HTT tx descriptor is used for HL and LL systems, though
  849. * a few fields within the tx descriptor are used only by LL or
  850. * only by HL.
  851. * The HTT tx descriptor is defined in two manners: by a struct with
  852. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  853. * definitions.
  854. * The target should use the struct def, for simplicitly and clarity,
  855. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  856. * neutral. Specifically, the host shall use the get/set macros built
  857. * around the mask + shift defs.
  858. */
  859. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  860. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  861. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  862. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  863. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  864. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  865. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  866. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  867. #define HTT_TX_VDEV_ID_WORD 0
  868. #define HTT_TX_VDEV_ID_MASK 0x3f
  869. #define HTT_TX_VDEV_ID_SHIFT 16
  870. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  871. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  872. #define HTT_TX_MSDU_LEN_DWORD 1
  873. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  874. /*
  875. * HTT_VAR_PADDR macros
  876. * Allow physical / bus addresses to be either a single 32-bit value,
  877. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  878. */
  879. #define HTT_VAR_PADDR32(var_name) \
  880. A_UINT32 var_name
  881. #define HTT_VAR_PADDR64_LE(var_name) \
  882. struct { \
  883. /* little-endian: lo precedes hi */ \
  884. A_UINT32 lo; \
  885. A_UINT32 hi; \
  886. } var_name
  887. /*
  888. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  889. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  890. * addresses are stored in a XXX-bit field.
  891. * This macro is used to define both htt_tx_msdu_desc32_t and
  892. * htt_tx_msdu_desc64_t structs.
  893. */
  894. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  895. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  896. { \
  897. /* DWORD 0: flags and meta-data */ \
  898. A_UINT32 \
  899. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  900. \
  901. /* pkt_subtype - \
  902. * Detailed specification of the tx frame contents, extending the \
  903. * general specification provided by pkt_type. \
  904. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  905. * pkt_type | pkt_subtype \
  906. * ============================================================== \
  907. * 802.3 | bit 0:3 - Reserved \
  908. * | bit 4: 0x0 - Copy-Engine Classification Results \
  909. * | not appended to the HTT message \
  910. * | 0x1 - Copy-Engine Classification Results \
  911. * | appended to the HTT message in the \
  912. * | format: \
  913. * | [HTT tx desc, frame header, \
  914. * | CE classification results] \
  915. * | The CE classification results begin \
  916. * | at the next 4-byte boundary after \
  917. * | the frame header. \
  918. * ------------+------------------------------------------------- \
  919. * Eth2 | bit 0:3 - Reserved \
  920. * | bit 4: 0x0 - Copy-Engine Classification Results \
  921. * | not appended to the HTT message \
  922. * | 0x1 - Copy-Engine Classification Results \
  923. * | appended to the HTT message. \
  924. * | See the above specification of the \
  925. * | CE classification results location. \
  926. * ------------+------------------------------------------------- \
  927. * native WiFi | bit 0:3 - Reserved \
  928. * | bit 4: 0x0 - Copy-Engine Classification Results \
  929. * | not appended to the HTT message \
  930. * | 0x1 - Copy-Engine Classification Results \
  931. * | appended to the HTT message. \
  932. * | See the above specification of the \
  933. * | CE classification results location. \
  934. * ------------+------------------------------------------------- \
  935. * mgmt | 0x0 - 802.11 MAC header absent \
  936. * | 0x1 - 802.11 MAC header present \
  937. * ------------+------------------------------------------------- \
  938. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  939. * | 0x1 - 802.11 MAC header present \
  940. * | bit 1: 0x0 - allow aggregation \
  941. * | 0x1 - don't allow aggregation \
  942. * | bit 2: 0x0 - perform encryption \
  943. * | 0x1 - don't perform encryption \
  944. * | bit 3: 0x0 - perform tx classification / queuing \
  945. * | 0x1 - don't perform tx classification; \
  946. * | insert the frame into the "misc" \
  947. * | tx queue \
  948. * | bit 4: 0x0 - Copy-Engine Classification Results \
  949. * | not appended to the HTT message \
  950. * | 0x1 - Copy-Engine Classification Results \
  951. * | appended to the HTT message. \
  952. * | See the above specification of the \
  953. * | CE classification results location. \
  954. */ \
  955. pkt_subtype: 5, \
  956. \
  957. /* pkt_type - \
  958. * General specification of the tx frame contents. \
  959. * The htt_pkt_type enum should be used to specify and check the \
  960. * value of this field. \
  961. */ \
  962. pkt_type: 3, \
  963. \
  964. /* vdev_id - \
  965. * ID for the vdev that is sending this tx frame. \
  966. * For certain non-standard packet types, e.g. pkt_type == raw \
  967. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  968. * This field is used primarily for determining where to queue \
  969. * broadcast and multicast frames. \
  970. */ \
  971. vdev_id: 6, \
  972. /* ext_tid - \
  973. * The extended traffic ID. \
  974. * If the TID is unknown, the extended TID is set to \
  975. * HTT_TX_EXT_TID_INVALID. \
  976. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  977. * value of the QoS TID. \
  978. * If the tx frame is non-QoS data, then the extended TID is set to \
  979. * HTT_TX_EXT_TID_NON_QOS. \
  980. * If the tx frame is multicast or broadcast, then the extended TID \
  981. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  982. */ \
  983. ext_tid: 5, \
  984. \
  985. /* postponed - \
  986. * This flag indicates whether the tx frame has been downloaded to \
  987. * the target before but discarded by the target, and now is being \
  988. * downloaded again; or if this is a new frame that is being \
  989. * downloaded for the first time. \
  990. * This flag allows the target to determine the correct order for \
  991. * transmitting new vs. old frames. \
  992. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  993. * This flag only applies to HL systems, since in LL systems, \
  994. * the tx flow control is handled entirely within the target. \
  995. */ \
  996. postponed: 1, \
  997. \
  998. /* extension - \
  999. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1000. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1001. * \
  1002. * 0x0 - no extension MSDU descriptor is present \
  1003. * 0x1 - an extension MSDU descriptor immediately follows the \
  1004. * regular MSDU descriptor \
  1005. */ \
  1006. extension: 1, \
  1007. \
  1008. /* cksum_offload - \
  1009. * This flag indicates whether checksum offload is enabled or not \
  1010. * for this frame. Target FW use this flag to turn on HW checksumming \
  1011. * 0x0 - No checksum offload \
  1012. * 0x1 - L3 header checksum only \
  1013. * 0x2 - L4 checksum only \
  1014. * 0x3 - L3 header checksum + L4 checksum \
  1015. */ \
  1016. cksum_offload: 2, \
  1017. \
  1018. /* tx_comp_req - \
  1019. * This flag indicates whether Tx Completion \
  1020. * from fw is required or not. \
  1021. * This flag is only relevant if tx completion is not \
  1022. * universally enabled. \
  1023. * For all LL systems, tx completion is mandatory, \
  1024. * so this flag will be irrelevant. \
  1025. * For HL systems tx completion is optional, but HL systems in which \
  1026. * the bus throughput exceeds the WLAN throughput will \
  1027. * probably want to always use tx completion, and thus \
  1028. * would not check this flag. \
  1029. * This flag is required when tx completions are not used universally, \
  1030. * but are still required for certain tx frames for which \
  1031. * an OTA delivery acknowledgment is needed by the host. \
  1032. * In practice, this would be for HL systems in which the \
  1033. * bus throughput is less than the WLAN throughput. \
  1034. * \
  1035. * 0x0 - Tx Completion Indication from Fw not required \
  1036. * 0x1 - Tx Completion Indication from Fw is required \
  1037. */ \
  1038. tx_compl_req: 1; \
  1039. \
  1040. \
  1041. /* DWORD 1: MSDU length and ID */ \
  1042. A_UINT32 \
  1043. len: 16, /* MSDU length, in bytes */ \
  1044. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1045. * and this id is used to calculate fragmentation \
  1046. * descriptor pointer inside the target based on \
  1047. * the base address, configured inside the target. \
  1048. */ \
  1049. \
  1050. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1051. /* frags_desc_ptr - \
  1052. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1053. * where the tx frame's fragments reside in memory. \
  1054. * This field only applies to LL systems, since in HL systems the \
  1055. * (degenerate single-fragment) fragmentation descriptor is created \
  1056. * within the target. \
  1057. */ \
  1058. _paddr__frags_desc_ptr_; \
  1059. \
  1060. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1061. /* \
  1062. * Peer ID : Target can use this value to know which peer-id packet \
  1063. * destined to. \
  1064. * It's intended to be specified by host in case of NAWDS. \
  1065. */ \
  1066. A_UINT16 peerid; \
  1067. \
  1068. /* \
  1069. * Channel frequency: This identifies the desired channel \
  1070. * frequency (in mhz) for tx frames. This is used by FW to help \
  1071. * determine when it is safe to transmit or drop frames for \
  1072. * off-channel operation. \
  1073. * The default value of zero indicates to FW that the corresponding \
  1074. * VDEV's home channel (if there is one) is the desired channel \
  1075. * frequency. \
  1076. */ \
  1077. A_UINT16 chanfreq; \
  1078. \
  1079. /* Reason reserved is commented is increasing the htt structure size \
  1080. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1081. * A_UINT32 reserved_dword3_bits0_31; \
  1082. */ \
  1083. } POSTPACK
  1084. /* define a htt_tx_msdu_desc32_t type */
  1085. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1086. /* define a htt_tx_msdu_desc64_t type */
  1087. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1088. /*
  1089. * Make htt_tx_msdu_desc_t be an alias for either
  1090. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1091. */
  1092. #if HTT_PADDR64
  1093. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1094. #else
  1095. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1096. #endif
  1097. /* decriptor information for Management frame*/
  1098. /*
  1099. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1100. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1101. */
  1102. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1103. extern A_UINT32 mgmt_hdr_len;
  1104. PREPACK struct htt_mgmt_tx_desc_t {
  1105. A_UINT32 msg_type;
  1106. #if HTT_PADDR64
  1107. A_UINT64 frag_paddr; /* DMAble address of the data */
  1108. #else
  1109. A_UINT32 frag_paddr; /* DMAble address of the data */
  1110. #endif
  1111. A_UINT32 desc_id; /* returned to host during completion
  1112. * to free the meory*/
  1113. A_UINT32 len; /* Fragment length */
  1114. A_UINT32 vdev_id; /* virtual device ID*/
  1115. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1116. } POSTPACK;
  1117. PREPACK struct htt_mgmt_tx_compl_ind {
  1118. A_UINT32 desc_id;
  1119. A_UINT32 status;
  1120. } POSTPACK;
  1121. /*
  1122. * This SDU header size comes from the summation of the following:
  1123. * 1. Max of:
  1124. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1125. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1126. * b. 802.11 header, for raw frames: 36 bytes
  1127. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1128. * QoS header, HT header)
  1129. * c. 802.3 header, for ethernet frames: 14 bytes
  1130. * (destination address, source address, ethertype / length)
  1131. * 2. Max of:
  1132. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1133. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1134. * 3. 802.1Q VLAN header: 4 bytes
  1135. * 4. LLC/SNAP header: 8 bytes
  1136. */
  1137. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1138. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1139. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1140. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1141. A_COMPILE_TIME_ASSERT(
  1142. htt_encap_hdr_size_max_check_nwifi,
  1143. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1144. A_COMPILE_TIME_ASSERT(
  1145. htt_encap_hdr_size_max_check_enet,
  1146. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1147. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1148. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1149. #define HTT_TX_HDR_SIZE_802_1Q 4
  1150. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1151. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1152. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1153. HTT_TX_HDR_SIZE_802_1Q + \
  1154. HTT_TX_HDR_SIZE_LLC_SNAP)
  1155. #define HTT_HL_TX_FRM_HDR_LEN \
  1156. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1157. #define HTT_LL_TX_FRM_HDR_LEN \
  1158. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1159. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1160. /* dword 0 */
  1161. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1162. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1163. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1164. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1165. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1166. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1167. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1168. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1169. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1170. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1171. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1172. #define HTT_TX_DESC_PKT_TYPE_S 13
  1173. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1174. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1175. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1176. #define HTT_TX_DESC_VDEV_ID_S 16
  1177. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1178. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1179. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1180. #define HTT_TX_DESC_EXT_TID_S 22
  1181. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1182. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1183. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1184. #define HTT_TX_DESC_POSTPONED_S 27
  1185. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1186. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1187. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1188. #define HTT_TX_DESC_EXTENSION_S 28
  1189. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1190. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1191. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1192. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1193. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1194. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1195. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1196. #define HTT_TX_DESC_TX_COMP_S 31
  1197. /* dword 1 */
  1198. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1199. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1200. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1201. #define HTT_TX_DESC_FRM_LEN_S 0
  1202. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1203. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1204. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1205. #define HTT_TX_DESC_FRM_ID_S 16
  1206. /* dword 2 */
  1207. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1208. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1209. /* for systems using 64-bit format for bus addresses */
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1211. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1212. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1213. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1214. /* for systems using 32-bit format for bus addresses */
  1215. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1216. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1217. /* dword 3 */
  1218. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1219. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1220. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1221. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1222. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1223. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1224. #if HTT_PADDR64
  1225. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1226. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1227. #else
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1229. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1230. #endif
  1231. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1232. #define HTT_TX_DESC_PEER_ID_S 0
  1233. /*
  1234. * TEMPORARY:
  1235. * The original definitions for the PEER_ID fields contained typos
  1236. * (with _DESC_PADDR appended to this PEER_ID field name).
  1237. * Retain deprecated original names for PEER_ID fields until all code that
  1238. * refers to them has been updated.
  1239. */
  1240. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1241. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1242. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1243. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1244. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1245. HTT_TX_DESC_PEER_ID_M
  1246. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1247. HTT_TX_DESC_PEER_ID_S
  1248. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1249. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1250. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1251. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1252. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1253. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1254. #if HTT_PADDR64
  1255. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1256. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1257. #else
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1259. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1260. #endif
  1261. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1262. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1263. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1264. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1265. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1269. } while (0)
  1270. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1271. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1272. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1276. } while (0)
  1277. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1278. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1279. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1283. } while (0)
  1284. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1285. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1286. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1290. } while (0)
  1291. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1292. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1293. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1297. } while (0)
  1298. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1299. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1300. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1304. } while (0)
  1305. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1306. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1307. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1311. } while (0)
  1312. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1313. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1314. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1318. } while (0)
  1319. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1320. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1321. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1322. do { \
  1323. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1324. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1325. } while (0)
  1326. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1327. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1328. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1332. } while (0)
  1333. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1334. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1335. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1339. } while (0)
  1340. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1341. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1342. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1346. } while (0)
  1347. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1348. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1349. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1350. do { \
  1351. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1352. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1353. } while (0)
  1354. /* enums used in the HTT tx MSDU extension descriptor */
  1355. enum {
  1356. htt_tx_guard_interval_regular = 0,
  1357. htt_tx_guard_interval_short = 1,
  1358. };
  1359. enum {
  1360. htt_tx_preamble_type_ofdm = 0,
  1361. htt_tx_preamble_type_cck = 1,
  1362. htt_tx_preamble_type_ht = 2,
  1363. htt_tx_preamble_type_vht = 3,
  1364. };
  1365. enum {
  1366. htt_tx_bandwidth_5MHz = 0,
  1367. htt_tx_bandwidth_10MHz = 1,
  1368. htt_tx_bandwidth_20MHz = 2,
  1369. htt_tx_bandwidth_40MHz = 3,
  1370. htt_tx_bandwidth_80MHz = 4,
  1371. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1372. };
  1373. /**
  1374. * @brief HTT tx MSDU extension descriptor
  1375. * @details
  1376. * If the target supports HTT tx MSDU extension descriptors, the host has
  1377. * the option of appending the following struct following the regular
  1378. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1379. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1380. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1381. * tx specs for each frame.
  1382. */
  1383. PREPACK struct htt_tx_msdu_desc_ext_t {
  1384. /* DWORD 0: flags */
  1385. A_UINT32
  1386. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1387. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1388. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1389. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1390. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1391. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1392. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1393. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1394. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1395. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1396. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1397. /* DWORD 1: tx power, tx rate, tx BW */
  1398. A_UINT32
  1399. /* pwr -
  1400. * Specify what power the tx frame needs to be transmitted at.
  1401. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1402. * The value needs to be appropriately sign-extended when extracting
  1403. * the value from the message and storing it in a variable that is
  1404. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1405. * automatically handles this sign-extension.)
  1406. * If the transmission uses multiple tx chains, this power spec is
  1407. * the total transmit power, assuming incoherent combination of
  1408. * per-chain power to produce the total power.
  1409. */
  1410. pwr: 8,
  1411. /* mcs_mask -
  1412. * Specify the allowable values for MCS index (modulation and coding)
  1413. * to use for transmitting the frame.
  1414. *
  1415. * For HT / VHT preamble types, this mask directly corresponds to
  1416. * the HT or VHT MCS indices that are allowed. For each bit N set
  1417. * within the mask, MCS index N is allowed for transmitting the frame.
  1418. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1419. * rates versus OFDM rates, so the host has the option of specifying
  1420. * that the target must transmit the frame with CCK or OFDM rates
  1421. * (not HT or VHT), but leaving the decision to the target whether
  1422. * to use CCK or OFDM.
  1423. *
  1424. * For CCK and OFDM, the bits within this mask are interpreted as
  1425. * follows:
  1426. * bit 0 -> CCK 1 Mbps rate is allowed
  1427. * bit 1 -> CCK 2 Mbps rate is allowed
  1428. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1429. * bit 3 -> CCK 11 Mbps rate is allowed
  1430. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1431. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1432. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1433. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1434. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1435. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1436. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1437. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1438. *
  1439. * The MCS index specification needs to be compatible with the
  1440. * bandwidth mask specification. For example, a MCS index == 9
  1441. * specification is inconsistent with a preamble type == VHT,
  1442. * Nss == 1, and channel bandwidth == 20 MHz.
  1443. *
  1444. * Furthermore, the host has only a limited ability to specify to
  1445. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1446. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1447. */
  1448. mcs_mask: 12,
  1449. /* nss_mask -
  1450. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1451. * Each bit in this mask corresponds to a Nss value:
  1452. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1453. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1454. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1455. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1456. * The values in the Nss mask must be suitable for the recipient, e.g.
  1457. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1458. * recipient which only supports 2x2 MIMO.
  1459. */
  1460. nss_mask: 4,
  1461. /* guard_interval -
  1462. * Specify a htt_tx_guard_interval enum value to indicate whether
  1463. * the transmission should use a regular guard interval or a
  1464. * short guard interval.
  1465. */
  1466. guard_interval: 1,
  1467. /* preamble_type_mask -
  1468. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1469. * may choose from for transmitting this frame.
  1470. * The bits in this mask correspond to the values in the
  1471. * htt_tx_preamble_type enum. For example, to allow the target
  1472. * to transmit the frame as either CCK or OFDM, this field would
  1473. * be set to
  1474. * (1 << htt_tx_preamble_type_ofdm) |
  1475. * (1 << htt_tx_preamble_type_cck)
  1476. */
  1477. preamble_type_mask: 4,
  1478. reserved1_31_29: 3; /* unused, set to 0x0 */
  1479. /* DWORD 2: tx chain mask, tx retries */
  1480. A_UINT32
  1481. /* chain_mask - specify which chains to transmit from */
  1482. chain_mask: 4,
  1483. /* retry_limit -
  1484. * Specify the maximum number of transmissions, including the
  1485. * initial transmission, to attempt before giving up if no ack
  1486. * is received.
  1487. * If the tx rate is specified, then all retries shall use the
  1488. * same rate as the initial transmission.
  1489. * If no tx rate is specified, the target can choose whether to
  1490. * retain the original rate during the retransmissions, or to
  1491. * fall back to a more robust rate.
  1492. */
  1493. retry_limit: 4,
  1494. /* bandwidth_mask -
  1495. * Specify what channel widths may be used for the transmission.
  1496. * A value of zero indicates "don't care" - the target may choose
  1497. * the transmission bandwidth.
  1498. * The bits within this mask correspond to the htt_tx_bandwidth
  1499. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1500. * The bandwidth_mask must be consistent with the preamble_type_mask
  1501. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1502. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1503. */
  1504. bandwidth_mask: 6,
  1505. reserved2_31_14: 18; /* unused, set to 0x0 */
  1506. /* DWORD 3: tx expiry time (TSF) LSBs */
  1507. A_UINT32 expire_tsf_lo;
  1508. /* DWORD 4: tx expiry time (TSF) MSBs */
  1509. A_UINT32 expire_tsf_hi;
  1510. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1511. } POSTPACK;
  1512. /* DWORD 0 */
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1533. /* DWORD 1 */
  1534. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1535. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1536. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1537. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1538. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1539. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1540. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1541. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1542. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1543. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1544. /* DWORD 2 */
  1545. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1546. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1547. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1548. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1549. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1550. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1551. /* DWORD 0 */
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1558. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1559. } while (0)
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1561. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1562. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1564. do { \
  1565. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1566. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1567. } while (0)
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1569. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1570. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1572. do { \
  1573. HTT_CHECK_SET_VAL( \
  1574. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1575. ((_var) |= ((_val) \
  1576. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1577. } while (0)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1579. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1580. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL( \
  1584. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1585. ((_var) |= ((_val) \
  1586. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1594. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1595. } while (0)
  1596. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1598. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1599. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1602. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1606. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1607. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1614. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1618. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1619. } while (0)
  1620. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1622. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1623. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1626. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1627. } while (0)
  1628. /* DWORD 1 */
  1629. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1631. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1632. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1633. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1634. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1635. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1636. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1637. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1638. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1640. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1641. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1645. } while (0)
  1646. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1648. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1649. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1650. do { \
  1651. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1652. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1653. } while (0)
  1654. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1655. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1656. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1657. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1658. do { \
  1659. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1660. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1661. } while (0)
  1662. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1664. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1665. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1668. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1669. } while (0)
  1670. /* DWORD 2 */
  1671. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1673. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1674. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1681. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1682. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1689. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1690. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1694. } while (0)
  1695. typedef enum {
  1696. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1697. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1698. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1699. } htt_11ax_ltf_subtype_t;
  1700. typedef enum {
  1701. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1702. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1703. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1704. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1705. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1706. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1707. } htt_tx_ext2_preamble_type_t;
  1708. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1709. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1719. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1720. /**
  1721. * @brief HTT tx MSDU extension descriptor v2
  1722. * @details
  1723. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1724. * is received as tcl_exit_base->host_meta_info in firmware.
  1725. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1726. * are already part of tcl_exit_base.
  1727. */
  1728. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1729. /* DWORD 0: flags */
  1730. A_UINT32
  1731. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1732. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1733. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1734. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1735. valid_retries : 1, /* if set, tx retries spec is valid */
  1736. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1737. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1738. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1739. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1740. valid_key_flags : 1, /* if set, key flags is valid */
  1741. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1742. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1743. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1744. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1745. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1746. 1 = ENCRYPT,
  1747. 2 ~ 3 - Reserved */
  1748. /* retry_limit -
  1749. * Specify the maximum number of transmissions, including the
  1750. * initial transmission, to attempt before giving up if no ack
  1751. * is received.
  1752. * If the tx rate is specified, then all retries shall use the
  1753. * same rate as the initial transmission.
  1754. * If no tx rate is specified, the target can choose whether to
  1755. * retain the original rate during the retransmissions, or to
  1756. * fall back to a more robust rate.
  1757. */
  1758. retry_limit : 4,
  1759. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1760. * Valid only for 11ax preamble types HE_SU
  1761. * and HE_EXT_SU
  1762. */
  1763. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1764. * Valid only for 11ax preamble types HE_SU
  1765. * and HE_EXT_SU
  1766. */
  1767. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1768. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1769. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1770. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1771. */
  1772. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1773. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1774. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1775. * Use cases:
  1776. * Any time firmware uses TQM-BYPASS for Data
  1777. * TID, firmware expect host to set this bit.
  1778. */
  1779. /* DWORD 1: tx power, tx rate */
  1780. A_UINT32
  1781. power : 8, /* unit of the power field is 0.5 dbm
  1782. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1783. * signed value ranging from -64dbm to 63.5 dbm
  1784. */
  1785. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1786. * Setting more than one MCS isn't currently
  1787. * supported by the target (but is supported
  1788. * in the interface in case in the future
  1789. * the target supports specifications of
  1790. * a limited set of MCS values.
  1791. */
  1792. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1793. * Setting more than one Nss isn't currently
  1794. * supported by the target (but is supported
  1795. * in the interface in case in the future
  1796. * the target supports specifications of
  1797. * a limited set of Nss values.
  1798. */
  1799. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1800. update_peer_cache : 1; /* When set these custom values will be
  1801. * used for all packets, until the next
  1802. * update via this ext header.
  1803. * This is to make sure not all packets
  1804. * need to include this header.
  1805. */
  1806. /* DWORD 2: tx chain mask, tx retries */
  1807. A_UINT32
  1808. /* chain_mask - specify which chains to transmit from */
  1809. chain_mask : 8,
  1810. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1811. * TODO: Update Enum values for key_flags
  1812. */
  1813. /*
  1814. * Channel frequency: This identifies the desired channel
  1815. * frequency (in MHz) for tx frames. This is used by FW to help
  1816. * determine when it is safe to transmit or drop frames for
  1817. * off-channel operation.
  1818. * The default value of zero indicates to FW that the corresponding
  1819. * VDEV's home channel (if there is one) is the desired channel
  1820. * frequency.
  1821. */
  1822. chanfreq : 16;
  1823. /* DWORD 3: tx expiry time (TSF) LSBs */
  1824. A_UINT32 expire_tsf_lo;
  1825. /* DWORD 4: tx expiry time (TSF) MSBs */
  1826. A_UINT32 expire_tsf_hi;
  1827. /* DWORD 5: flags to control routing / processing of the MSDU */
  1828. A_UINT32
  1829. /* learning_frame
  1830. * When this flag is set, this frame will be dropped by FW
  1831. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1832. */
  1833. learning_frame : 1,
  1834. /* send_as_standalone
  1835. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1836. * i.e. with no A-MSDU or A-MPDU aggregation.
  1837. * The scope is extended to other use-cases.
  1838. */
  1839. send_as_standalone : 1,
  1840. /* is_host_opaque_valid
  1841. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1842. * with valid information.
  1843. */
  1844. is_host_opaque_valid : 1,
  1845. traffic_end_indication: 1,
  1846. rsvd0 : 28;
  1847. /* DWORD 6 : Host opaque cookie for special frames */
  1848. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1849. rsvd1 : 16;
  1850. /*
  1851. * This structure can be expanded further up to 40 bytes
  1852. * by adding further DWORDs as needed.
  1853. */
  1854. } POSTPACK;
  1855. /* DWORD 0 */
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1882. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1883. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1884. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1885. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1886. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1887. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1888. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1889. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1890. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1891. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1892. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1893. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1894. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1895. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1896. /* DWORD 1 */
  1897. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1898. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1899. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1900. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1901. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1902. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1903. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1904. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1905. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1906. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1907. /* DWORD 2 */
  1908. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1909. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1910. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1911. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1912. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1913. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1914. /* DWORD 5 */
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1921. /* DWORD 6 */
  1922. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1923. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1924. /* DWORD 0 */
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1932. } while (0)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1934. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1935. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1939. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL( \
  1955. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1956. ((_var) |= ((_val) \
  1957. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1974. } while (0)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL( \
  1981. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1982. ((_var) |= ((_val) \
  1983. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1984. } while (0)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1986. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1987. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1992. } while (0)
  1993. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1994. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1995. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1999. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2000. } while (0)
  2001. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2002. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2003. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2008. } while (0)
  2009. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2010. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2011. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2016. } while (0)
  2017. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2018. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2019. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2020. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2024. } while (0)
  2025. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2026. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2027. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2028. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2032. } while (0)
  2033. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2034. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2035. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2036. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2040. } while (0)
  2041. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2042. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2043. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2044. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2045. do { \
  2046. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2047. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2048. } while (0)
  2049. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2050. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2051. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2052. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2053. do { \
  2054. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2055. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2056. } while (0)
  2057. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2072. } while (0)
  2073. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2075. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2076. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2080. } while (0)
  2081. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2082. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2083. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2084. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2088. } while (0)
  2089. /* DWORD 1 */
  2090. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2091. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2092. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2093. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2094. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2095. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2096. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2097. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2098. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2099. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2100. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2101. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2102. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2106. } while (0)
  2107. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2108. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2109. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2110. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2111. do { \
  2112. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2113. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2114. } while (0)
  2115. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2116. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2117. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2118. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2119. do { \
  2120. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2121. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2122. } while (0)
  2123. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2124. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2125. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2126. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2127. do { \
  2128. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2129. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2130. } while (0)
  2131. /* DWORD 2 */
  2132. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2133. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2134. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2135. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2139. } while (0)
  2140. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2141. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2142. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2143. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2144. do { \
  2145. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2146. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2147. } while (0)
  2148. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2149. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2150. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2151. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2154. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2155. } while (0)
  2156. /* DWORD 5 */
  2157. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2158. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2159. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2160. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2164. } while (0)
  2165. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2166. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2167. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2168. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2169. do { \
  2170. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2171. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2172. } while (0)
  2173. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2174. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2175. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2176. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2180. } while (0)
  2181. /* DWORD 6 */
  2182. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2183. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2184. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2185. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2186. do { \
  2187. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2188. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2189. } while (0)
  2190. typedef enum {
  2191. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2192. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2193. } htt_tcl_metadata_type;
  2194. /**
  2195. * @brief HTT TCL command number format
  2196. * @details
  2197. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2198. * available to firmware as tcl_exit_base->tcl_status_number.
  2199. * For regular / multicast packets host will send vdev and mac id and for
  2200. * NAWDS packets, host will send peer id.
  2201. * A_UINT32 is used to avoid endianness conversion problems.
  2202. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2203. */
  2204. typedef struct {
  2205. A_UINT32
  2206. type: 1, /* vdev_id based or peer_id based */
  2207. rsvd: 31;
  2208. } htt_tx_tcl_vdev_or_peer_t;
  2209. typedef struct {
  2210. A_UINT32
  2211. type: 1, /* vdev_id based or peer_id based */
  2212. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2213. vdev_id: 8,
  2214. pdev_id: 2,
  2215. host_inspected:1,
  2216. rsvd: 19;
  2217. } htt_tx_tcl_vdev_metadata;
  2218. typedef struct {
  2219. A_UINT32
  2220. type: 1, /* vdev_id based or peer_id based */
  2221. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2222. peer_id: 14,
  2223. rsvd: 16;
  2224. } htt_tx_tcl_peer_metadata;
  2225. PREPACK struct htt_tx_tcl_metadata {
  2226. union {
  2227. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2228. htt_tx_tcl_vdev_metadata vdev_meta;
  2229. htt_tx_tcl_peer_metadata peer_meta;
  2230. };
  2231. } POSTPACK;
  2232. /* DWORD 0 */
  2233. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2234. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2235. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2236. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2237. /* VDEV metadata */
  2238. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2239. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2240. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2241. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2242. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2243. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2244. /* PEER metadata */
  2245. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2246. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2247. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2248. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2249. HTT_TX_TCL_METADATA_TYPE_S)
  2250. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2251. do { \
  2252. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2253. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2254. } while (0)
  2255. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2256. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2257. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2258. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2262. } while (0)
  2263. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2264. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2265. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2266. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2270. } while (0)
  2271. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2272. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2273. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2274. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2278. } while (0)
  2279. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2280. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2281. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2282. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2286. } while (0)
  2287. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2288. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2289. HTT_TX_TCL_METADATA_PEER_ID_S)
  2290. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2291. do { \
  2292. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2293. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2294. } while (0)
  2295. /*------------------------------------------------------------------
  2296. * V2 Version of TCL Data Command
  2297. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2298. * MLO global_seq all flavours of TCL Data Cmd.
  2299. *-----------------------------------------------------------------*/
  2300. typedef enum {
  2301. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2302. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2303. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2304. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2305. } htt_tcl_metadata_type_v2;
  2306. /**
  2307. * @brief HTT TCL command number format
  2308. * @details
  2309. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2310. * available to firmware as tcl_exit_base->tcl_status_number.
  2311. * A_UINT32 is used to avoid endianness conversion problems.
  2312. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2313. */
  2314. typedef struct {
  2315. A_UINT32
  2316. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2317. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2318. vdev_id: 8,
  2319. pdev_id: 2,
  2320. host_inspected:1,
  2321. rsvd: 2,
  2322. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2323. } htt_tx_tcl_vdev_metadata_v2;
  2324. typedef struct {
  2325. A_UINT32
  2326. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2327. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2328. peer_id: 13,
  2329. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2330. } htt_tx_tcl_peer_metadata_v2;
  2331. typedef struct {
  2332. A_UINT32
  2333. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2334. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2335. svc_class_id: 8,
  2336. rsvd: 5,
  2337. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2338. } htt_tx_tcl_svc_class_id_metadata;
  2339. typedef struct {
  2340. A_UINT32
  2341. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2342. host_inspected: 1,
  2343. global_seq_no: 12,
  2344. rsvd: 1,
  2345. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2346. } htt_tx_tcl_global_seq_metadata;
  2347. PREPACK struct htt_tx_tcl_metadata_v2 {
  2348. union {
  2349. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2350. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2351. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2352. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2353. };
  2354. } POSTPACK;
  2355. /* DWORD 0 */
  2356. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2357. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2358. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2359. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2360. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2361. /* VDEV V2 metadata */
  2362. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2363. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2364. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2365. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2366. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2367. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2368. /* PEER V2 metadata */
  2369. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2370. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2371. /* SVC_CLASS_ID metadata */
  2372. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2373. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2374. /* Global Seq no metadata */
  2375. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2376. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2377. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2378. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2379. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2380. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2381. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2382. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2383. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2384. do { \
  2385. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2386. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2387. } while (0)
  2388. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2389. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2390. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2391. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2392. do { \
  2393. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2394. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2395. } while (0)
  2396. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2397. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2398. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2399. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2400. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2403. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2404. } while (0)
  2405. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2406. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2407. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2408. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2409. do { \
  2410. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2411. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2412. } while (0)
  2413. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2414. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2415. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2416. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2417. do { \
  2418. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2419. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2420. } while (0)
  2421. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2422. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2423. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2424. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2425. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2429. } while (0)
  2430. /*----- Get and Set V2 type field in Service Class fields ----*/
  2431. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2432. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2433. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2434. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2438. } while (0)
  2439. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2440. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2441. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2442. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2443. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2447. } while (0)
  2448. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2449. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2450. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2451. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2455. } while (0)
  2456. /*------------------------------------------------------------------
  2457. * End V2 Version of TCL Data Command
  2458. *-----------------------------------------------------------------*/
  2459. typedef enum {
  2460. HTT_TX_FW2WBM_TX_STATUS_OK,
  2461. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2462. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2463. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2464. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2465. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2466. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2467. HTT_TX_FW2WBM_TX_STATUS_MAX
  2468. } htt_tx_fw2wbm_tx_status_t;
  2469. typedef enum {
  2470. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2471. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2472. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2473. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2474. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2475. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2476. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2477. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2478. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2479. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2480. } htt_tx_fw2wbm_reinject_reason_t;
  2481. /**
  2482. * @brief HTT TX WBM Completion from firmware to host
  2483. * @details
  2484. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2485. * DWORD 3 and 4 for software based completions (Exception frames and
  2486. * TQM bypass frames)
  2487. * For software based completions, wbm_release_ring->release_source_module will
  2488. * be set to release_source_fw
  2489. */
  2490. PREPACK struct htt_tx_wbm_completion {
  2491. A_UINT32
  2492. sch_cmd_id: 24,
  2493. exception_frame: 1, /* If set, this packet was queued via exception path */
  2494. rsvd0_31_25: 7;
  2495. A_UINT32
  2496. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2497. * reception of an ACK or BA, this field indicates
  2498. * the RSSI of the received ACK or BA frame.
  2499. * When the frame is removed as result of a direct
  2500. * remove command from the SW, this field is set
  2501. * to 0x0 (which is never a valid value when real
  2502. * RSSI is available).
  2503. * Units: dB w.r.t noise floor
  2504. */
  2505. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2506. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2507. rsvd1_31_16: 16;
  2508. } POSTPACK;
  2509. /* DWORD 0 */
  2510. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2511. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2512. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2513. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2514. /* DWORD 1 */
  2515. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2516. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2517. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2518. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2519. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2520. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2521. /* DWORD 0 */
  2522. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2523. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2524. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2525. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2526. do { \
  2527. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2528. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2529. } while (0)
  2530. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2531. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2532. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2533. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2534. do { \
  2535. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2536. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2537. } while (0)
  2538. /* DWORD 1 */
  2539. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2540. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2541. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2542. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2545. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2546. } while (0)
  2547. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2548. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2549. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2550. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2551. do { \
  2552. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2553. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2554. } while (0)
  2555. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2556. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2557. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2558. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2559. do { \
  2560. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2561. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2562. } while (0)
  2563. /**
  2564. * @brief HTT TX WBM Completion from firmware to host
  2565. * @details
  2566. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2567. * (WBM) offload HW.
  2568. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2569. * For software based completions, release_source_module will
  2570. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2571. * struct wbm_release_ring and then switch to this after looking at
  2572. * release_source_module.
  2573. */
  2574. PREPACK struct htt_tx_wbm_completion_v2 {
  2575. A_UINT32
  2576. used_by_hw0; /* Refer to struct wbm_release_ring */
  2577. A_UINT32
  2578. used_by_hw1; /* Refer to struct wbm_release_ring */
  2579. A_UINT32
  2580. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2581. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2582. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2583. exception_frame: 1,
  2584. rsvd0: 12, /* For future use */
  2585. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2586. rsvd1: 1; /* For future use */
  2587. A_UINT32
  2588. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2589. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2590. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2591. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2592. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2593. */
  2594. A_UINT32
  2595. data1: 32;
  2596. A_UINT32
  2597. data2: 32;
  2598. A_UINT32
  2599. used_by_hw3; /* Refer to struct wbm_release_ring */
  2600. } POSTPACK;
  2601. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2602. /* DWORD 3 */
  2603. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2604. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2605. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2606. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2607. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2608. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2609. /* DWORD 3 */
  2610. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2611. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2612. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2613. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2614. do { \
  2615. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2616. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2617. } while (0)
  2618. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2619. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2620. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2621. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2622. do { \
  2623. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2624. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2625. } while (0)
  2626. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2627. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2628. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2629. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2630. do { \
  2631. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2632. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2633. } while (0)
  2634. /**
  2635. * @brief HTT TX WBM Completion from firmware to host (V3)
  2636. * @details
  2637. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2638. * (WBM) offload HW.
  2639. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2640. * For software based completions, release_source_module will
  2641. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2642. * struct wbm_release_ring and then switch to this after looking at
  2643. * release_source_module.
  2644. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2645. * by new generations of targets.
  2646. */
  2647. PREPACK struct htt_tx_wbm_completion_v3 {
  2648. A_UINT32
  2649. used_by_hw0; /* Refer to struct wbm_release_ring */
  2650. A_UINT32
  2651. used_by_hw1; /* Refer to struct wbm_release_ring */
  2652. A_UINT32
  2653. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2654. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2655. used_by_hw3: 15;
  2656. A_UINT32
  2657. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2658. exception_frame: 1,
  2659. rsvd0: 27; /* For future use */
  2660. A_UINT32
  2661. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2662. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2663. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2664. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2665. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2666. */
  2667. A_UINT32
  2668. data1: 32;
  2669. A_UINT32
  2670. data2: 32;
  2671. A_UINT32
  2672. rsvd1: 20,
  2673. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2674. } POSTPACK;
  2675. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2676. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2677. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2678. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2679. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2680. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2681. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2682. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2683. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2684. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2685. do { \
  2686. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2687. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2688. } while (0)
  2689. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2690. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2691. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2692. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2693. do { \
  2694. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2695. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2696. } while (0)
  2697. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2698. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2699. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2700. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2701. do { \
  2702. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2703. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2704. } while (0)
  2705. typedef enum {
  2706. TX_FRAME_TYPE_UNDEFINED = 0,
  2707. TX_FRAME_TYPE_EAPOL = 1,
  2708. } htt_tx_wbm_status_frame_type;
  2709. /**
  2710. * @brief HTT TX WBM transmit status from firmware to host
  2711. * @details
  2712. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2713. * (WBM) offload HW.
  2714. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2715. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2716. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2717. */
  2718. PREPACK struct htt_tx_wbm_transmit_status {
  2719. A_UINT32
  2720. sch_cmd_id: 24,
  2721. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2722. * reception of an ACK or BA, this field indicates
  2723. * the RSSI of the received ACK or BA frame.
  2724. * When the frame is removed as result of a direct
  2725. * remove command from the SW, this field is set
  2726. * to 0x0 (which is never a valid value when real
  2727. * RSSI is available).
  2728. * Units: dB w.r.t noise floor
  2729. */
  2730. A_UINT32
  2731. sw_peer_id: 16,
  2732. tid_num: 5,
  2733. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2734. * and tid_num fields contain valid data.
  2735. * If this "valid" flag is not set, the
  2736. * sw_peer_id and tid_num fields must be ignored.
  2737. */
  2738. mcast: 1,
  2739. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2740. * contains valid data.
  2741. */
  2742. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2743. reserved: 4;
  2744. A_UINT32
  2745. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2746. * packets in the wbm completion path
  2747. */
  2748. } POSTPACK;
  2749. /* DWORD 4 */
  2750. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2751. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2752. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2753. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2754. /* DWORD 5 */
  2755. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2756. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2757. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2758. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2759. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2760. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2761. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2762. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2763. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2764. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2765. /* DWORD 4 */
  2766. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2767. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2768. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2769. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2770. do { \
  2771. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2772. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2773. } while (0)
  2774. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2775. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2776. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2777. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2778. do { \
  2779. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2780. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2781. } while (0)
  2782. /* DWORD 5 */
  2783. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2784. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2785. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2786. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2789. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2790. } while (0)
  2791. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2792. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2793. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2794. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2797. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2798. } while (0)
  2799. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2800. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2801. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2802. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2805. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2806. } while (0)
  2807. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2808. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2809. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2810. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2811. do { \
  2812. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2813. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2814. } while (0)
  2815. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2816. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2817. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2818. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2819. do { \
  2820. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2821. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2822. } while (0)
  2823. /**
  2824. * @brief HTT TX WBM reinject status from firmware to host
  2825. * @details
  2826. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2827. * (WBM) offload HW.
  2828. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2829. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2830. */
  2831. PREPACK struct htt_tx_wbm_reinject_status {
  2832. A_UINT32
  2833. reserved0: 32;
  2834. A_UINT32
  2835. reserved1: 32;
  2836. A_UINT32
  2837. reserved2: 32;
  2838. } POSTPACK;
  2839. /**
  2840. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2841. * @details
  2842. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2843. * (WBM) offload HW.
  2844. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2845. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2846. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2847. * STA side.
  2848. */
  2849. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2850. A_UINT32
  2851. mec_sa_addr_31_0;
  2852. A_UINT32
  2853. mec_sa_addr_47_32: 16,
  2854. sa_ast_index: 16;
  2855. A_UINT32
  2856. vdev_id: 8,
  2857. reserved0: 24;
  2858. } POSTPACK;
  2859. /* DWORD 4 - mec_sa_addr_31_0 */
  2860. /* DWORD 5 */
  2861. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2862. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2863. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2864. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2865. /* DWORD 6 */
  2866. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2867. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2868. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2869. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2870. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2871. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2874. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2875. } while (0)
  2876. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2877. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2878. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2879. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2880. do { \
  2881. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2882. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2883. } while (0)
  2884. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2885. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2886. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2887. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2890. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2891. } while (0)
  2892. typedef enum {
  2893. TX_FLOW_PRIORITY_BE,
  2894. TX_FLOW_PRIORITY_HIGH,
  2895. TX_FLOW_PRIORITY_LOW,
  2896. } htt_tx_flow_priority_t;
  2897. typedef enum {
  2898. TX_FLOW_LATENCY_SENSITIVE,
  2899. TX_FLOW_LATENCY_INSENSITIVE,
  2900. } htt_tx_flow_latency_t;
  2901. typedef enum {
  2902. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2903. TX_FLOW_INTERACTIVE_TRAFFIC,
  2904. TX_FLOW_PERIODIC_TRAFFIC,
  2905. TX_FLOW_BURSTY_TRAFFIC,
  2906. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2907. } htt_tx_flow_traffic_pattern_t;
  2908. /**
  2909. * @brief HTT TX Flow search metadata format
  2910. * @details
  2911. * Host will set this metadata in flow table's flow search entry along with
  2912. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2913. * firmware and TQM ring if the flow search entry wins.
  2914. * This metadata is available to firmware in that first MSDU's
  2915. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2916. * to one of the available flows for specific tid and returns the tqm flow
  2917. * pointer as part of htt_tx_map_flow_info message.
  2918. */
  2919. PREPACK struct htt_tx_flow_metadata {
  2920. A_UINT32
  2921. rsvd0_1_0: 2,
  2922. tid: 4,
  2923. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2924. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2925. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2926. * Else choose final tid based on latency, priority.
  2927. */
  2928. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2929. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2930. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2931. } POSTPACK;
  2932. /* DWORD 0 */
  2933. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2934. #define HTT_TX_FLOW_METADATA_TID_S 2
  2935. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2936. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2937. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2938. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2939. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2940. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2941. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2942. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2943. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2944. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2945. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2946. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2947. /* DWORD 0 */
  2948. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2949. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2950. HTT_TX_FLOW_METADATA_TID_S)
  2951. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2952. do { \
  2953. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2954. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2955. } while (0)
  2956. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2957. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2958. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2959. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2960. do { \
  2961. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2962. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2963. } while (0)
  2964. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2965. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2966. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2967. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2968. do { \
  2969. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2970. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2971. } while (0)
  2972. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2973. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2974. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2975. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2976. do { \
  2977. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2978. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2979. } while (0)
  2980. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2981. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2982. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2983. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2986. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2987. } while (0)
  2988. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2989. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2990. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2991. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2992. do { \
  2993. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2994. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2995. } while (0)
  2996. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2997. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2998. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2999. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3000. do { \
  3001. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3002. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3003. } while (0)
  3004. /**
  3005. * @brief host -> target ADD WDS Entry
  3006. *
  3007. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3008. *
  3009. * @brief host -> target DELETE WDS Entry
  3010. *
  3011. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3012. *
  3013. * @details
  3014. * HTT wds entry from source port learning
  3015. * Host will learn wds entries from rx and send this message to firmware
  3016. * to enable firmware to configure/delete AST entries for wds clients.
  3017. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3018. * and when SA's entry is deleted, firmware removes this AST entry
  3019. *
  3020. * The message would appear as follows:
  3021. *
  3022. * |31 30|29 |17 16|15 8|7 0|
  3023. * |----------------+----------------+----------------+----------------|
  3024. * | rsvd0 |PDVID| vdev_id | msg_type |
  3025. * |-------------------------------------------------------------------|
  3026. * | sa_addr_31_0 |
  3027. * |-------------------------------------------------------------------|
  3028. * | | ta_peer_id | sa_addr_47_32 |
  3029. * |-------------------------------------------------------------------|
  3030. * Where PDVID = pdev_id
  3031. *
  3032. * The message is interpreted as follows:
  3033. *
  3034. * dword0 - b'0:7 - msg_type: This will be set to
  3035. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3036. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3037. *
  3038. * dword0 - b'8:15 - vdev_id
  3039. *
  3040. * dword0 - b'16:17 - pdev_id
  3041. *
  3042. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3043. *
  3044. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3045. *
  3046. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3047. *
  3048. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3049. */
  3050. PREPACK struct htt_wds_entry {
  3051. A_UINT32
  3052. msg_type: 8,
  3053. vdev_id: 8,
  3054. pdev_id: 2,
  3055. rsvd0: 14;
  3056. A_UINT32 sa_addr_31_0;
  3057. A_UINT32
  3058. sa_addr_47_32: 16,
  3059. ta_peer_id: 14,
  3060. rsvd2: 2;
  3061. } POSTPACK;
  3062. /* DWORD 0 */
  3063. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3064. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3065. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3066. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3067. /* DWORD 2 */
  3068. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3069. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3070. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3071. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3072. /* DWORD 0 */
  3073. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3074. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3075. HTT_WDS_ENTRY_VDEV_ID_S)
  3076. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3077. do { \
  3078. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3079. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3080. } while (0)
  3081. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3082. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3083. HTT_WDS_ENTRY_PDEV_ID_S)
  3084. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3085. do { \
  3086. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3087. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3088. } while (0)
  3089. /* DWORD 2 */
  3090. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3091. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3092. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3093. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3094. do { \
  3095. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3096. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3097. } while (0)
  3098. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3099. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3100. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3101. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3102. do { \
  3103. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3104. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3105. } while (0)
  3106. /**
  3107. * @brief MAC DMA rx ring setup specification
  3108. *
  3109. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3110. *
  3111. * @details
  3112. * To allow for dynamic rx ring reconfiguration and to avoid race
  3113. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3114. * it uses. Instead, it sends this message to the target, indicating how
  3115. * the rx ring used by the host should be set up and maintained.
  3116. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3117. * specifications.
  3118. *
  3119. * |31 16|15 8|7 0|
  3120. * |---------------------------------------------------------------|
  3121. * header: | reserved | num rings | msg type |
  3122. * |---------------------------------------------------------------|
  3123. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3124. #if HTT_PADDR64
  3125. * | FW_IDX shadow register physical address (bits 63:32) |
  3126. #endif
  3127. * |---------------------------------------------------------------|
  3128. * | rx ring base physical address (bits 31:0) |
  3129. #if HTT_PADDR64
  3130. * | rx ring base physical address (bits 63:32) |
  3131. #endif
  3132. * |---------------------------------------------------------------|
  3133. * | rx ring buffer size | rx ring length |
  3134. * |---------------------------------------------------------------|
  3135. * | FW_IDX initial value | enabled flags |
  3136. * |---------------------------------------------------------------|
  3137. * | MSDU payload offset | 802.11 header offset |
  3138. * |---------------------------------------------------------------|
  3139. * | PPDU end offset | PPDU start offset |
  3140. * |---------------------------------------------------------------|
  3141. * | MPDU end offset | MPDU start offset |
  3142. * |---------------------------------------------------------------|
  3143. * | MSDU end offset | MSDU start offset |
  3144. * |---------------------------------------------------------------|
  3145. * | frag info offset | rx attention offset |
  3146. * |---------------------------------------------------------------|
  3147. * payload 2, if present, has the same format as payload 1
  3148. * Header fields:
  3149. * - MSG_TYPE
  3150. * Bits 7:0
  3151. * Purpose: identifies this as an rx ring configuration message
  3152. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3153. * - NUM_RINGS
  3154. * Bits 15:8
  3155. * Purpose: indicates whether the host is setting up one rx ring or two
  3156. * Value: 1 or 2
  3157. * Payload:
  3158. * for systems using 64-bit format for bus addresses:
  3159. * - IDX_SHADOW_REG_PADDR_LO
  3160. * Bits 31:0
  3161. * Value: lower 4 bytes of physical address of the host's
  3162. * FW_IDX shadow register
  3163. * - IDX_SHADOW_REG_PADDR_HI
  3164. * Bits 31:0
  3165. * Value: upper 4 bytes of physical address of the host's
  3166. * FW_IDX shadow register
  3167. * - RING_BASE_PADDR_LO
  3168. * Bits 31:0
  3169. * Value: lower 4 bytes of physical address of the host's rx ring
  3170. * - RING_BASE_PADDR_HI
  3171. * Bits 31:0
  3172. * Value: uppper 4 bytes of physical address of the host's rx ring
  3173. * for systems using 32-bit format for bus addresses:
  3174. * - IDX_SHADOW_REG_PADDR
  3175. * Bits 31:0
  3176. * Value: physical address of the host's FW_IDX shadow register
  3177. * - RING_BASE_PADDR
  3178. * Bits 31:0
  3179. * Value: physical address of the host's rx ring
  3180. * - RING_LEN
  3181. * Bits 15:0
  3182. * Value: number of elements in the rx ring
  3183. * - RING_BUF_SZ
  3184. * Bits 31:16
  3185. * Value: size of the buffers referenced by the rx ring, in byte units
  3186. * - ENABLED_FLAGS
  3187. * Bits 15:0
  3188. * Value: 1-bit flags to show whether different rx fields are enabled
  3189. * bit 0: 802.11 header enabled (1) or disabled (0)
  3190. * bit 1: MSDU payload enabled (1) or disabled (0)
  3191. * bit 2: PPDU start enabled (1) or disabled (0)
  3192. * bit 3: PPDU end enabled (1) or disabled (0)
  3193. * bit 4: MPDU start enabled (1) or disabled (0)
  3194. * bit 5: MPDU end enabled (1) or disabled (0)
  3195. * bit 6: MSDU start enabled (1) or disabled (0)
  3196. * bit 7: MSDU end enabled (1) or disabled (0)
  3197. * bit 8: rx attention enabled (1) or disabled (0)
  3198. * bit 9: frag info enabled (1) or disabled (0)
  3199. * bit 10: unicast rx enabled (1) or disabled (0)
  3200. * bit 11: multicast rx enabled (1) or disabled (0)
  3201. * bit 12: ctrl rx enabled (1) or disabled (0)
  3202. * bit 13: mgmt rx enabled (1) or disabled (0)
  3203. * bit 14: null rx enabled (1) or disabled (0)
  3204. * bit 15: phy data rx enabled (1) or disabled (0)
  3205. * - IDX_INIT_VAL
  3206. * Bits 31:16
  3207. * Purpose: Specify the initial value for the FW_IDX.
  3208. * Value: the number of buffers initially present in the host's rx ring
  3209. * - OFFSET_802_11_HDR
  3210. * Bits 15:0
  3211. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3212. * - OFFSET_MSDU_PAYLOAD
  3213. * Bits 31:16
  3214. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3215. * - OFFSET_PPDU_START
  3216. * Bits 15:0
  3217. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3218. * - OFFSET_PPDU_END
  3219. * Bits 31:16
  3220. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3221. * - OFFSET_MPDU_START
  3222. * Bits 15:0
  3223. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3224. * - OFFSET_MPDU_END
  3225. * Bits 31:16
  3226. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3227. * - OFFSET_MSDU_START
  3228. * Bits 15:0
  3229. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3230. * - OFFSET_MSDU_END
  3231. * Bits 31:16
  3232. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3233. * - OFFSET_RX_ATTN
  3234. * Bits 15:0
  3235. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3236. * - OFFSET_FRAG_INFO
  3237. * Bits 31:16
  3238. * Value: offset in QUAD-bytes of frag info table
  3239. */
  3240. /* header fields */
  3241. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3242. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3243. /* payload fields */
  3244. /* for systems using a 64-bit format for bus addresses */
  3245. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3246. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3247. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3248. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3249. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3250. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3251. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3252. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3253. /* for systems using a 32-bit format for bus addresses */
  3254. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3255. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3256. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3257. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3258. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3259. #define HTT_RX_RING_CFG_LEN_S 0
  3260. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3261. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3262. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3263. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3264. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3265. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3266. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3267. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3268. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3269. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3270. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3271. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3272. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3273. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3274. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3275. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3276. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3277. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3278. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3279. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3280. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3281. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3282. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3283. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3284. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3285. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3286. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3287. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3288. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3289. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3290. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3291. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3292. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3293. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3294. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3295. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3296. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3297. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3298. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3299. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3300. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3301. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3302. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3303. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3304. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3305. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3306. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3307. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3308. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3309. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3310. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3311. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3312. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3313. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3314. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3315. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3316. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3317. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3318. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3319. #if HTT_PADDR64
  3320. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3321. #else
  3322. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3323. #endif
  3324. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3325. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3326. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3327. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3328. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3329. do { \
  3330. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3331. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3332. } while (0)
  3333. /* degenerate case for 32-bit fields */
  3334. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3335. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3336. ((_var) = (_val))
  3337. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3338. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3339. ((_var) = (_val))
  3340. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3341. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3342. ((_var) = (_val))
  3343. /* degenerate case for 32-bit fields */
  3344. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3345. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3346. ((_var) = (_val))
  3347. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3348. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3349. ((_var) = (_val))
  3350. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3351. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3352. ((_var) = (_val))
  3353. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3354. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3355. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3356. do { \
  3357. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3358. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3359. } while (0)
  3360. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3361. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3362. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3363. do { \
  3364. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3365. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3366. } while (0)
  3367. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3368. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3369. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3370. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3371. do { \
  3372. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3373. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3374. } while (0)
  3375. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3376. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3377. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3378. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3379. do { \
  3380. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3381. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3382. } while (0)
  3383. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3384. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3385. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3386. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3387. do { \
  3388. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3389. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3390. } while (0)
  3391. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3392. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3393. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3394. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3395. do { \
  3396. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3397. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3398. } while (0)
  3399. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3400. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3401. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3402. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3403. do { \
  3404. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3405. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3406. } while (0)
  3407. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3408. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3409. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3410. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3411. do { \
  3412. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3413. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3414. } while (0)
  3415. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3416. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3417. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3418. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3419. do { \
  3420. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3421. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3422. } while (0)
  3423. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3424. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3425. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3426. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3427. do { \
  3428. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3429. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3430. } while (0)
  3431. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3432. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3433. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3434. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3435. do { \
  3436. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3437. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3438. } while (0)
  3439. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3440. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3441. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3442. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3443. do { \
  3444. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3445. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3446. } while (0)
  3447. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3448. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3449. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3450. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3451. do { \
  3452. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3453. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3454. } while (0)
  3455. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3456. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3457. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3458. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3459. do { \
  3460. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3461. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3462. } while (0)
  3463. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3464. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3465. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3466. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3467. do { \
  3468. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3469. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3470. } while (0)
  3471. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3472. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3473. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3474. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3475. do { \
  3476. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3477. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3478. } while (0)
  3479. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3480. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3481. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3482. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3483. do { \
  3484. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3485. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3486. } while (0)
  3487. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3488. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3489. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3490. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3491. do { \
  3492. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3493. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3494. } while (0)
  3495. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3496. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3497. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3498. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3499. do { \
  3500. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3501. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3502. } while (0)
  3503. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3504. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3505. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3506. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3507. do { \
  3508. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3509. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3510. } while (0)
  3511. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3512. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3513. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3514. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3515. do { \
  3516. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3517. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3518. } while (0)
  3519. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3520. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3521. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3522. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3523. do { \
  3524. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3525. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3526. } while (0)
  3527. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3528. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3529. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3530. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3531. do { \
  3532. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3533. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3534. } while (0)
  3535. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3536. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3537. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3538. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3539. do { \
  3540. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3541. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3542. } while (0)
  3543. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3544. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3545. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3546. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3549. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3550. } while (0)
  3551. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3552. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3553. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3554. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3557. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3558. } while (0)
  3559. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3560. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3561. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3562. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3565. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3566. } while (0)
  3567. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3568. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3569. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3570. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3573. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3574. } while (0)
  3575. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3576. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3577. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3578. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3581. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3582. } while (0)
  3583. /**
  3584. * @brief host -> target FW statistics retrieve
  3585. *
  3586. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3587. *
  3588. * @details
  3589. * The following field definitions describe the format of the HTT host
  3590. * to target FW stats retrieve message. The message specifies the type of
  3591. * stats host wants to retrieve.
  3592. *
  3593. * |31 24|23 16|15 8|7 0|
  3594. * |-----------------------------------------------------------|
  3595. * | stats types request bitmask | msg type |
  3596. * |-----------------------------------------------------------|
  3597. * | stats types reset bitmask | reserved |
  3598. * |-----------------------------------------------------------|
  3599. * | stats type | config value |
  3600. * |-----------------------------------------------------------|
  3601. * | cookie LSBs |
  3602. * |-----------------------------------------------------------|
  3603. * | cookie MSBs |
  3604. * |-----------------------------------------------------------|
  3605. * Header fields:
  3606. * - MSG_TYPE
  3607. * Bits 7:0
  3608. * Purpose: identifies this is a stats upload request message
  3609. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3610. * - UPLOAD_TYPES
  3611. * Bits 31:8
  3612. * Purpose: identifies which types of FW statistics to upload
  3613. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3614. * - RESET_TYPES
  3615. * Bits 31:8
  3616. * Purpose: identifies which types of FW statistics to reset
  3617. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3618. * - CFG_VAL
  3619. * Bits 23:0
  3620. * Purpose: give an opaque configuration value to the specified stats type
  3621. * Value: stats-type specific configuration value
  3622. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3623. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3624. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3625. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3626. * - CFG_STAT_TYPE
  3627. * Bits 31:24
  3628. * Purpose: specify which stats type (if any) the config value applies to
  3629. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3630. * a valid configuration specification
  3631. * - COOKIE_LSBS
  3632. * Bits 31:0
  3633. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3634. * message with its preceding host->target stats request message.
  3635. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3636. * - COOKIE_MSBS
  3637. * Bits 31:0
  3638. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3639. * message with its preceding host->target stats request message.
  3640. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3641. */
  3642. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3643. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3644. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3645. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3646. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3647. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3648. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3649. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3650. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3651. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3652. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3653. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3654. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3655. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3658. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3659. } while (0)
  3660. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3661. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3662. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3663. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3666. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3667. } while (0)
  3668. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3669. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3670. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3671. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3672. do { \
  3673. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3674. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3675. } while (0)
  3676. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3677. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3678. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3679. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3680. do { \
  3681. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3682. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3683. } while (0)
  3684. /**
  3685. * @brief host -> target HTT out-of-band sync request
  3686. *
  3687. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3688. *
  3689. * @details
  3690. * The HTT SYNC tells the target to suspend processing of subsequent
  3691. * HTT host-to-target messages until some other target agent locally
  3692. * informs the target HTT FW that the current sync counter is equal to
  3693. * or greater than (in a modulo sense) the sync counter specified in
  3694. * the SYNC message.
  3695. * This allows other host-target components to synchronize their operation
  3696. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3697. * security key has been downloaded to and activated by the target.
  3698. * In the absence of any explicit synchronization counter value
  3699. * specification, the target HTT FW will use zero as the default current
  3700. * sync value.
  3701. *
  3702. * |31 24|23 16|15 8|7 0|
  3703. * |-----------------------------------------------------------|
  3704. * | reserved | sync count | msg type |
  3705. * |-----------------------------------------------------------|
  3706. * Header fields:
  3707. * - MSG_TYPE
  3708. * Bits 7:0
  3709. * Purpose: identifies this as a sync message
  3710. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3711. * - SYNC_COUNT
  3712. * Bits 15:8
  3713. * Purpose: specifies what sync value the HTT FW will wait for from
  3714. * an out-of-band specification to resume its operation
  3715. * Value: in-band sync counter value to compare against the out-of-band
  3716. * counter spec.
  3717. * The HTT target FW will suspend its host->target message processing
  3718. * as long as
  3719. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3720. */
  3721. #define HTT_H2T_SYNC_MSG_SZ 4
  3722. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3723. #define HTT_H2T_SYNC_COUNT_S 8
  3724. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3725. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3726. HTT_H2T_SYNC_COUNT_S)
  3727. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3728. do { \
  3729. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3730. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3731. } while (0)
  3732. /**
  3733. * @brief host -> target HTT aggregation configuration
  3734. *
  3735. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3736. */
  3737. #define HTT_AGGR_CFG_MSG_SZ 4
  3738. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3739. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3740. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3741. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3742. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3743. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3744. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3745. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3746. do { \
  3747. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3748. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3749. } while (0)
  3750. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3751. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3752. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3753. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3756. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3757. } while (0)
  3758. /**
  3759. * @brief host -> target HTT configure max amsdu info per vdev
  3760. *
  3761. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3762. *
  3763. * @details
  3764. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3765. *
  3766. * |31 21|20 16|15 8|7 0|
  3767. * |-----------------------------------------------------------|
  3768. * | reserved | vdev id | max amsdu | msg type |
  3769. * |-----------------------------------------------------------|
  3770. * Header fields:
  3771. * - MSG_TYPE
  3772. * Bits 7:0
  3773. * Purpose: identifies this as a aggr cfg ex message
  3774. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3775. * - MAX_NUM_AMSDU_SUBFRM
  3776. * Bits 15:8
  3777. * Purpose: max MSDUs per A-MSDU
  3778. * - VDEV_ID
  3779. * Bits 20:16
  3780. * Purpose: ID of the vdev to which this limit is applied
  3781. */
  3782. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3783. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3784. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3785. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3786. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3787. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3788. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3789. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3790. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3791. do { \
  3792. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3793. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3794. } while (0)
  3795. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3796. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3797. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3798. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3799. do { \
  3800. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3801. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3802. } while (0)
  3803. /**
  3804. * @brief HTT WDI_IPA Config Message
  3805. *
  3806. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3807. *
  3808. * @details
  3809. * The HTT WDI_IPA config message is created/sent by host at driver
  3810. * init time. It contains information about data structures used on
  3811. * WDI_IPA TX and RX path.
  3812. * TX CE ring is used for pushing packet metadata from IPA uC
  3813. * to WLAN FW
  3814. * TX Completion ring is used for generating TX completions from
  3815. * WLAN FW to IPA uC
  3816. * RX Indication ring is used for indicating RX packets from FW
  3817. * to IPA uC
  3818. * RX Ring2 is used as either completion ring or as second
  3819. * indication ring. when Ring2 is used as completion ring, IPA uC
  3820. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3821. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3822. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3823. * indicated in RX Indication ring. Please see WDI_IPA specification
  3824. * for more details.
  3825. * |31 24|23 16|15 8|7 0|
  3826. * |----------------+----------------+----------------+----------------|
  3827. * | tx pkt pool size | Rsvd | msg_type |
  3828. * |-------------------------------------------------------------------|
  3829. * | tx comp ring base (bits 31:0) |
  3830. #if HTT_PADDR64
  3831. * | tx comp ring base (bits 63:32) |
  3832. #endif
  3833. * |-------------------------------------------------------------------|
  3834. * | tx comp ring size |
  3835. * |-------------------------------------------------------------------|
  3836. * | tx comp WR_IDX physical address (bits 31:0) |
  3837. #if HTT_PADDR64
  3838. * | tx comp WR_IDX physical address (bits 63:32) |
  3839. #endif
  3840. * |-------------------------------------------------------------------|
  3841. * | tx CE WR_IDX physical address (bits 31:0) |
  3842. #if HTT_PADDR64
  3843. * | tx CE WR_IDX physical address (bits 63:32) |
  3844. #endif
  3845. * |-------------------------------------------------------------------|
  3846. * | rx indication ring base (bits 31:0) |
  3847. #if HTT_PADDR64
  3848. * | rx indication ring base (bits 63:32) |
  3849. #endif
  3850. * |-------------------------------------------------------------------|
  3851. * | rx indication ring size |
  3852. * |-------------------------------------------------------------------|
  3853. * | rx ind RD_IDX physical address (bits 31:0) |
  3854. #if HTT_PADDR64
  3855. * | rx ind RD_IDX physical address (bits 63:32) |
  3856. #endif
  3857. * |-------------------------------------------------------------------|
  3858. * | rx ind WR_IDX physical address (bits 31:0) |
  3859. #if HTT_PADDR64
  3860. * | rx ind WR_IDX physical address (bits 63:32) |
  3861. #endif
  3862. * |-------------------------------------------------------------------|
  3863. * |-------------------------------------------------------------------|
  3864. * | rx ring2 base (bits 31:0) |
  3865. #if HTT_PADDR64
  3866. * | rx ring2 base (bits 63:32) |
  3867. #endif
  3868. * |-------------------------------------------------------------------|
  3869. * | rx ring2 size |
  3870. * |-------------------------------------------------------------------|
  3871. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3872. #if HTT_PADDR64
  3873. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3874. #endif
  3875. * |-------------------------------------------------------------------|
  3876. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3877. #if HTT_PADDR64
  3878. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3879. #endif
  3880. * |-------------------------------------------------------------------|
  3881. *
  3882. * Header fields:
  3883. * Header fields:
  3884. * - MSG_TYPE
  3885. * Bits 7:0
  3886. * Purpose: Identifies this as WDI_IPA config message
  3887. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3888. * - TX_PKT_POOL_SIZE
  3889. * Bits 15:0
  3890. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3891. * WDI_IPA TX path
  3892. * For systems using 32-bit format for bus addresses:
  3893. * - TX_COMP_RING_BASE_ADDR
  3894. * Bits 31:0
  3895. * Purpose: TX Completion Ring base address in DDR
  3896. * - TX_COMP_RING_SIZE
  3897. * Bits 31:0
  3898. * Purpose: TX Completion Ring size (must be power of 2)
  3899. * - TX_COMP_WR_IDX_ADDR
  3900. * Bits 31:0
  3901. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3902. * updates the Write Index for WDI_IPA TX completion ring
  3903. * - TX_CE_WR_IDX_ADDR
  3904. * Bits 31:0
  3905. * Purpose: DDR address where IPA uC
  3906. * updates the WR Index for TX CE ring
  3907. * (needed for fusion platforms)
  3908. * - RX_IND_RING_BASE_ADDR
  3909. * Bits 31:0
  3910. * Purpose: RX Indication Ring base address in DDR
  3911. * - RX_IND_RING_SIZE
  3912. * Bits 31:0
  3913. * Purpose: RX Indication Ring size
  3914. * - RX_IND_RD_IDX_ADDR
  3915. * Bits 31:0
  3916. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3917. * RX indication ring
  3918. * - RX_IND_WR_IDX_ADDR
  3919. * Bits 31:0
  3920. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3921. * updates the Write Index for WDI_IPA RX indication ring
  3922. * - RX_RING2_BASE_ADDR
  3923. * Bits 31:0
  3924. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3925. * - RX_RING2_SIZE
  3926. * Bits 31:0
  3927. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3928. * - RX_RING2_RD_IDX_ADDR
  3929. * Bits 31:0
  3930. * Purpose: If Second RX ring is Indication ring, DDR address where
  3931. * IPA uC updates the Read Index for Ring2.
  3932. * If Second RX ring is completion ring, this is NOT used
  3933. * - RX_RING2_WR_IDX_ADDR
  3934. * Bits 31:0
  3935. * Purpose: If Second RX ring is Indication ring, DDR address where
  3936. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3937. * If second RX ring is completion ring, DDR address where
  3938. * IPA uC updates the Write Index for Ring 2.
  3939. * For systems using 64-bit format for bus addresses:
  3940. * - TX_COMP_RING_BASE_ADDR_LO
  3941. * Bits 31:0
  3942. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3943. * - TX_COMP_RING_BASE_ADDR_HI
  3944. * Bits 31:0
  3945. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3946. * - TX_COMP_RING_SIZE
  3947. * Bits 31:0
  3948. * Purpose: TX Completion Ring size (must be power of 2)
  3949. * - TX_COMP_WR_IDX_ADDR_LO
  3950. * Bits 31:0
  3951. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3952. * Lower 4 bytes of DDR address where WIFI FW
  3953. * updates the Write Index for WDI_IPA TX completion ring
  3954. * - TX_COMP_WR_IDX_ADDR_HI
  3955. * Bits 31:0
  3956. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3957. * Higher 4 bytes of DDR address where WIFI FW
  3958. * updates the Write Index for WDI_IPA TX completion ring
  3959. * - TX_CE_WR_IDX_ADDR_LO
  3960. * Bits 31:0
  3961. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3962. * updates the WR Index for TX CE ring
  3963. * (needed for fusion platforms)
  3964. * - TX_CE_WR_IDX_ADDR_HI
  3965. * Bits 31:0
  3966. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3967. * updates the WR Index for TX CE ring
  3968. * (needed for fusion platforms)
  3969. * - RX_IND_RING_BASE_ADDR_LO
  3970. * Bits 31:0
  3971. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3972. * - RX_IND_RING_BASE_ADDR_HI
  3973. * Bits 31:0
  3974. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3975. * - RX_IND_RING_SIZE
  3976. * Bits 31:0
  3977. * Purpose: RX Indication Ring size
  3978. * - RX_IND_RD_IDX_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3981. * for WDI_IPA RX indication ring
  3982. * - RX_IND_RD_IDX_ADDR_HI
  3983. * Bits 31:0
  3984. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3985. * for WDI_IPA RX indication ring
  3986. * - RX_IND_WR_IDX_ADDR_LO
  3987. * Bits 31:0
  3988. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3989. * Lower 4 bytes of DDR address where WIFI FW
  3990. * updates the Write Index for WDI_IPA RX indication ring
  3991. * - RX_IND_WR_IDX_ADDR_HI
  3992. * Bits 31:0
  3993. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3994. * Higher 4 bytes of DDR address where WIFI FW
  3995. * updates the Write Index for WDI_IPA RX indication ring
  3996. * - RX_RING2_BASE_ADDR_LO
  3997. * Bits 31:0
  3998. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3999. * - RX_RING2_BASE_ADDR_HI
  4000. * Bits 31:0
  4001. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4002. * - RX_RING2_SIZE
  4003. * Bits 31:0
  4004. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4005. * - RX_RING2_RD_IDX_ADDR_LO
  4006. * Bits 31:0
  4007. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4008. * DDR address where IPA uC updates the Read Index for Ring2.
  4009. * If Second RX ring is completion ring, this is NOT used
  4010. * - RX_RING2_RD_IDX_ADDR_HI
  4011. * Bits 31:0
  4012. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4013. * DDR address where IPA uC updates the Read Index for Ring2.
  4014. * If Second RX ring is completion ring, this is NOT used
  4015. * - RX_RING2_WR_IDX_ADDR_LO
  4016. * Bits 31:0
  4017. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4018. * DDR address where WIFI FW updates the Write Index
  4019. * for WDI_IPA RX ring2
  4020. * If second RX ring is completion ring, lower 4 bytes of
  4021. * DDR address where IPA uC updates the Write Index for Ring 2.
  4022. * - RX_RING2_WR_IDX_ADDR_HI
  4023. * Bits 31:0
  4024. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4025. * DDR address where WIFI FW updates the Write Index
  4026. * for WDI_IPA RX ring2
  4027. * If second RX ring is completion ring, higher 4 bytes of
  4028. * DDR address where IPA uC updates the Write Index for Ring 2.
  4029. */
  4030. #if HTT_PADDR64
  4031. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4032. #else
  4033. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4034. #endif
  4035. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4036. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4037. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4051. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4097. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4098. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4099. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4100. do { \
  4101. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4102. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4103. } while (0)
  4104. /* for systems using 32-bit format for bus addr */
  4105. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4106. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4107. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4108. do { \
  4109. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4110. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4111. } while (0)
  4112. /* for systems using 64-bit format for bus addr */
  4113. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4114. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4115. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4116. do { \
  4117. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4118. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4119. } while (0)
  4120. /* for systems using 64-bit format for bus addr */
  4121. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4122. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4123. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4124. do { \
  4125. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4126. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4127. } while (0)
  4128. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4129. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4133. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4134. } while (0)
  4135. /* for systems using 32-bit format for bus addr */
  4136. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4137. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4141. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4142. } while (0)
  4143. /* for systems using 64-bit format for bus addr */
  4144. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4145. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4146. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4149. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4150. } while (0)
  4151. /* for systems using 64-bit format for bus addr */
  4152. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4153. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4154. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4157. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4158. } while (0)
  4159. /* for systems using 32-bit format for bus addr */
  4160. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4161. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4162. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4163. do { \
  4164. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4165. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4166. } while (0)
  4167. /* for systems using 64-bit format for bus addr */
  4168. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4169. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4170. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4173. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4174. } while (0)
  4175. /* for systems using 64-bit format for bus addr */
  4176. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4177. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4178. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4179. do { \
  4180. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4181. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4182. } while (0)
  4183. /* for systems using 32-bit format for bus addr */
  4184. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4185. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4186. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4187. do { \
  4188. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4189. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4190. } while (0)
  4191. /* for systems using 64-bit format for bus addr */
  4192. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4193. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4194. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4195. do { \
  4196. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4197. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4198. } while (0)
  4199. /* for systems using 64-bit format for bus addr */
  4200. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4201. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4202. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4203. do { \
  4204. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4205. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4206. } while (0)
  4207. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4208. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4212. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4213. } while (0)
  4214. /* for systems using 32-bit format for bus addr */
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4216. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4218. do { \
  4219. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4220. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4221. } while (0)
  4222. /* for systems using 64-bit format for bus addr */
  4223. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4224. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4225. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4228. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4229. } while (0)
  4230. /* for systems using 64-bit format for bus addr */
  4231. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4232. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4233. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4234. do { \
  4235. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4236. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4237. } while (0)
  4238. /* for systems using 32-bit format for bus addr */
  4239. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4240. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4241. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4244. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4245. } while (0)
  4246. /* for systems using 64-bit format for bus addr */
  4247. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4248. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4249. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4252. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4253. } while (0)
  4254. /* for systems using 64-bit format for bus addr */
  4255. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4256. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4257. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4258. do { \
  4259. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4260. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4261. } while (0)
  4262. /* for systems using 32-bit format for bus addr */
  4263. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4264. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4265. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4268. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4269. } while (0)
  4270. /* for systems using 64-bit format for bus addr */
  4271. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4272. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4273. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4274. do { \
  4275. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4276. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4277. } while (0)
  4278. /* for systems using 64-bit format for bus addr */
  4279. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4280. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4282. do { \
  4283. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4284. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4285. } while (0)
  4286. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4287. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4291. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4292. } while (0)
  4293. /* for systems using 32-bit format for bus addr */
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4295. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4299. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4300. } while (0)
  4301. /* for systems using 64-bit format for bus addr */
  4302. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4303. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4305. do { \
  4306. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4307. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4308. } while (0)
  4309. /* for systems using 64-bit format for bus addr */
  4310. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4311. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4313. do { \
  4314. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4315. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4316. } while (0)
  4317. /* for systems using 32-bit format for bus addr */
  4318. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4319. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4321. do { \
  4322. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4323. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4324. } while (0)
  4325. /* for systems using 64-bit format for bus addr */
  4326. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4327. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4328. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4329. do { \
  4330. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4331. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4332. } while (0)
  4333. /* for systems using 64-bit format for bus addr */
  4334. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4335. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4336. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4337. do { \
  4338. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4339. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4340. } while (0)
  4341. /*
  4342. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4343. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4344. * addresses are stored in a XXX-bit field.
  4345. * This macro is used to define both htt_wdi_ipa_config32_t and
  4346. * htt_wdi_ipa_config64_t structs.
  4347. */
  4348. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4349. _paddr__tx_comp_ring_base_addr_, \
  4350. _paddr__tx_comp_wr_idx_addr_, \
  4351. _paddr__tx_ce_wr_idx_addr_, \
  4352. _paddr__rx_ind_ring_base_addr_, \
  4353. _paddr__rx_ind_rd_idx_addr_, \
  4354. _paddr__rx_ind_wr_idx_addr_, \
  4355. _paddr__rx_ring2_base_addr_,\
  4356. _paddr__rx_ring2_rd_idx_addr_,\
  4357. _paddr__rx_ring2_wr_idx_addr_) \
  4358. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4359. { \
  4360. /* DWORD 0: flags and meta-data */ \
  4361. A_UINT32 \
  4362. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4363. reserved: 8, \
  4364. tx_pkt_pool_size: 16;\
  4365. /* DWORD 1 */\
  4366. _paddr__tx_comp_ring_base_addr_;\
  4367. /* DWORD 2 (or 3)*/\
  4368. A_UINT32 tx_comp_ring_size;\
  4369. /* DWORD 3 (or 4)*/\
  4370. _paddr__tx_comp_wr_idx_addr_;\
  4371. /* DWORD 4 (or 6)*/\
  4372. _paddr__tx_ce_wr_idx_addr_;\
  4373. /* DWORD 5 (or 8)*/\
  4374. _paddr__rx_ind_ring_base_addr_;\
  4375. /* DWORD 6 (or 10)*/\
  4376. A_UINT32 rx_ind_ring_size;\
  4377. /* DWORD 7 (or 11)*/\
  4378. _paddr__rx_ind_rd_idx_addr_;\
  4379. /* DWORD 8 (or 13)*/\
  4380. _paddr__rx_ind_wr_idx_addr_;\
  4381. /* DWORD 9 (or 15)*/\
  4382. _paddr__rx_ring2_base_addr_;\
  4383. /* DWORD 10 (or 17) */\
  4384. A_UINT32 rx_ring2_size;\
  4385. /* DWORD 11 (or 18) */\
  4386. _paddr__rx_ring2_rd_idx_addr_;\
  4387. /* DWORD 12 (or 20) */\
  4388. _paddr__rx_ring2_wr_idx_addr_;\
  4389. } POSTPACK
  4390. /* define a htt_wdi_ipa_config32_t type */
  4391. 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));
  4392. /* define a htt_wdi_ipa_config64_t type */
  4393. 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));
  4394. #if HTT_PADDR64
  4395. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4396. #else
  4397. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4398. #endif
  4399. enum htt_wdi_ipa_op_code {
  4400. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4401. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4402. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4403. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4404. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4405. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4406. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4407. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4408. /* keep this last */
  4409. HTT_WDI_IPA_OPCODE_MAX
  4410. };
  4411. /**
  4412. * @brief HTT WDI_IPA Operation Request Message
  4413. *
  4414. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4415. *
  4416. * @details
  4417. * HTT WDI_IPA Operation Request message is sent by host
  4418. * to either suspend or resume WDI_IPA TX or RX path.
  4419. * |31 24|23 16|15 8|7 0|
  4420. * |----------------+----------------+----------------+----------------|
  4421. * | op_code | Rsvd | msg_type |
  4422. * |-------------------------------------------------------------------|
  4423. *
  4424. * Header fields:
  4425. * - MSG_TYPE
  4426. * Bits 7:0
  4427. * Purpose: Identifies this as WDI_IPA Operation Request message
  4428. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4429. * - OP_CODE
  4430. * Bits 31:16
  4431. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4432. * value: = enum htt_wdi_ipa_op_code
  4433. */
  4434. PREPACK struct htt_wdi_ipa_op_request_t
  4435. {
  4436. /* DWORD 0: flags and meta-data */
  4437. A_UINT32
  4438. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4439. reserved: 8,
  4440. op_code: 16;
  4441. } POSTPACK;
  4442. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4443. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4444. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4445. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4446. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4447. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4448. do { \
  4449. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4450. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4451. } while (0)
  4452. /*
  4453. * @brief host -> target HTT_MSI_SETUP message
  4454. *
  4455. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4456. *
  4457. * @details
  4458. * After target is booted up, host can send MSI setup message so that
  4459. * target sets up HW registers based on setup message.
  4460. *
  4461. * The message would appear as follows:
  4462. * |31 24|23 16|15|14 8|7 0|
  4463. * |---------------+-----------------+-----------------+-----------------|
  4464. * | reserved | msi_type | pdev_id | msg_type |
  4465. * |---------------------------------------------------------------------|
  4466. * | msi_addr_lo |
  4467. * |---------------------------------------------------------------------|
  4468. * | msi_addr_hi |
  4469. * |---------------------------------------------------------------------|
  4470. * | msi_data |
  4471. * |---------------------------------------------------------------------|
  4472. *
  4473. * The message is interpreted as follows:
  4474. * dword0 - b'0:7 - msg_type: This will be set to
  4475. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4476. * b'8:15 - pdev_id:
  4477. * 0 (for rings at SOC/UMAC level),
  4478. * 1/2/3 mac id (for rings at LMAC level)
  4479. * b'16:23 - msi_type: identify which msi registers need to be setup
  4480. * more details can be got from enum htt_msi_setup_type
  4481. * b'24:31 - reserved
  4482. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4483. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4484. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4485. */
  4486. PREPACK struct htt_msi_setup_t {
  4487. A_UINT32 msg_type: 8,
  4488. pdev_id: 8,
  4489. msi_type: 8,
  4490. reserved: 8;
  4491. A_UINT32 msi_addr_lo;
  4492. A_UINT32 msi_addr_hi;
  4493. A_UINT32 msi_data;
  4494. } POSTPACK;
  4495. enum htt_msi_setup_type {
  4496. HTT_PPDU_END_MSI_SETUP_TYPE,
  4497. /* Insert new types here*/
  4498. };
  4499. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4500. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4501. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4502. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4503. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4504. HTT_MSI_SETUP_PDEV_ID_S)
  4505. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4506. do { \
  4507. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4508. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4509. } while (0)
  4510. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4511. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4512. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4513. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4514. HTT_MSI_SETUP_MSI_TYPE_S)
  4515. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4516. do { \
  4517. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4518. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4519. } while (0)
  4520. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4521. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4522. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4523. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4524. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4525. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4528. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4529. } while (0)
  4530. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4531. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4532. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4533. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4534. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4535. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4536. do { \
  4537. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4538. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4539. } while (0)
  4540. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4541. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4542. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4543. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4544. HTT_MSI_SETUP_MSI_DATA_S)
  4545. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4546. do { \
  4547. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4548. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4549. } while (0)
  4550. /*
  4551. * @brief host -> target HTT_SRING_SETUP message
  4552. *
  4553. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4554. *
  4555. * @details
  4556. * After target is booted up, Host can send SRING setup message for
  4557. * each host facing LMAC SRING. Target setups up HW registers based
  4558. * on setup message and confirms back to Host if response_required is set.
  4559. * Host should wait for confirmation message before sending new SRING
  4560. * setup message
  4561. *
  4562. * The message would appear as follows:
  4563. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4564. * |--------------- +-----------------+-----------------+-----------------|
  4565. * | ring_type | ring_id | pdev_id | msg_type |
  4566. * |----------------------------------------------------------------------|
  4567. * | ring_base_addr_lo |
  4568. * |----------------------------------------------------------------------|
  4569. * | ring_base_addr_hi |
  4570. * |----------------------------------------------------------------------|
  4571. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4572. * |----------------------------------------------------------------------|
  4573. * | ring_head_offset32_remote_addr_lo |
  4574. * |----------------------------------------------------------------------|
  4575. * | ring_head_offset32_remote_addr_hi |
  4576. * |----------------------------------------------------------------------|
  4577. * | ring_tail_offset32_remote_addr_lo |
  4578. * |----------------------------------------------------------------------|
  4579. * | ring_tail_offset32_remote_addr_hi |
  4580. * |----------------------------------------------------------------------|
  4581. * | ring_msi_addr_lo |
  4582. * |----------------------------------------------------------------------|
  4583. * | ring_msi_addr_hi |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_msi_data |
  4586. * |----------------------------------------------------------------------|
  4587. * | intr_timer_th |IM| intr_batch_counter_th |
  4588. * |----------------------------------------------------------------------|
  4589. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4590. * |----------------------------------------------------------------------|
  4591. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4592. * |----------------------------------------------------------------------|
  4593. * Where
  4594. * IM = sw_intr_mode
  4595. * RR = response_required
  4596. * PTCF = prefetch_timer_cfg
  4597. * IP = IPA drop flag
  4598. *
  4599. * The message is interpreted as follows:
  4600. * dword0 - b'0:7 - msg_type: This will be set to
  4601. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4602. * b'8:15 - pdev_id:
  4603. * 0 (for rings at SOC/UMAC level),
  4604. * 1/2/3 mac id (for rings at LMAC level)
  4605. * b'16:23 - ring_id: identify which ring is to setup,
  4606. * more details can be got from enum htt_srng_ring_id
  4607. * b'24:31 - ring_type: identify type of host rings,
  4608. * more details can be got from enum htt_srng_ring_type
  4609. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4610. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4611. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4612. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4613. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4614. * SW_TO_HW_RING.
  4615. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4616. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4617. * Lower 32 bits of memory address of the remote variable
  4618. * storing the 4-byte word offset that identifies the head
  4619. * element within the ring.
  4620. * (The head offset variable has type A_UINT32.)
  4621. * Valid for HW_TO_SW and SW_TO_SW rings.
  4622. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4623. * Upper 32 bits of memory address of the remote variable
  4624. * storing the 4-byte word offset that identifies the head
  4625. * element within the ring.
  4626. * (The head offset variable has type A_UINT32.)
  4627. * Valid for HW_TO_SW and SW_TO_SW rings.
  4628. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4629. * Lower 32 bits of memory address of the remote variable
  4630. * storing the 4-byte word offset that identifies the tail
  4631. * element within the ring.
  4632. * (The tail offset variable has type A_UINT32.)
  4633. * Valid for HW_TO_SW and SW_TO_SW rings.
  4634. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4635. * Upper 32 bits of memory address of the remote variable
  4636. * storing the 4-byte word offset that identifies the tail
  4637. * element within the ring.
  4638. * (The tail offset variable has type A_UINT32.)
  4639. * Valid for HW_TO_SW and SW_TO_SW rings.
  4640. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4641. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4642. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4643. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4644. * dword10 - b'0:31 - ring_msi_data: MSI data
  4645. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4646. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4647. * dword11 - b'0:14 - intr_batch_counter_th:
  4648. * batch counter threshold is in units of 4-byte words.
  4649. * HW internally maintains and increments batch count.
  4650. * (see SRING spec for detail description).
  4651. * When batch count reaches threshold value, an interrupt
  4652. * is generated by HW.
  4653. * b'15 - sw_intr_mode:
  4654. * This configuration shall be static.
  4655. * Only programmed at power up.
  4656. * 0: generate pulse style sw interrupts
  4657. * 1: generate level style sw interrupts
  4658. * b'16:31 - intr_timer_th:
  4659. * The timer init value when timer is idle or is
  4660. * initialized to start downcounting.
  4661. * In 8us units (to cover a range of 0 to 524 ms)
  4662. * dword12 - b'0:15 - intr_low_threshold:
  4663. * Used only by Consumer ring to generate ring_sw_int_p.
  4664. * Ring entries low threshold water mark, that is used
  4665. * in combination with the interrupt timer as well as
  4666. * the the clearing of the level interrupt.
  4667. * b'16:18 - prefetch_timer_cfg:
  4668. * Used only by Consumer ring to set timer mode to
  4669. * support Application prefetch handling.
  4670. * The external tail offset/pointer will be updated
  4671. * at following intervals:
  4672. * 3'b000: (Prefetch feature disabled; used only for debug)
  4673. * 3'b001: 1 usec
  4674. * 3'b010: 4 usec
  4675. * 3'b011: 8 usec (default)
  4676. * 3'b100: 16 usec
  4677. * Others: Reserverd
  4678. * b'19 - response_required:
  4679. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4680. * b'20 - ipa_drop_flag:
  4681. Indicates that host will config ipa drop threshold percentage
  4682. * b'21:31 - reserved: reserved for future use
  4683. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4684. * b'8:15 - ipa drop high threshold percentage:
  4685. * b'16:31 - Reserved
  4686. */
  4687. PREPACK struct htt_sring_setup_t {
  4688. A_UINT32 msg_type: 8,
  4689. pdev_id: 8,
  4690. ring_id: 8,
  4691. ring_type: 8;
  4692. A_UINT32 ring_base_addr_lo;
  4693. A_UINT32 ring_base_addr_hi;
  4694. A_UINT32 ring_size: 16,
  4695. ring_entry_size: 8,
  4696. ring_misc_cfg_flag: 8;
  4697. A_UINT32 ring_head_offset32_remote_addr_lo;
  4698. A_UINT32 ring_head_offset32_remote_addr_hi;
  4699. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4700. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4701. A_UINT32 ring_msi_addr_lo;
  4702. A_UINT32 ring_msi_addr_hi;
  4703. A_UINT32 ring_msi_data;
  4704. A_UINT32 intr_batch_counter_th: 15,
  4705. sw_intr_mode: 1,
  4706. intr_timer_th: 16;
  4707. A_UINT32 intr_low_threshold: 16,
  4708. prefetch_timer_cfg: 3,
  4709. response_required: 1,
  4710. ipa_drop_flag: 1,
  4711. reserved1: 11;
  4712. A_UINT32 ipa_drop_low_threshold: 8,
  4713. ipa_drop_high_threshold: 8,
  4714. reserved: 16;
  4715. } POSTPACK;
  4716. enum htt_srng_ring_type {
  4717. HTT_HW_TO_SW_RING = 0,
  4718. HTT_SW_TO_HW_RING,
  4719. HTT_SW_TO_SW_RING,
  4720. /* Insert new ring types above this line */
  4721. };
  4722. enum htt_srng_ring_id {
  4723. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4724. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4725. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4726. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4727. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4728. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4729. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4730. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4731. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4732. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4733. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4734. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4735. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4736. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4737. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4738. /* Add Other SRING which can't be directly configured by host software above this line */
  4739. };
  4740. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4741. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4742. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4743. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4744. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4745. HTT_SRING_SETUP_PDEV_ID_S)
  4746. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4747. do { \
  4748. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4749. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4750. } while (0)
  4751. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4752. #define HTT_SRING_SETUP_RING_ID_S 16
  4753. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4754. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4755. HTT_SRING_SETUP_RING_ID_S)
  4756. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4757. do { \
  4758. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4759. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4760. } while (0)
  4761. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4762. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4763. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4764. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4765. HTT_SRING_SETUP_RING_TYPE_S)
  4766. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4769. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4770. } while (0)
  4771. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4772. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4773. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4774. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4775. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4776. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4777. do { \
  4778. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4779. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4780. } while (0)
  4781. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4782. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4783. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4784. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4785. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4786. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4787. do { \
  4788. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4789. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4790. } while (0)
  4791. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4792. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4793. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4794. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4795. HTT_SRING_SETUP_RING_SIZE_S)
  4796. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4797. do { \
  4798. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4799. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4800. } while (0)
  4801. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4802. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4803. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4804. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4805. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4806. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4809. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4810. } while (0)
  4811. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4812. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4813. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4814. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4815. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4816. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4817. do { \
  4818. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4819. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4820. } while (0)
  4821. /* This control bit is applicable to only Producer, which updates Ring ID field
  4822. * of each descriptor before pushing into the ring.
  4823. * 0: updates ring_id(default)
  4824. * 1: ring_id updating disabled */
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4827. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4828. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4829. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4831. do { \
  4832. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4833. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4834. } while (0)
  4835. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4836. * of each descriptor before pushing into the ring.
  4837. * 0: updates Loopcnt(default)
  4838. * 1: Loopcnt updating disabled */
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4840. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4842. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4843. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4845. do { \
  4846. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4847. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4848. } while (0)
  4849. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4850. * into security_id port of GXI/AXI. */
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4854. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4855. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4857. do { \
  4858. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4859. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4860. } while (0)
  4861. /* During MSI write operation, SRNG drives value of this register bit into
  4862. * swap bit of GXI/AXI. */
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4864. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4866. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4867. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4871. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4872. } while (0)
  4873. /* During Pointer write operation, SRNG drives value of this register bit into
  4874. * swap bit of GXI/AXI. */
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4876. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4878. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4879. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4881. do { \
  4882. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4883. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4884. } while (0)
  4885. /* During any data or TLV write operation, SRNG drives value of this register
  4886. * bit into swap bit of GXI/AXI. */
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4888. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4889. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4890. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4891. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4893. do { \
  4894. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4895. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4896. } while (0)
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4898. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4899. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4900. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4901. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4902. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4903. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4904. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4905. do { \
  4906. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4907. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4908. } while (0)
  4909. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4910. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4911. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4912. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4913. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4914. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4915. do { \
  4916. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4917. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4918. } while (0)
  4919. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4920. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4921. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4922. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4923. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4924. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4927. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4928. } while (0)
  4929. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4930. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4931. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4932. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4933. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4934. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4935. do { \
  4936. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4937. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4938. } while (0)
  4939. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4940. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4941. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4942. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4943. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4944. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4945. do { \
  4946. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4947. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4948. } while (0)
  4949. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4950. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4951. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4952. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4953. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4954. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4957. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4958. } while (0)
  4959. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4960. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4961. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4962. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4963. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4964. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4967. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4968. } while (0)
  4969. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4970. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4971. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4972. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4973. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4974. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4977. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4978. } while (0)
  4979. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4980. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4981. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4982. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4983. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4984. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4985. do { \
  4986. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4987. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4988. } while (0)
  4989. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4990. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4991. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4992. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4993. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4994. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4997. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4998. } while (0)
  4999. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5000. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5001. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5002. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5003. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5004. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5005. do { \
  5006. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5007. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5008. } while (0)
  5009. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5010. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5011. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5012. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5013. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5014. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5015. do { \
  5016. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5017. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5018. } while (0)
  5019. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5020. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5021. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5022. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5023. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5024. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5027. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5028. } while (0)
  5029. /**
  5030. * @brief host -> target RX ring selection config message
  5031. *
  5032. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5033. *
  5034. * @details
  5035. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5036. * configure RXDMA rings.
  5037. * The configuration is per ring based and includes both packet subtypes
  5038. * and PPDU/MPDU TLVs.
  5039. *
  5040. * The message would appear as follows:
  5041. *
  5042. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5043. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5044. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5045. * |-------------------------------------------------------------------|
  5046. * | rsvd2 | ring_buffer_size |
  5047. * |-------------------------------------------------------------------|
  5048. * | packet_type_enable_flags_0 |
  5049. * |-------------------------------------------------------------------|
  5050. * | packet_type_enable_flags_1 |
  5051. * |-------------------------------------------------------------------|
  5052. * | packet_type_enable_flags_2 |
  5053. * |-------------------------------------------------------------------|
  5054. * | packet_type_enable_flags_3 |
  5055. * |-------------------------------------------------------------------|
  5056. * | tlv_filter_in_flags |
  5057. * |-------------------------------------------------------------------|
  5058. * | rx_header_offset | rx_packet_offset |
  5059. * |-------------------------------------------------------------------|
  5060. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5061. * |-------------------------------------------------------------------|
  5062. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5063. * |-------------------------------------------------------------------|
  5064. * | rsvd3 | rx_attention_offset |
  5065. * |-------------------------------------------------------------------|
  5066. * | rsvd4 | mo| fp| rx_drop_threshold |
  5067. * | |ndp|ndp| |
  5068. * |-------------------------------------------------------------------|
  5069. * Where:
  5070. * PS = pkt_swap
  5071. * SS = status_swap
  5072. * OV = rx_offsets_valid
  5073. * DT = drop_thresh_valid
  5074. * The message is interpreted as follows:
  5075. * dword0 - b'0:7 - msg_type: This will be set to
  5076. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5077. * b'8:15 - pdev_id:
  5078. * 0 (for rings at SOC/UMAC level),
  5079. * 1/2/3 mac id (for rings at LMAC level)
  5080. * b'16:23 - ring_id : Identify the ring to configure.
  5081. * More details can be got from enum htt_srng_ring_id
  5082. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5083. * BUF_RING_CFG_0 defs within HW .h files,
  5084. * e.g. wmac_top_reg_seq_hwioreg.h
  5085. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5086. * BUF_RING_CFG_0 defs within HW .h files,
  5087. * e.g. wmac_top_reg_seq_hwioreg.h
  5088. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5089. * configuration fields are valid
  5090. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5091. * rx_drop_threshold field is valid
  5092. * b'28 - rx_mon_global_en: Enable/Disable global register
  5093. 8 configuration in Rx monitor module.
  5094. * b'29:31 - rsvd1: reserved for future use
  5095. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5096. * in byte units.
  5097. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5098. * b'16:18 - config_length_mgmt (MGMT):
  5099. * Represents the length of mpdu bytes for mgmt pkt.
  5100. * valid values:
  5101. * 001 - 64bytes
  5102. * 010 - 128bytes
  5103. * 100 - 256bytes
  5104. * 111 - Full mpdu bytes
  5105. * b'19:21 - config_length_ctrl (CTRL):
  5106. * Represents the length of mpdu bytes for ctrl pkt.
  5107. * valid values:
  5108. * 001 - 64bytes
  5109. * 010 - 128bytes
  5110. * 100 - 256bytes
  5111. * 111 - Full mpdu bytes
  5112. * b'22:24 - config_length_data (DATA):
  5113. * Represents the length of mpdu bytes for data pkt.
  5114. * valid values:
  5115. * 001 - 64bytes
  5116. * 010 - 128bytes
  5117. * 100 - 256bytes
  5118. * 111 - Full mpdu bytes
  5119. * b'25:26 - rx_hdr_len:
  5120. * Specifies the number of bytes of recvd packet to copy
  5121. * into the rx_hdr tlv.
  5122. * supported values for now by host:
  5123. * 01 - 64bytes
  5124. * 10 - 128bytes
  5125. * 11 - 256bytes
  5126. * default - 128 bytes
  5127. * b'27:31 - rsvd2: Reserved for future use
  5128. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5129. * Enable MGMT packet from 0b0000 to 0b1001
  5130. * bits from low to high: FP, MD, MO - 3 bits
  5131. * FP: Filter_Pass
  5132. * MD: Monitor_Direct
  5133. * MO: Monitor_Other
  5134. * 10 mgmt subtypes * 3 bits -> 30 bits
  5135. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5136. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5137. * Enable MGMT packet from 0b1010 to 0b1111
  5138. * bits from low to high: FP, MD, MO - 3 bits
  5139. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5140. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5141. * Enable CTRL packet from 0b0000 to 0b1001
  5142. * bits from low to high: FP, MD, MO - 3 bits
  5143. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5144. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5145. * Enable CTRL packet from 0b1010 to 0b1111,
  5146. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5147. * bits from low to high: FP, MD, MO - 3 bits
  5148. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5149. * dword6 - b'0:31 - tlv_filter_in_flags:
  5150. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5151. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5152. * dword7 - b'0:15 - rx_packet_offset: rx_packet_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_1 defs within HW .h files,
  5156. * e.g. wmac_top_reg_seq_hwioreg.h
  5157. * - b'16:31 - rx_header_offset: rx_header_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_1 defs within HW .h files,
  5161. * e.g. wmac_top_reg_seq_hwioreg.h
  5162. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_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_2 defs within HW .h files,
  5166. * e.g. wmac_top_reg_seq_hwioreg.h
  5167. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_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_2 defs within HW .h files,
  5171. * e.g. wmac_top_reg_seq_hwioreg.h
  5172. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5173. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5174. * A value of 0 will be considered as ignore this config.
  5175. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5176. * e.g. wmac_top_reg_seq_hwioreg.h
  5177. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5178. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5179. * A value of 0 will be considered as ignore this config.
  5180. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5181. * e.g. wmac_top_reg_seq_hwioreg.h
  5182. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5183. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5184. * A value of 0 will be considered as ignore this config.
  5185. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5186. * e.g. wmac_top_reg_seq_hwioreg.h
  5187. * - b'16:31 - rsvd3 for future use
  5188. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5189. * to source rings. Consumer drops packets if the available
  5190. * words in the ring falls below the configured threshold
  5191. * value.
  5192. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5193. * by host. 1 -> subscribed
  5194. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5195. * by host. 1 -> subscribed
  5196. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5197. * subscribed by host. 1 -> subscribed
  5198. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5199. * selection for the FP PHY ERR status tlv.
  5200. * 0 - wbm2rxdma_buf_source_ring
  5201. * 1 - fw2rxdma_buf_source_ring
  5202. * 2 - sw2rxdma_buf_source_ring
  5203. * 3 - no_buffer_ring
  5204. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5205. * selection for the FP PHY ERR status tlv.
  5206. * 0 - rxdma_release_ring
  5207. * 1 - rxdma2fw_ring
  5208. * 2 - rxdma2sw_ring
  5209. * 3 - rxdma2reo_ring
  5210. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5211. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5212. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5213. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5214. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5215. * 0: MSDU level logging
  5216. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5217. * 0: MSDU level logging
  5218. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5219. * 0: MSDU level logging
  5220. * - b'23 - word_mask_compaction: enable/disable word mask for
  5221. * mpdu/msdu start/end tlvs
  5222. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5223. * manager override
  5224. * - b'25:28 - rbm_override_val: return buffer manager override value
  5225. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5226. * which have to be posted to host from phy.
  5227. * Corresponding to errors defined in
  5228. * phyrx_abort_request_reason enums 0 to 31.
  5229. * Refer to RXPCU register definition header files for the
  5230. * phyrx_abort_request_reason enum definition.
  5231. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5232. * errors which have to be posted to host from phy.
  5233. * Corresponding to errors defined in
  5234. * phyrx_abort_request_reason enums 32 to 63.
  5235. * Refer to RXPCU register definition header files for the
  5236. * phyrx_abort_request_reason enum definition.
  5237. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5238. * applicable if word mask enabled
  5239. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5240. * applicable if word mask enabled
  5241. * - b'19:31 - rsvd7
  5242. * dword15- b'0:16 - rx_msdu_end_word_mask
  5243. * - b'17:31 - rsvd5
  5244. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5245. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5246. * buffer
  5247. * 1: RX_PKT TLV logging at specified offset for the
  5248. * subsequent buffer
  5249. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5250. */
  5251. PREPACK struct htt_rx_ring_selection_cfg_t {
  5252. A_UINT32 msg_type: 8,
  5253. pdev_id: 8,
  5254. ring_id: 8,
  5255. status_swap: 1,
  5256. pkt_swap: 1,
  5257. rx_offsets_valid: 1,
  5258. drop_thresh_valid: 1,
  5259. rx_mon_global_en: 1,
  5260. rsvd1: 3;
  5261. A_UINT32 ring_buffer_size: 16,
  5262. config_length_mgmt:3,
  5263. config_length_ctrl:3,
  5264. config_length_data:3,
  5265. rx_hdr_len: 2,
  5266. rsvd2: 5;
  5267. A_UINT32 packet_type_enable_flags_0;
  5268. A_UINT32 packet_type_enable_flags_1;
  5269. A_UINT32 packet_type_enable_flags_2;
  5270. A_UINT32 packet_type_enable_flags_3;
  5271. A_UINT32 tlv_filter_in_flags;
  5272. A_UINT32 rx_packet_offset: 16,
  5273. rx_header_offset: 16;
  5274. A_UINT32 rx_mpdu_end_offset: 16,
  5275. rx_mpdu_start_offset: 16;
  5276. A_UINT32 rx_msdu_end_offset: 16,
  5277. rx_msdu_start_offset: 16;
  5278. A_UINT32 rx_attn_offset: 16,
  5279. rsvd3: 16;
  5280. A_UINT32 rx_drop_threshold: 10,
  5281. fp_ndp: 1,
  5282. mo_ndp: 1,
  5283. fp_phy_err: 1,
  5284. fp_phy_err_buf_src: 2,
  5285. fp_phy_err_buf_dest: 2,
  5286. pkt_type_enable_msdu_or_mpdu_logging:3,
  5287. dma_mpdu_mgmt: 1,
  5288. dma_mpdu_ctrl: 1,
  5289. dma_mpdu_data: 1,
  5290. word_mask_compaction_enable:1,
  5291. rbm_override_enable: 1,
  5292. rbm_override_val: 4,
  5293. rsvd4: 3;
  5294. A_UINT32 phy_err_mask;
  5295. A_UINT32 phy_err_mask_cont;
  5296. A_UINT32 rx_mpdu_start_word_mask:16,
  5297. rx_mpdu_end_word_mask: 3,
  5298. rsvd7: 13;
  5299. A_UINT32 rx_msdu_end_word_mask: 17,
  5300. rsvd5: 15;
  5301. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5302. rx_pkt_tlv_offset: 15,
  5303. rsvd6: 16;
  5304. } POSTPACK;
  5305. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5306. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5307. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5308. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5309. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5310. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5311. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5312. do { \
  5313. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5314. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5315. } while (0)
  5316. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5317. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5318. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5319. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5320. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5321. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5322. do { \
  5323. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5324. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5325. } while (0)
  5326. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5327. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5328. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5329. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5330. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5331. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5332. do { \
  5333. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5334. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5335. } while (0)
  5336. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5337. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5338. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5339. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5340. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5341. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5342. do { \
  5343. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5344. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5345. } while (0)
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5347. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5348. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5349. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5350. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5351. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5352. do { \
  5353. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5354. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5355. } while (0)
  5356. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5357. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5358. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5359. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5360. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5361. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5362. do { \
  5363. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5364. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5365. } while (0)
  5366. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5367. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5368. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5369. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5370. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5371. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5374. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5375. } while (0)
  5376. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5377. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5378. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5379. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5380. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5381. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5382. do { \
  5383. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5384. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5385. } while (0)
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5387. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5388. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5389. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5390. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5391. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5394. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5395. } while (0)
  5396. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5397. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5398. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5399. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5400. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5401. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5404. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5405. } while (0)
  5406. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5407. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5408. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5409. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5410. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5411. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5414. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5415. } while (0)
  5416. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5417. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5419. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5420. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5421. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5424. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5425. } while(0)
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5429. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5430. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5432. do { \
  5433. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5434. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5435. } while (0)
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5439. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5440. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5442. do { \
  5443. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5445. } while (0)
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5449. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5450. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5452. do { \
  5453. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5455. } while (0)
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5459. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5460. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5462. do { \
  5463. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5465. } while (0)
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5467. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5469. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5470. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5471. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5475. } while (0)
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5479. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5480. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5481. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5482. do { \
  5483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5485. } while (0)
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5487. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5489. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5490. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5491. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5492. do { \
  5493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5495. } while (0)
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5497. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5498. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5499. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5500. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5501. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5502. do { \
  5503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5505. } while (0)
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5507. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5509. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5510. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5511. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5515. } while (0)
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5517. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5519. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5520. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5522. do { \
  5523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5525. } while (0)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5529. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5530. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5535. } while (0)
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5539. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5540. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5545. } while (0)
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5549. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5550. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5551. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5555. } while (0)
  5556. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5557. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5558. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5559. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5560. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5561. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5565. } while (0)
  5566. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5567. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5568. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5569. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5570. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5571. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5572. do { \
  5573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5575. } while (0)
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5577. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5578. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5579. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5580. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5581. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5582. do { \
  5583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5585. } while (0)
  5586. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5587. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5588. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5589. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5590. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5591. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5595. } while (0)
  5596. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5597. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5598. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5599. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5600. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5601. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5605. } while (0)
  5606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5609. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5610. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5612. do { \
  5613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5615. } while (0)
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5617. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5618. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5619. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5620. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5621. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5625. } while (0)
  5626. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5627. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5628. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5629. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5630. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5631. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5632. do { \
  5633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5635. } while (0)
  5636. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5637. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5638. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5639. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5640. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5641. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5645. } while (0)
  5646. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5647. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5648. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5649. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5650. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5651. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5652. do { \
  5653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5655. } while (0)
  5656. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5657. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5658. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5659. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5660. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5661. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5662. do { \
  5663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5665. } while (0)
  5666. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5667. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5668. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5669. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5670. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5671. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5675. } while (0)
  5676. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5677. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5678. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5679. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5680. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5681. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5685. } while (0)
  5686. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5687. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5688. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5689. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5690. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5691. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5692. do { \
  5693. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5694. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5695. } while (0)
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5697. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5698. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5699. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5700. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5701. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5702. do { \
  5703. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5704. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5705. } while (0)
  5706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5707. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5708. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5709. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5710. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5711. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5714. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5715. } while (0)
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5717. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5718. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5719. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5720. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5721. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5722. do { \
  5723. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5724. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5725. } while (0)
  5726. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5727. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5728. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5729. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5730. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5731. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5732. do { \
  5733. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5734. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5735. } while (0)
  5736. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5737. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5738. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5739. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5740. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5741. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5742. do { \
  5743. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5744. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5745. } while (0)
  5746. /*
  5747. * Subtype based MGMT frames enable bits.
  5748. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5749. */
  5750. /* association request */
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5757. /* association response */
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5764. /* Reassociation request */
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5771. /* Reassociation response */
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5778. /* Probe request */
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5785. /* Probe response */
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5792. /* Timing Advertisement */
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5799. /* Reserved */
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5806. /* Beacon */
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5813. /* ATIM */
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5820. /* Disassociation */
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5827. /* Authentication */
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5834. /* Deauthentication */
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5841. /* Action */
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5848. /* Action No Ack */
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5855. /* Reserved */
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5862. /*
  5863. * Subtype based CTRL frames enable bits.
  5864. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5865. */
  5866. /* Reserved */
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5873. /* Reserved */
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5880. /* Reserved */
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5887. /* Reserved */
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5894. /* Reserved */
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5901. /* Reserved */
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5908. /* Reserved */
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5915. /* Control Wrapper */
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5922. /* Block Ack Request */
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5929. /* Block Ack*/
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5936. /* PS-POLL */
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5943. /* RTS */
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5950. /* CTS */
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5957. /* ACK */
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5964. /* CF-END */
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5971. /* CF-END + CF-ACK */
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5978. /* Multicast data */
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5985. /* Unicast data */
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5992. /* NULL data */
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6000. do { \
  6001. HTT_CHECK_SET_VAL(httsym, value); \
  6002. (word) |= (value) << httsym##_S; \
  6003. } while (0)
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6005. (((word) & httsym##_M) >> httsym##_S)
  6006. #define htt_rx_ring_pkt_enable_subtype_set( \
  6007. word, flag, mode, type, subtype, val) \
  6008. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6009. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6010. #define htt_rx_ring_pkt_enable_subtype_get( \
  6011. word, flag, mode, type, subtype) \
  6012. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6013. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6014. /* Definition to filter in TLVs */
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6043. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6044. do { \
  6045. HTT_CHECK_SET_VAL(httsym, enable); \
  6046. (word) |= (enable) << httsym##_S; \
  6047. } while (0)
  6048. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6049. (((word) & httsym##_M) >> httsym##_S)
  6050. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6051. HTT_RX_RING_TLV_ENABLE_SET( \
  6052. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6053. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6054. HTT_RX_RING_TLV_ENABLE_GET( \
  6055. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6056. /**
  6057. * @brief host -> target TX monitor config message
  6058. *
  6059. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6060. *
  6061. * @details
  6062. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6063. * configure RXDMA rings.
  6064. * The configuration is per ring based and includes both packet types
  6065. * and PPDU/MPDU TLVs.
  6066. *
  6067. * The message would appear as follows:
  6068. *
  6069. * |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|
  6070. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6071. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6072. * |-----------+--------+--------+-----+------------------------------------|
  6073. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6074. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6075. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6076. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6077. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6078. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6079. * |------------------------------------------------------------------------|
  6080. * | tlv_filter_mask_in0 |
  6081. * |------------------------------------------------------------------------|
  6082. * | tlv_filter_mask_in1 |
  6083. * |------------------------------------------------------------------------|
  6084. * | tlv_filter_mask_in2 |
  6085. * |------------------------------------------------------------------------|
  6086. * | tlv_filter_mask_in3 |
  6087. * |-----------------+-----------------+---------------------+--------------|
  6088. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6089. * |------------------------------------------------------------------------|
  6090. * | pcu_ppdu_setup_word_mask |
  6091. * |--------------------+--+--+--+-----+---------------------+--------------|
  6092. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6093. * |------------------------------------------------------------------------|
  6094. *
  6095. * Where:
  6096. * PS = pkt_swap
  6097. * SS = status_swap
  6098. * The message is interpreted as follows:
  6099. * dword0 - b'0:7 - msg_type: This will be set to
  6100. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6101. * b'8:15 - pdev_id:
  6102. * 0 (for rings at SOC level),
  6103. * 1/2/3 mac id (for rings at LMAC level)
  6104. * b'16:23 - ring_id : Identify the ring to configure.
  6105. * More details can be got from enum htt_srng_ring_id
  6106. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6107. * BUF_RING_CFG_0 defs within HW .h files,
  6108. * e.g. wmac_top_reg_seq_hwioreg.h
  6109. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6110. * BUF_RING_CFG_0 defs within HW .h files,
  6111. * e.g. wmac_top_reg_seq_hwioreg.h
  6112. * b'26 - tx_mon_global_en: Enable/Disable global register
  6113. * configuration in Tx monitor module.
  6114. * b'27:31 - rsvd1: reserved for future use
  6115. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6116. * in byte units.
  6117. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6118. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6119. * 64, 128, 256.
  6120. * If all 3 bits are set config length is > 256.
  6121. * if val is '0', then ignore this field.
  6122. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6123. * 64, 128, 256.
  6124. * If all 3 bits are set config length is > 256.
  6125. * if val is '0', then ignore this field.
  6126. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6127. * 64, 128, 256.
  6128. * If all 3 bits are set config length is > 256.
  6129. * If val is '0', then ignore this field.
  6130. * - b'25:31 - rsvd2: Reserved for future use
  6131. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6132. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6133. * If packet_type_enable_flags is '1' for MGMT type,
  6134. * monitor will ignore this bit and allow this TLV.
  6135. * If packet_type_enable_flags is '0' for MGMT type,
  6136. * monitor will use this bit to enable/disable logging
  6137. * of this TLV.
  6138. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6139. * If packet_type_enable_flags is '1' for CTRL type,
  6140. * monitor will ignore this bit and allow this TLV.
  6141. * If packet_type_enable_flags is '0' for CTRL type,
  6142. * monitor will use this bit to enable/disable logging
  6143. * of this TLV.
  6144. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6145. * If packet_type_enable_flags is '1' for DATA type,
  6146. * monitor will ignore this bit and allow this TLV.
  6147. * If packet_type_enable_flags is '0' for DATA type,
  6148. * monitor will use this bit to enable/disable logging
  6149. * of this TLV.
  6150. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6151. * If packet_type_enable_flags is '1' for MGMT type,
  6152. * monitor will ignore this bit and allow this TLV.
  6153. * If packet_type_enable_flags is '0' for MGMT type,
  6154. * monitor will use this bit to enable/disable logging
  6155. * of this TLV.
  6156. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6157. * If packet_type_enable_flags is '1' for CTRL type,
  6158. * monitor will ignore this bit and allow this TLV.
  6159. * If packet_type_enable_flags is '0' for CTRL type,
  6160. * monitor will use this bit to enable/disable logging
  6161. * of this TLV.
  6162. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6163. * If packet_type_enable_flags is '1' for DATA type,
  6164. * monitor will ignore this bit and allow this TLV.
  6165. * If packet_type_enable_flags is '0' for DATA type,
  6166. * monitor will use this bit to enable/disable logging
  6167. * of this TLV.
  6168. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6169. * If packet_type_enable_flags is '1' for MGMT type,
  6170. * monitor will ignore this bit and allow this TLV.
  6171. * If packet_type_enable_flags is '0' for MGMT type,
  6172. * monitor will use this bit to enable/disable logging
  6173. * of this TLV.
  6174. * If filter_in_TX_MPDU_START = 1 it is recommended
  6175. * to set this bit.
  6176. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6177. * If packet_type_enable_flags is '1' for CTRL type,
  6178. * monitor will ignore this bit and allow this TLV.
  6179. * If packet_type_enable_flags is '0' for CTRL type,
  6180. * monitor will use this bit to enable/disable logging
  6181. * of this TLV.
  6182. * If filter_in_TX_MPDU_START = 1 it is recommended
  6183. * to set this bit.
  6184. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6185. * If packet_type_enable_flags is '1' for DATA type,
  6186. * monitor will ignore this bit and allow this TLV.
  6187. * If packet_type_enable_flags is '0' for DATA type,
  6188. * monitor will use this bit to enable/disable logging
  6189. * of this TLV.
  6190. * If filter_in_TX_MPDU_START = 1 it is recommended
  6191. * to set this bit.
  6192. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6193. * If packet_type_enable_flags is '1' for MGMT type,
  6194. * monitor will ignore this bit and allow this TLV.
  6195. * If packet_type_enable_flags is '0' for MGMT type,
  6196. * monitor will use this bit to enable/disable logging
  6197. * of this TLV.
  6198. * If filter_in_TX_MSDU_START = 1 it is recommended
  6199. * to set this bit.
  6200. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6201. * If packet_type_enable_flags is '1' for CTRL type,
  6202. * monitor will ignore this bit and allow this TLV.
  6203. * If packet_type_enable_flags is '0' for CTRL type,
  6204. * monitor will use this bit to enable/disable logging
  6205. * of this TLV.
  6206. * If filter_in_TX_MSDU_START = 1 it is recommended
  6207. * to set this bit.
  6208. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6209. * If packet_type_enable_flags is '1' for DATA type,
  6210. * monitor will ignore this bit and allow this TLV.
  6211. * If packet_type_enable_flags is '0' for DATA type,
  6212. * monitor will use this bit to enable/disable logging
  6213. * of this TLV.
  6214. * If filter_in_TX_MSDU_START = 1 it is recommended
  6215. * to set this bit.
  6216. * b'15:31 - rsvd3: Reserved for future use
  6217. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6218. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6219. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6220. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6221. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6222. * - b'8:15 - tx_peer_entry_word_mask:
  6223. * - b'16:23 - tx_queue_ext_word_mask:
  6224. * - b'24:31 - tx_msdu_start_word_mask:
  6225. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6226. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6227. * - b'8:15 - rxpcu_user_setup_word_mask:
  6228. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6229. * MGMT, CTRL, DATA
  6230. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6231. * 0 -> MSDU level logging is enabled
  6232. * (valid only if bit is set in
  6233. * pkt_type_enable_msdu_or_mpdu_logging)
  6234. * 1 -> MPDU level logging is enabled
  6235. * (valid only if bit is set in
  6236. * pkt_type_enable_msdu_or_mpdu_logging)
  6237. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6238. * 0 -> MSDU level logging is enabled
  6239. * (valid only if bit is set in
  6240. * pkt_type_enable_msdu_or_mpdu_logging)
  6241. * 1 -> MPDU level logging is enabled
  6242. * (valid only if bit is set in
  6243. * pkt_type_enable_msdu_or_mpdu_logging)
  6244. * - b'21 - dma_mpdu_data(D) : For DATA
  6245. * 0 -> MSDU level logging is enabled
  6246. * (valid only if bit is set in
  6247. * pkt_type_enable_msdu_or_mpdu_logging)
  6248. * 1 -> MPDU level logging is enabled
  6249. * (valid only if bit is set in
  6250. * pkt_type_enable_msdu_or_mpdu_logging)
  6251. * - b'22:31 - rsvd4 for future use
  6252. */
  6253. PREPACK struct htt_tx_monitor_cfg_t {
  6254. A_UINT32 msg_type: 8,
  6255. pdev_id: 8,
  6256. ring_id: 8,
  6257. status_swap: 1,
  6258. pkt_swap: 1,
  6259. tx_mon_global_en: 1,
  6260. rsvd1: 5;
  6261. A_UINT32 ring_buffer_size: 16,
  6262. config_length_mgmt: 3,
  6263. config_length_ctrl: 3,
  6264. config_length_data: 3,
  6265. rsvd2: 7;
  6266. A_UINT32 pkt_type_enable_flags: 3,
  6267. filter_in_tx_mpdu_start_mgmt: 1,
  6268. filter_in_tx_mpdu_start_ctrl: 1,
  6269. filter_in_tx_mpdu_start_data: 1,
  6270. filter_in_tx_msdu_start_mgmt: 1,
  6271. filter_in_tx_msdu_start_ctrl: 1,
  6272. filter_in_tx_msdu_start_data: 1,
  6273. filter_in_tx_mpdu_end_mgmt: 1,
  6274. filter_in_tx_mpdu_end_ctrl: 1,
  6275. filter_in_tx_mpdu_end_data: 1,
  6276. filter_in_tx_msdu_end_mgmt: 1,
  6277. filter_in_tx_msdu_end_ctrl: 1,
  6278. filter_in_tx_msdu_end_data: 1,
  6279. rsvd3: 17;
  6280. A_UINT32 tlv_filter_mask_in0;
  6281. A_UINT32 tlv_filter_mask_in1;
  6282. A_UINT32 tlv_filter_mask_in2;
  6283. A_UINT32 tlv_filter_mask_in3;
  6284. A_UINT32 tx_fes_setup_word_mask: 8,
  6285. tx_peer_entry_word_mask: 8,
  6286. tx_queue_ext_word_mask: 8,
  6287. tx_msdu_start_word_mask: 8;
  6288. A_UINT32 pcu_ppdu_setup_word_mask;
  6289. A_UINT32 tx_mpdu_start_word_mask: 8,
  6290. rxpcu_user_setup_word_mask: 8,
  6291. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6292. dma_mpdu_mgmt: 1,
  6293. dma_mpdu_ctrl: 1,
  6294. dma_mpdu_data: 1,
  6295. rsvd4: 10;
  6296. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6297. tx_peer_entry_v2_word_mask: 12,
  6298. rsvd5: 10;
  6299. A_UINT32 fes_status_end_word_mask: 16,
  6300. response_end_status_word_mask: 16;
  6301. A_UINT32 fes_status_prot_word_mask: 11,
  6302. rsvd6: 21;
  6303. } POSTPACK;
  6304. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6305. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6306. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6307. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6308. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6309. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6310. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6311. do { \
  6312. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6313. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6314. } while (0)
  6315. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6316. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6317. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6318. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6319. HTT_TX_MONITOR_CFG_RING_ID_S)
  6320. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6323. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6324. } while (0)
  6325. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6326. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6327. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6328. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6329. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6330. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6331. do { \
  6332. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6333. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6334. } while (0)
  6335. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6336. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6337. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6338. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6339. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6340. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6341. do { \
  6342. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6343. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6344. } while (0)
  6345. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6346. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6347. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6348. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6349. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6350. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6351. do { \
  6352. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6353. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6354. } while (0)
  6355. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6356. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6357. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6358. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6359. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6360. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6361. do { \
  6362. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6363. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6364. } while (0)
  6365. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6366. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6367. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6368. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6369. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6370. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6373. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6374. } while (0)
  6375. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6376. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6377. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6378. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6379. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6380. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6383. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6384. } while (0)
  6385. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6386. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6387. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6388. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6389. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6390. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6391. do { \
  6392. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6393. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6394. } while (0)
  6395. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6396. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6397. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6398. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6399. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6400. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6401. do { \
  6402. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6403. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6404. } while (0)
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6408. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6409. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6411. do { \
  6412. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6413. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6414. } while (0)
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6418. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6419. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6423. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6424. } while (0)
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6426. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6428. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6429. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6430. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6431. do { \
  6432. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6433. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6434. } while (0)
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6438. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6439. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6441. do { \
  6442. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6443. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6444. } while (0)
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6448. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6449. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6451. do { \
  6452. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6453. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6454. } while (0)
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6456. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6458. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6459. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6460. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6463. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6464. } while (0)
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6466. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6468. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6469. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6470. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6473. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6474. } while (0)
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6476. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6478. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6479. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6480. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6481. do { \
  6482. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6483. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6484. } while (0)
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6486. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6488. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6489. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6490. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6491. do { \
  6492. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6493. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6494. } while (0)
  6495. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6496. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6498. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6499. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6500. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6503. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6504. } while (0)
  6505. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6506. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6508. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6509. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6510. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6513. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6514. } while (0)
  6515. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6516. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6517. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6519. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6520. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6526. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6527. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6529. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6530. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6536. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6537. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6539. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6540. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6544. } while (0)
  6545. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6546. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6547. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6548. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6549. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6550. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6553. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6554. } while (0)
  6555. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6556. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6557. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6558. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6559. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6560. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6563. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6564. } while (0)
  6565. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6566. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6567. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6568. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6569. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6570. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6573. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6574. } while (0)
  6575. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6576. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6577. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6578. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6579. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6580. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6583. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6584. } while (0)
  6585. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6586. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6587. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6588. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6589. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6590. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6593. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6594. } while (0)
  6595. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6596. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6597. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6598. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6599. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6600. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6603. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6604. } while (0)
  6605. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6606. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6607. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6608. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6609. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6610. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6613. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6614. } while (0)
  6615. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6616. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6617. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6618. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6619. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6620. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6621. do { \
  6622. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6623. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6624. } while (0)
  6625. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6626. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6627. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6628. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6629. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6630. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6633. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6634. } while (0)
  6635. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6636. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6637. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6638. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6639. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6640. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6643. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6644. } while (0)
  6645. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6646. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6647. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6648. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6649. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6650. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6653. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6654. } while (0)
  6655. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6656. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6657. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6658. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6659. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6660. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6663. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6664. } while (0)
  6665. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6666. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6667. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6668. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6669. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6670. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6673. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6674. } while (0)
  6675. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6676. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6677. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6678. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6679. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6680. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6683. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6684. } while (0)
  6685. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6686. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6687. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6688. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6689. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6690. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6691. do { \
  6692. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6693. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6694. } while (0)
  6695. /*
  6696. * pkt_type_enable_flags
  6697. */
  6698. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6699. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6700. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6701. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6702. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6703. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6704. /*
  6705. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6706. */
  6707. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6708. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6709. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6710. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6711. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6712. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6713. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6714. do { \
  6715. HTT_CHECK_SET_VAL(httsym, value); \
  6716. (word) |= (value) << httsym##_S; \
  6717. } while (0)
  6718. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6719. (((word) & httsym##_M) >> httsym##_S)
  6720. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6721. * type -> MGMT, CTRL, DATA*/
  6722. #define htt_tx_ring_pkt_type_set( \
  6723. word, mode, type, val) \
  6724. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6725. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6726. #define htt_tx_ring_pkt_type_get( \
  6727. word, mode, type) \
  6728. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6729. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6730. /* Definition to filter in TLVs */
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6795. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6796. do { \
  6797. HTT_CHECK_SET_VAL(httsym, enable); \
  6798. (word) |= (enable) << httsym##_S; \
  6799. } while (0)
  6800. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6801. (((word) & httsym##_M) >> httsym##_S)
  6802. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6803. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6804. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6805. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6806. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6807. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6872. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6873. do { \
  6874. HTT_CHECK_SET_VAL(httsym, enable); \
  6875. (word) |= (enable) << httsym##_S; \
  6876. } while (0)
  6877. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6878. (((word) & httsym##_M) >> httsym##_S)
  6879. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6880. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6881. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6882. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6883. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6884. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6949. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6950. do { \
  6951. HTT_CHECK_SET_VAL(httsym, enable); \
  6952. (word) |= (enable) << httsym##_S; \
  6953. } while (0)
  6954. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6955. (((word) & httsym##_M) >> httsym##_S)
  6956. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6957. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6958. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6959. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6960. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6961. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7006. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7007. do { \
  7008. HTT_CHECK_SET_VAL(httsym, enable); \
  7009. (word) |= (enable) << httsym##_S; \
  7010. } while (0)
  7011. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7012. (((word) & httsym##_M) >> httsym##_S)
  7013. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7014. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7015. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7016. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7017. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7018. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7019. /**
  7020. * @brief host --> target Receive Flow Steering configuration message definition
  7021. *
  7022. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7023. *
  7024. * host --> target Receive Flow Steering configuration message definition.
  7025. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7026. * The reason for this is we want RFS to be configured and ready before MAC
  7027. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7028. *
  7029. * |31 24|23 16|15 9|8|7 0|
  7030. * |----------------+----------------+----------------+----------------|
  7031. * | reserved |E| msg type |
  7032. * |-------------------------------------------------------------------|
  7033. * Where E = RFS enable flag
  7034. *
  7035. * The RFS_CONFIG message consists of a single 4-byte word.
  7036. *
  7037. * Header fields:
  7038. * - MSG_TYPE
  7039. * Bits 7:0
  7040. * Purpose: identifies this as a RFS config msg
  7041. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7042. * - RFS_CONFIG
  7043. * Bit 8
  7044. * Purpose: Tells target whether to enable (1) or disable (0)
  7045. * flow steering feature when sending rx indication messages to host
  7046. */
  7047. #define HTT_H2T_RFS_CONFIG_M 0x100
  7048. #define HTT_H2T_RFS_CONFIG_S 8
  7049. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7050. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7051. HTT_H2T_RFS_CONFIG_S)
  7052. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7053. do { \
  7054. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7055. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7056. } while (0)
  7057. #define HTT_RFS_CFG_REQ_BYTES 4
  7058. /**
  7059. * @brief host -> target FW extended statistics request
  7060. *
  7061. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7062. *
  7063. * @details
  7064. * The following field definitions describe the format of the HTT host
  7065. * to target FW extended stats retrieve message.
  7066. * The message specifies the type of stats the host wants to retrieve.
  7067. *
  7068. * |31 24|23 16|15 8|7 0|
  7069. * |-----------------------------------------------------------|
  7070. * | reserved | stats type | pdev_mask | msg type |
  7071. * |-----------------------------------------------------------|
  7072. * | config param [0] |
  7073. * |-----------------------------------------------------------|
  7074. * | config param [1] |
  7075. * |-----------------------------------------------------------|
  7076. * | config param [2] |
  7077. * |-----------------------------------------------------------|
  7078. * | config param [3] |
  7079. * |-----------------------------------------------------------|
  7080. * | reserved |
  7081. * |-----------------------------------------------------------|
  7082. * | cookie LSBs |
  7083. * |-----------------------------------------------------------|
  7084. * | cookie MSBs |
  7085. * |-----------------------------------------------------------|
  7086. * Header fields:
  7087. * - MSG_TYPE
  7088. * Bits 7:0
  7089. * Purpose: identifies this is a extended stats upload request message
  7090. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7091. * - PDEV_MASK
  7092. * Bits 8:15
  7093. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7094. * Value: This is a overloaded field, refer to usage and interpretation of
  7095. * PDEV in interface document.
  7096. * Bit 8 : Reserved for SOC stats
  7097. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7098. * Indicates MACID_MASK in DBS
  7099. * - STATS_TYPE
  7100. * Bits 23:16
  7101. * Purpose: identifies which FW statistics to upload
  7102. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7103. * - Reserved
  7104. * Bits 31:24
  7105. * - CONFIG_PARAM [0]
  7106. * Bits 31:0
  7107. * Purpose: give an opaque configuration value to the specified stats type
  7108. * Value: stats-type specific configuration value
  7109. * Refer to htt_stats.h for interpretation for each stats sub_type
  7110. * - CONFIG_PARAM [1]
  7111. * Bits 31:0
  7112. * Purpose: give an opaque configuration value to the specified stats type
  7113. * Value: stats-type specific configuration value
  7114. * Refer to htt_stats.h for interpretation for each stats sub_type
  7115. * - CONFIG_PARAM [2]
  7116. * Bits 31:0
  7117. * Purpose: give an opaque configuration value to the specified stats type
  7118. * Value: stats-type specific configuration value
  7119. * Refer to htt_stats.h for interpretation for each stats sub_type
  7120. * - CONFIG_PARAM [3]
  7121. * Bits 31:0
  7122. * Purpose: give an opaque configuration value to the specified stats type
  7123. * Value: stats-type specific configuration value
  7124. * Refer to htt_stats.h for interpretation for each stats sub_type
  7125. * - Reserved [31:0] for future use.
  7126. * - COOKIE_LSBS
  7127. * Bits 31:0
  7128. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7129. * message with its preceding host->target stats request message.
  7130. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7131. * - COOKIE_MSBS
  7132. * Bits 31:0
  7133. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7134. * message with its preceding host->target stats request message.
  7135. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7136. */
  7137. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7138. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7139. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7140. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7141. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7142. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7143. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7144. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7145. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7146. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7147. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7148. do { \
  7149. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7150. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7151. } while (0)
  7152. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7153. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7154. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7155. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7156. do { \
  7157. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7158. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7159. } while (0)
  7160. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7161. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7162. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7163. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7164. do { \
  7165. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7166. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7167. } while (0)
  7168. /**
  7169. * @brief host -> target FW streaming statistics request
  7170. *
  7171. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7172. *
  7173. * @details
  7174. * The following field definitions describe the format of the HTT host
  7175. * to target message that requests the target to start or stop producing
  7176. * ongoing stats of the specified type.
  7177. *
  7178. * |31|30 |23 16|15 8|7 0|
  7179. * |-----------------------------------------------------------|
  7180. * |EN| reserved | stats type | reserved | msg type |
  7181. * |-----------------------------------------------------------|
  7182. * | config param [0] |
  7183. * |-----------------------------------------------------------|
  7184. * | config param [1] |
  7185. * |-----------------------------------------------------------|
  7186. * | config param [2] |
  7187. * |-----------------------------------------------------------|
  7188. * | config param [3] |
  7189. * |-----------------------------------------------------------|
  7190. * Where:
  7191. * - EN is an enable/disable flag
  7192. * Header fields:
  7193. * - MSG_TYPE
  7194. * Bits 7:0
  7195. * Purpose: identifies this is a streaming stats upload request message
  7196. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7197. * - STATS_TYPE
  7198. * Bits 23:16
  7199. * Purpose: identifies which FW statistics to upload
  7200. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7201. * Only the htt_dbg_ext_stats_type values identified as streaming
  7202. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7203. * - ENABLE
  7204. * Bit 31
  7205. * Purpose: enable/disable the target's ongoing stats of the specified type
  7206. * Value:
  7207. * 0 - disable ongoing production of the specified stats type
  7208. * 1 - enable ongoing production of the specified stats type
  7209. * - CONFIG_PARAM [0]
  7210. * Bits 31:0
  7211. * Purpose: give an opaque configuration value to the specified stats type
  7212. * Value: stats-type specific configuration value
  7213. * Refer to htt_stats.h for interpretation for each stats sub_type
  7214. * - CONFIG_PARAM [1]
  7215. * Bits 31:0
  7216. * Purpose: give an opaque configuration value to the specified stats type
  7217. * Value: stats-type specific configuration value
  7218. * Refer to htt_stats.h for interpretation for each stats sub_type
  7219. * - CONFIG_PARAM [2]
  7220. * Bits 31:0
  7221. * Purpose: give an opaque configuration value to the specified stats type
  7222. * Value: stats-type specific configuration value
  7223. * Refer to htt_stats.h for interpretation for each stats sub_type
  7224. * - CONFIG_PARAM [3]
  7225. * Bits 31:0
  7226. * Purpose: give an opaque configuration value to the specified stats type
  7227. * Value: stats-type specific configuration value
  7228. * Refer to htt_stats.h for interpretation for each stats sub_type
  7229. */
  7230. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7231. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7232. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7233. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7234. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7235. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7236. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7237. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7238. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7239. do { \
  7240. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7241. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7242. } while (0)
  7243. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7244. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7245. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7246. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7247. do { \
  7248. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7249. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7250. } while (0)
  7251. /**
  7252. * @brief host -> target FW PPDU_STATS request message
  7253. *
  7254. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7255. *
  7256. * @details
  7257. * The following field definitions describe the format of the HTT host
  7258. * to target FW for PPDU_STATS_CFG msg.
  7259. * The message allows the host to configure the PPDU_STATS_IND messages
  7260. * produced by the target.
  7261. *
  7262. * |31 24|23 16|15 8|7 0|
  7263. * |-----------------------------------------------------------|
  7264. * | REQ bit mask | pdev_mask | msg type |
  7265. * |-----------------------------------------------------------|
  7266. * Header fields:
  7267. * - MSG_TYPE
  7268. * Bits 7:0
  7269. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7270. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7271. * - PDEV_MASK
  7272. * Bits 8:15
  7273. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7274. * Value: This is a overloaded field, refer to usage and interpretation of
  7275. * PDEV in interface document.
  7276. * Bit 8 : Reserved for SOC stats
  7277. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7278. * Indicates MACID_MASK in DBS
  7279. * - REQ_TLV_BIT_MASK
  7280. * Bits 16:31
  7281. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7282. * needs to be included in the target's PPDU_STATS_IND messages.
  7283. * Value: refer htt_ppdu_stats_tlv_tag_t
  7284. *
  7285. */
  7286. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7287. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7288. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7289. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7290. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7291. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7292. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7293. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7294. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7295. do { \
  7296. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7297. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7298. } while (0)
  7299. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7300. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7301. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7302. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7303. do { \
  7304. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7305. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7306. } while (0)
  7307. /**
  7308. * @brief Host-->target HTT RX FSE setup message
  7309. *
  7310. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7311. *
  7312. * @details
  7313. * Through this message, the host will provide details of the flow tables
  7314. * in host DDR along with hash keys.
  7315. * This message can be sent per SOC or per PDEV, which is differentiated
  7316. * by pdev id values.
  7317. * The host will allocate flow search table and sends table size,
  7318. * physical DMA address of flow table, and hash keys to firmware to
  7319. * program into the RXOLE FSE HW block.
  7320. *
  7321. * The following field definitions describe the format of the RX FSE setup
  7322. * message sent from the host to target
  7323. *
  7324. * Header fields:
  7325. * dword0 - b'7:0 - msg_type: This will be set to
  7326. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7327. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7328. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7329. * pdev's LMAC ring.
  7330. * b'31:16 - reserved : Reserved for future use
  7331. * dword1 - b'19:0 - number of records: This field indicates the number of
  7332. * entries in the flow table. For example: 8k number of
  7333. * records is equivalent to
  7334. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7335. * b'27:20 - max search: This field specifies the skid length to FSE
  7336. * parser HW module whenever match is not found at the
  7337. * exact index pointed by hash.
  7338. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7339. * Refer htt_ip_da_sa_prefix below for more details.
  7340. * b'31:30 - reserved: Reserved for future use
  7341. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7342. * table allocated by host in DDR
  7343. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7344. * table allocated by host in DDR
  7345. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7346. * entry hashing
  7347. *
  7348. *
  7349. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7350. * |---------------------------------------------------------------|
  7351. * | reserved | pdev_id | MSG_TYPE |
  7352. * |---------------------------------------------------------------|
  7353. * |resvd|IPDSA| max_search | Number of records |
  7354. * |---------------------------------------------------------------|
  7355. * | base address lo |
  7356. * |---------------------------------------------------------------|
  7357. * | base address high |
  7358. * |---------------------------------------------------------------|
  7359. * | toeplitz key 31_0 |
  7360. * |---------------------------------------------------------------|
  7361. * | toeplitz key 63_32 |
  7362. * |---------------------------------------------------------------|
  7363. * | toeplitz key 95_64 |
  7364. * |---------------------------------------------------------------|
  7365. * | toeplitz key 127_96 |
  7366. * |---------------------------------------------------------------|
  7367. * | toeplitz key 159_128 |
  7368. * |---------------------------------------------------------------|
  7369. * | toeplitz key 191_160 |
  7370. * |---------------------------------------------------------------|
  7371. * | toeplitz key 223_192 |
  7372. * |---------------------------------------------------------------|
  7373. * | toeplitz key 255_224 |
  7374. * |---------------------------------------------------------------|
  7375. * | toeplitz key 287_256 |
  7376. * |---------------------------------------------------------------|
  7377. * | reserved | toeplitz key 314_288(26:0 bits) |
  7378. * |---------------------------------------------------------------|
  7379. * where:
  7380. * IPDSA = ip_da_sa
  7381. */
  7382. /**
  7383. * @brief: htt_ip_da_sa_prefix
  7384. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7385. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7386. * documentation per RFC3849
  7387. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7388. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7389. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7390. */
  7391. enum htt_ip_da_sa_prefix {
  7392. HTT_RX_IPV6_20010db8,
  7393. HTT_RX_IPV4_MAPPED_IPV6,
  7394. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7395. HTT_RX_IPV6_64FF9B,
  7396. };
  7397. /**
  7398. * @brief Host-->target HTT RX FISA configure and enable
  7399. *
  7400. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7401. *
  7402. * @details
  7403. * The host will send this command down to configure and enable the FISA
  7404. * operational params.
  7405. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7406. * register.
  7407. * Should configure both the MACs.
  7408. *
  7409. * dword0 - b'7:0 - msg_type:
  7410. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7411. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7412. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7413. * pdev's LMAC ring.
  7414. * b'31:16 - reserved : Reserved for future use
  7415. *
  7416. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7417. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7418. * packets. 1 flow search will be skipped
  7419. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7420. * tcp,udp packets
  7421. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7422. * calculation
  7423. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7424. * calculation
  7425. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7426. * calculation
  7427. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7428. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7429. * length
  7430. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7431. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7432. * length
  7433. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7434. * num jump
  7435. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7436. * num jump
  7437. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7438. * data type switch has happend for MPDU Sequence num jump
  7439. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7440. * for MPDU Sequence num jump
  7441. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7442. * for decrypt errors
  7443. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7444. * while aggregating a msdu
  7445. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7446. * The aggregation is done until (number of MSDUs aggregated
  7447. * < LIMIT + 1)
  7448. * b'31:18 - Reserved
  7449. *
  7450. * fisa_control_value - 32bit value FW can write to register
  7451. *
  7452. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7453. * Threshold value for FISA timeout (units are microseconds).
  7454. * When the global timestamp exceeds this threshold, FISA
  7455. * aggregation will be restarted.
  7456. * A value of 0 means timeout is disabled.
  7457. * Compare the threshold register with timestamp field in
  7458. * flow entry to generate timeout for the flow.
  7459. *
  7460. * |31 18 |17 16|15 8|7 0|
  7461. * |-------------------------------------------------------------|
  7462. * | reserved | pdev_mask | msg type |
  7463. * |-------------------------------------------------------------|
  7464. * | reserved | FISA_CTRL |
  7465. * |-------------------------------------------------------------|
  7466. * | FISA_TIMEOUT_THRESH |
  7467. * |-------------------------------------------------------------|
  7468. */
  7469. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7470. A_UINT32 msg_type:8,
  7471. pdev_id:8,
  7472. reserved0:16;
  7473. /**
  7474. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7475. * [17:0]
  7476. */
  7477. union {
  7478. /*
  7479. * fisa_control_bits structure is deprecated.
  7480. * Please use fisa_control_bits_v2 going forward.
  7481. */
  7482. struct {
  7483. A_UINT32 fisa_enable: 1,
  7484. ipsec_skip_search: 1,
  7485. nontcp_skip_search: 1,
  7486. add_ipv4_fixed_hdr_len: 1,
  7487. add_ipv6_fixed_hdr_len: 1,
  7488. add_tcp_fixed_hdr_len: 1,
  7489. add_udp_hdr_len: 1,
  7490. chksum_cum_ip_len_en: 1,
  7491. disable_tid_check: 1,
  7492. disable_ta_check: 1,
  7493. disable_qos_check: 1,
  7494. disable_raw_check: 1,
  7495. disable_decrypt_err_check: 1,
  7496. disable_msdu_drop_check: 1,
  7497. fisa_aggr_limit: 4,
  7498. reserved: 14;
  7499. } fisa_control_bits;
  7500. struct {
  7501. A_UINT32 fisa_enable: 1,
  7502. fisa_aggr_limit: 4,
  7503. reserved: 27;
  7504. } fisa_control_bits_v2;
  7505. A_UINT32 fisa_control_value;
  7506. } u_fisa_control;
  7507. /**
  7508. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7509. * timeout threshold for aggregation. Unit in usec.
  7510. * [31:0]
  7511. */
  7512. A_UINT32 fisa_timeout_threshold;
  7513. } POSTPACK;
  7514. /* DWord 0: pdev-ID */
  7515. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7516. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7517. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7518. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7519. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7520. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7521. do { \
  7522. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7523. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7524. } while (0)
  7525. /* Dword 1: fisa_control_value fisa config */
  7526. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7527. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7528. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7529. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7530. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7531. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7532. do { \
  7533. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7534. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7535. } while (0)
  7536. /* Dword 1: fisa_control_value ipsec_skip_search */
  7537. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7538. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7539. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7540. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7541. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7542. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7543. do { \
  7544. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7545. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7546. } while (0)
  7547. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7548. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7549. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7550. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7551. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7552. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7553. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7554. do { \
  7555. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7556. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7557. } while (0)
  7558. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7559. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7560. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7561. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7562. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7563. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7564. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7565. do { \
  7566. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7567. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7568. } while (0)
  7569. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7570. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7571. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7572. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7573. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7574. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7575. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7576. do { \
  7577. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7578. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7579. } while (0)
  7580. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7581. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7582. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7583. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7584. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7585. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7586. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7587. do { \
  7588. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7589. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7590. } while (0)
  7591. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7592. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7593. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7594. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7595. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7596. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7597. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7598. do { \
  7599. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7600. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7601. } while (0)
  7602. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7603. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7604. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7605. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7606. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7607. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7608. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7609. do { \
  7610. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7611. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7612. } while (0)
  7613. /* Dword 1: fisa_control_value disable_tid_check */
  7614. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7615. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7616. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7617. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7618. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7619. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7620. do { \
  7621. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7622. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7623. } while (0)
  7624. /* Dword 1: fisa_control_value disable_ta_check */
  7625. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7626. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7627. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7628. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7629. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7630. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7631. do { \
  7632. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7633. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7634. } while (0)
  7635. /* Dword 1: fisa_control_value disable_qos_check */
  7636. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7637. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7638. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7639. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7640. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7641. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7644. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7645. } while (0)
  7646. /* Dword 1: fisa_control_value disable_raw_check */
  7647. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7648. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7649. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7650. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7651. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7652. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7653. do { \
  7654. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7655. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7656. } while (0)
  7657. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7658. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7659. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7660. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7661. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7662. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7663. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7664. do { \
  7665. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7666. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7667. } while (0)
  7668. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7669. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7670. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7671. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7672. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7673. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7674. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7675. do { \
  7676. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7677. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7678. } while (0)
  7679. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7680. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7681. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7682. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7683. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7684. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7685. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7686. do { \
  7687. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7688. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7689. } while (0)
  7690. /* Dword 1: fisa_control_value fisa config */
  7691. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7692. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7693. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7694. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7695. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7696. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7697. do { \
  7698. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7699. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7700. } while (0)
  7701. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7702. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7703. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7704. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7705. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7706. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7707. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7708. do { \
  7709. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7710. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7711. } while (0)
  7712. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7713. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7714. pdev_id:8,
  7715. reserved0:16;
  7716. A_UINT32 num_records:20,
  7717. max_search:8,
  7718. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7719. reserved1:2;
  7720. A_UINT32 base_addr_lo;
  7721. A_UINT32 base_addr_hi;
  7722. A_UINT32 toeplitz31_0;
  7723. A_UINT32 toeplitz63_32;
  7724. A_UINT32 toeplitz95_64;
  7725. A_UINT32 toeplitz127_96;
  7726. A_UINT32 toeplitz159_128;
  7727. A_UINT32 toeplitz191_160;
  7728. A_UINT32 toeplitz223_192;
  7729. A_UINT32 toeplitz255_224;
  7730. A_UINT32 toeplitz287_256;
  7731. A_UINT32 toeplitz314_288:27,
  7732. reserved2:5;
  7733. } POSTPACK;
  7734. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7735. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7736. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7737. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7738. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7739. /* DWORD 0: Pdev ID */
  7740. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7741. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7742. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7743. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7744. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7745. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7746. do { \
  7747. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7748. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7749. } while (0)
  7750. /* DWORD 1:num of records */
  7751. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7752. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7753. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7754. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7755. HTT_RX_FSE_SETUP_NUM_REC_S)
  7756. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7757. do { \
  7758. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7759. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7760. } while (0)
  7761. /* DWORD 1:max_search */
  7762. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7763. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7764. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7765. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7766. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7767. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7770. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7771. } while (0)
  7772. /* DWORD 1:ip_da_sa prefix */
  7773. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7774. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7775. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7776. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7777. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7778. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7779. do { \
  7780. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7781. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7782. } while (0)
  7783. /* DWORD 2: Base Address LO */
  7784. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7785. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7786. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7787. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7788. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7789. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7790. do { \
  7791. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7792. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7793. } while (0)
  7794. /* DWORD 3: Base Address High */
  7795. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7796. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7797. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7798. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7799. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7800. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7801. do { \
  7802. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7803. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7804. } while (0)
  7805. /* DWORD 4-12: Hash Value */
  7806. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7807. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7808. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7809. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7810. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7811. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7812. do { \
  7813. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7814. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7815. } while (0)
  7816. /* DWORD 13: Hash Value 314:288 bits */
  7817. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7818. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7819. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7820. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7821. do { \
  7822. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7823. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7824. } while (0)
  7825. /**
  7826. * @brief Host-->target HTT RX FSE operation message
  7827. *
  7828. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7829. *
  7830. * @details
  7831. * The host will send this Flow Search Engine (FSE) operation message for
  7832. * every flow add/delete operation.
  7833. * The FSE operation includes FSE full cache invalidation or individual entry
  7834. * invalidation.
  7835. * This message can be sent per SOC or per PDEV which is differentiated
  7836. * by pdev id values.
  7837. *
  7838. * |31 16|15 8|7 1|0|
  7839. * |-------------------------------------------------------------|
  7840. * | reserved | pdev_id | MSG_TYPE |
  7841. * |-------------------------------------------------------------|
  7842. * | reserved | operation |I|
  7843. * |-------------------------------------------------------------|
  7844. * | ip_src_addr_31_0 |
  7845. * |-------------------------------------------------------------|
  7846. * | ip_src_addr_63_32 |
  7847. * |-------------------------------------------------------------|
  7848. * | ip_src_addr_95_64 |
  7849. * |-------------------------------------------------------------|
  7850. * | ip_src_addr_127_96 |
  7851. * |-------------------------------------------------------------|
  7852. * | ip_dst_addr_31_0 |
  7853. * |-------------------------------------------------------------|
  7854. * | ip_dst_addr_63_32 |
  7855. * |-------------------------------------------------------------|
  7856. * | ip_dst_addr_95_64 |
  7857. * |-------------------------------------------------------------|
  7858. * | ip_dst_addr_127_96 |
  7859. * |-------------------------------------------------------------|
  7860. * | l4_dst_port | l4_src_port |
  7861. * | (32-bit SPI incase of IPsec) |
  7862. * |-------------------------------------------------------------|
  7863. * | reserved | l4_proto |
  7864. * |-------------------------------------------------------------|
  7865. *
  7866. * where I is 1-bit ipsec_valid.
  7867. *
  7868. * The following field definitions describe the format of the RX FSE operation
  7869. * message sent from the host to target for every add/delete flow entry to flow
  7870. * table.
  7871. *
  7872. * Header fields:
  7873. * dword0 - b'7:0 - msg_type: This will be set to
  7874. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7875. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7876. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7877. * specified pdev's LMAC ring.
  7878. * b'31:16 - reserved : Reserved for future use
  7879. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7880. * (Internet Protocol Security).
  7881. * IPsec describes the framework for providing security at
  7882. * IP layer. IPsec is defined for both versions of IP:
  7883. * IPV4 and IPV6.
  7884. * Please refer to htt_rx_flow_proto enumeration below for
  7885. * more info.
  7886. * ipsec_valid = 1 for IPSEC packets
  7887. * ipsec_valid = 0 for IP Packets
  7888. * b'7:1 - operation: This indicates types of FSE operation.
  7889. * Refer to htt_rx_fse_operation enumeration:
  7890. * 0 - No Cache Invalidation required
  7891. * 1 - Cache invalidate only one entry given by IP
  7892. * src/dest address at DWORD[2:9]
  7893. * 2 - Complete FSE Cache Invalidation
  7894. * 3 - FSE Disable
  7895. * 4 - FSE Enable
  7896. * b'31:8 - reserved: Reserved for future use
  7897. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7898. * for per flow addition/deletion
  7899. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7900. * and the subsequent 3 A_UINT32 will be padding bytes.
  7901. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7902. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7903. * from 0 to 65535 but only 0 to 1023 are designated as
  7904. * well-known ports. Refer to [RFC1700] for more details.
  7905. * This field is valid only if
  7906. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7907. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7908. * range from 0 to 65535 but only 0 to 1023 are designated
  7909. * as well-known ports. Refer to [RFC1700] for more details.
  7910. * This field is valid only if
  7911. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7912. * - SPI (31:0): Security Parameters Index is an
  7913. * identification tag added to the header while using IPsec
  7914. * for tunneling the IP traffici.
  7915. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7916. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7917. * Assigned Internet Protocol Numbers.
  7918. * l4_proto numbers for standard protocol like UDP/TCP
  7919. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7920. * l4_proto = 17 for UDP etc.
  7921. * b'31:8 - reserved: Reserved for future use.
  7922. *
  7923. */
  7924. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7925. A_UINT32 msg_type:8,
  7926. pdev_id:8,
  7927. reserved0:16;
  7928. A_UINT32 ipsec_valid:1,
  7929. operation:7,
  7930. reserved1:24;
  7931. A_UINT32 ip_src_addr_31_0;
  7932. A_UINT32 ip_src_addr_63_32;
  7933. A_UINT32 ip_src_addr_95_64;
  7934. A_UINT32 ip_src_addr_127_96;
  7935. A_UINT32 ip_dest_addr_31_0;
  7936. A_UINT32 ip_dest_addr_63_32;
  7937. A_UINT32 ip_dest_addr_95_64;
  7938. A_UINT32 ip_dest_addr_127_96;
  7939. union {
  7940. A_UINT32 spi;
  7941. struct {
  7942. A_UINT32 l4_src_port:16,
  7943. l4_dest_port:16;
  7944. } ip;
  7945. } u;
  7946. A_UINT32 l4_proto:8,
  7947. reserved:24;
  7948. } POSTPACK;
  7949. /**
  7950. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7951. *
  7952. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7953. *
  7954. * @details
  7955. * The host will send this Full monitor mode register configuration message.
  7956. * This message can be sent per SOC or per PDEV which is differentiated
  7957. * by pdev id values.
  7958. *
  7959. * |31 16|15 11|10 8|7 3|2|1|0|
  7960. * |-------------------------------------------------------------|
  7961. * | reserved | pdev_id | MSG_TYPE |
  7962. * |-------------------------------------------------------------|
  7963. * | reserved |Release Ring |N|Z|E|
  7964. * |-------------------------------------------------------------|
  7965. *
  7966. * where E is 1-bit full monitor mode enable/disable.
  7967. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7968. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7969. *
  7970. * The following field definitions describe the format of the full monitor
  7971. * mode configuration message sent from the host to target for each pdev.
  7972. *
  7973. * Header fields:
  7974. * dword0 - b'7:0 - msg_type: This will be set to
  7975. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7976. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7977. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7978. * specified pdev's LMAC ring.
  7979. * b'31:16 - reserved : Reserved for future use.
  7980. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7981. * monitor mode rxdma register is to be enabled or disabled.
  7982. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7983. * additional descriptors at ppdu end for zero mpdus
  7984. * enabled or disabled.
  7985. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7986. * additional descriptors at ppdu end for non zero mpdus
  7987. * enabled or disabled.
  7988. * b'10:3 - release_ring: This indicates the destination ring
  7989. * selection for the descriptor at the end of PPDU
  7990. * 0 - REO ring select
  7991. * 1 - FW ring select
  7992. * 2 - SW ring select
  7993. * 3 - Release ring select
  7994. * Refer to htt_rx_full_mon_release_ring.
  7995. * b'31:11 - reserved for future use
  7996. */
  7997. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7998. A_UINT32 msg_type:8,
  7999. pdev_id:8,
  8000. reserved0:16;
  8001. A_UINT32 full_monitor_mode_enable:1,
  8002. addnl_descs_zero_mpdus_end:1,
  8003. addnl_descs_non_zero_mpdus_end:1,
  8004. release_ring:8,
  8005. reserved1:21;
  8006. } POSTPACK;
  8007. /**
  8008. * Enumeration for full monitor mode destination ring select
  8009. * 0 - REO destination ring select
  8010. * 1 - FW destination ring select
  8011. * 2 - SW destination ring select
  8012. * 3 - Release destination ring select
  8013. */
  8014. enum htt_rx_full_mon_release_ring {
  8015. HTT_RX_MON_RING_REO,
  8016. HTT_RX_MON_RING_FW,
  8017. HTT_RX_MON_RING_SW,
  8018. HTT_RX_MON_RING_RELEASE,
  8019. };
  8020. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8021. /* DWORD 0: Pdev ID */
  8022. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8023. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8024. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8025. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8026. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8027. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8028. do { \
  8029. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8030. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8031. } while (0)
  8032. /* DWORD 1:ENABLE */
  8033. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8034. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8035. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8036. do { \
  8037. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8038. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8039. } while (0)
  8040. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8041. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8042. /* DWORD 1:ZERO_MPDU */
  8043. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8044. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8045. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8046. do { \
  8047. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8048. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8049. } while (0)
  8050. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8051. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8052. /* DWORD 1:NON_ZERO_MPDU */
  8053. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8054. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8055. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8056. do { \
  8057. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8058. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8059. } while (0)
  8060. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8061. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8062. /* DWORD 1:RELEASE_RINGS */
  8063. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8064. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8065. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8066. do { \
  8067. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8068. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8069. } while (0)
  8070. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8071. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8072. /**
  8073. * Enumeration for IP Protocol or IPSEC Protocol
  8074. * IPsec describes the framework for providing security at IP layer.
  8075. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8076. */
  8077. enum htt_rx_flow_proto {
  8078. HTT_RX_FLOW_IP_PROTO,
  8079. HTT_RX_FLOW_IPSEC_PROTO,
  8080. };
  8081. /**
  8082. * Enumeration for FSE Cache Invalidation
  8083. * 0 - No Cache Invalidation required
  8084. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8085. * 2 - Complete FSE Cache Invalidation
  8086. * 3 - FSE Disable
  8087. * 4 - FSE Enable
  8088. */
  8089. enum htt_rx_fse_operation {
  8090. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8091. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8092. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8093. HTT_RX_FSE_DISABLE,
  8094. HTT_RX_FSE_ENABLE,
  8095. };
  8096. /* DWORD 0: Pdev ID */
  8097. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8098. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8099. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8100. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8101. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8102. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8103. do { \
  8104. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8105. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8106. } while (0)
  8107. /* DWORD 1:IP PROTO or IPSEC */
  8108. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8109. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8110. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8111. do { \
  8112. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8113. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8114. } while (0)
  8115. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8116. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8117. /* DWORD 1:FSE Operation */
  8118. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8119. #define HTT_RX_FSE_OPERATION_S 1
  8120. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8121. do { \
  8122. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8123. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8124. } while (0)
  8125. #define HTT_RX_FSE_OPERATION_GET(word) \
  8126. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8127. /* DWORD 2-9:IP Address */
  8128. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8129. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8130. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8131. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8132. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8133. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8134. do { \
  8135. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8136. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8137. } while (0)
  8138. /* DWORD 10:Source Port Number */
  8139. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8140. #define HTT_RX_FSE_SOURCEPORT_S 0
  8141. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8142. do { \
  8143. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8144. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8145. } while (0)
  8146. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8147. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8148. /* DWORD 11:Destination Port Number */
  8149. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8150. #define HTT_RX_FSE_DESTPORT_S 16
  8151. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8152. do { \
  8153. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8154. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8155. } while (0)
  8156. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8157. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8158. /* DWORD 10-11:SPI (In case of IPSEC) */
  8159. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8160. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8161. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8162. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8163. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8164. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8165. do { \
  8166. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8167. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8168. } while (0)
  8169. /* DWORD 12:L4 PROTO */
  8170. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8171. #define HTT_RX_FSE_L4_PROTO_S 0
  8172. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8173. do { \
  8174. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8175. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8176. } while (0)
  8177. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8178. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8179. /**
  8180. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8181. *
  8182. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8183. *
  8184. * |31 24|23 |15 8|7 2|1|0|
  8185. * |----------------+----------------+----------------+----------------|
  8186. * | reserved | pdev_id | msg_type |
  8187. * |---------------------------------+----------------+----------------|
  8188. * | reserved |E|F|
  8189. * |---------------------------------+----------------+----------------|
  8190. * Where E = Configure the target to provide the 3-tuple hash value in
  8191. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8192. * F = Configure the target to provide the 3-tuple hash value in
  8193. * flow_id_toeplitz field of rx_msdu_start tlv
  8194. *
  8195. * The following field definitions describe the format of the 3 tuple hash value
  8196. * message sent from the host to target as part of initialization sequence.
  8197. *
  8198. * Header fields:
  8199. * dword0 - b'7:0 - msg_type: This will be set to
  8200. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8201. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8202. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8203. * specified pdev's LMAC ring.
  8204. * b'31:16 - reserved : Reserved for future use
  8205. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8206. * b'1 - toeplitz_hash_2_or_4_field_enable
  8207. * b'31:2 - reserved : Reserved for future use
  8208. * ---------+------+----------------------------------------------------------
  8209. * bit1 | bit0 | Functionality
  8210. * ---------+------+----------------------------------------------------------
  8211. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8212. * | | in flow_id_toeplitz field
  8213. * ---------+------+----------------------------------------------------------
  8214. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8215. * | | in toeplitz_hash_2_or_4 field
  8216. * ---------+------+----------------------------------------------------------
  8217. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8218. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8219. * ---------+------+----------------------------------------------------------
  8220. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8221. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8222. * | | toeplitz_hash_2_or_4 field
  8223. *----------------------------------------------------------------------------
  8224. */
  8225. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8226. A_UINT32 msg_type :8,
  8227. pdev_id :8,
  8228. reserved0 :16;
  8229. A_UINT32 flow_id_toeplitz_field_enable :1,
  8230. toeplitz_hash_2_or_4_field_enable :1,
  8231. reserved1 :30;
  8232. } POSTPACK;
  8233. /* DWORD0 : pdev_id configuration Macros */
  8234. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8235. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8236. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8237. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8238. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8239. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8240. do { \
  8241. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8242. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8243. } while (0)
  8244. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8245. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8246. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8247. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8248. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8249. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8250. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8251. do { \
  8252. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8253. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8254. } while (0)
  8255. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8256. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8257. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8258. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8259. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8260. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8261. do { \
  8262. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8263. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8264. } while (0)
  8265. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8266. /**
  8267. * @brief host --> target Host PA Address Size
  8268. *
  8269. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8270. *
  8271. * @details
  8272. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8273. * provide the physical start address and size of each of the memory
  8274. * areas within host DDR that the target FW may need to access.
  8275. *
  8276. * For example, the host can use this message to allow the target FW
  8277. * to set up access to the host's pools of TQM link descriptors.
  8278. * The message would appear as follows:
  8279. *
  8280. * |31 24|23 16|15 8|7 0|
  8281. * |----------------+----------------+----------------+----------------|
  8282. * | reserved | num_entries | msg_type |
  8283. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8284. * | mem area 0 size |
  8285. * |----------------+----------------+----------------+----------------|
  8286. * | mem area 0 physical_address_lo |
  8287. * |----------------+----------------+----------------+----------------|
  8288. * | mem area 0 physical_address_hi |
  8289. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8290. * | mem area 1 size |
  8291. * |----------------+----------------+----------------+----------------|
  8292. * | mem area 1 physical_address_lo |
  8293. * |----------------+----------------+----------------+----------------|
  8294. * | mem area 1 physical_address_hi |
  8295. * |----------------+----------------+----------------+----------------|
  8296. * ...
  8297. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8298. * | mem area N size |
  8299. * |----------------+----------------+----------------+----------------|
  8300. * | mem area N physical_address_lo |
  8301. * |----------------+----------------+----------------+----------------|
  8302. * | mem area N physical_address_hi |
  8303. * |----------------+----------------+----------------+----------------|
  8304. *
  8305. * The message is interpreted as follows:
  8306. * dword0 - b'0:7 - msg_type: This will be set to
  8307. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8308. * b'8:15 - number_entries: Indicated the number of host memory
  8309. * areas specified within the remainder of the message
  8310. * b'16:31 - reserved.
  8311. * dword1 - b'0:31 - memory area 0 size in bytes
  8312. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8313. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8314. * and similar for memory area 1 through memory area N.
  8315. */
  8316. PREPACK struct htt_h2t_host_paddr_size {
  8317. A_UINT32 msg_type: 8,
  8318. num_entries: 8,
  8319. reserved: 16;
  8320. } POSTPACK;
  8321. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8322. A_UINT32 size;
  8323. A_UINT32 physical_address_lo;
  8324. A_UINT32 physical_address_hi;
  8325. } POSTPACK;
  8326. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8327. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8328. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8329. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8330. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8331. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8332. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8333. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8334. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8335. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8336. do { \
  8337. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8338. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8339. } while (0)
  8340. /**
  8341. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8342. *
  8343. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8344. *
  8345. * @details
  8346. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8347. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8348. *
  8349. * The message would appear as follows:
  8350. *
  8351. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8352. * |---------------------------------+---+---+----------+-+-----------|
  8353. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8354. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8355. *
  8356. *
  8357. * The message is interpreted as follows:
  8358. * dword0 - b'0:7 - msg_type: This will be set to
  8359. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8360. * b'8 - override bit to drive MSDUs to PPE ring
  8361. * b'9:13 - REO destination ring indication
  8362. * b'14 - Multi buffer msdu override enable bit
  8363. * b'15 - Intra BSS override
  8364. * b'16 - Decap raw override
  8365. * b'17 - Decap Native wifi override
  8366. * b'18 - IP frag override
  8367. * b'19:31 - reserved
  8368. */
  8369. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8370. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8371. override: 1,
  8372. reo_destination_indication: 5,
  8373. multi_buffer_msdu_override_en: 1,
  8374. intra_bss_override: 1,
  8375. decap_raw_override: 1,
  8376. decap_nwifi_override: 1,
  8377. ip_frag_override: 1,
  8378. reserved: 13;
  8379. } POSTPACK;
  8380. /* DWORD 0: Override */
  8381. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8382. #define HTT_PPE_CFG_OVERRIDE_S 8
  8383. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8384. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8385. HTT_PPE_CFG_OVERRIDE_S)
  8386. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8387. do { \
  8388. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8389. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8390. } while (0)
  8391. /* DWORD 0: REO Destination Indication*/
  8392. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8393. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8394. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8395. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8396. HTT_PPE_CFG_REO_DEST_IND_S)
  8397. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8398. do { \
  8399. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8400. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8401. } while (0)
  8402. /* DWORD 0: Multi buffer MSDU override */
  8403. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8404. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8405. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8406. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8407. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8408. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8409. do { \
  8410. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8411. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8412. } while (0)
  8413. /* DWORD 0: Intra BSS override */
  8414. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8415. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8416. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8417. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8418. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8419. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8420. do { \
  8421. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8422. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8423. } while (0)
  8424. /* DWORD 0: Decap RAW override */
  8425. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8426. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8427. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8428. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8429. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8430. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8431. do { \
  8432. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8433. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8434. } while (0)
  8435. /* DWORD 0: Decap NWIFI override */
  8436. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8437. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8438. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8439. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8440. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8441. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8444. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8445. } while (0)
  8446. /* DWORD 0: IP frag override */
  8447. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8448. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8449. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8450. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8451. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8452. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8453. do { \
  8454. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8455. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8456. } while (0)
  8457. /*
  8458. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8459. *
  8460. * @details
  8461. * The following field definitions describe the format of the HTT host
  8462. * to target FW VDEV TX RX stats retrieve message.
  8463. * The message specifies the type of stats the host wants to retrieve.
  8464. *
  8465. * |31 27|26 25|24 17|16|15 8|7 0|
  8466. * |-----------------------------------------------------------|
  8467. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8468. * |-----------------------------------------------------------|
  8469. * | vdev_id lower bitmask |
  8470. * |-----------------------------------------------------------|
  8471. * | vdev_id upper bitmask |
  8472. * |-----------------------------------------------------------|
  8473. * Header fields:
  8474. * Where:
  8475. * dword0 - b'7:0 - msg_type: This will be set to
  8476. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8477. * b'15:8 - pdev id
  8478. * b'16(E) - Enable/Disable the vdev HW stats
  8479. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8480. * b'25:26(R) - Reset stats bits
  8481. * 0: don't reset stats
  8482. * 1: reset stats once
  8483. * 2: reset stats at the start of each periodic interval
  8484. * b'27:31 - reserved for future use
  8485. * dword1 - b'0:31 - vdev_id lower bitmask
  8486. * dword2 - b'0:31 - vdev_id upper bitmask
  8487. */
  8488. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8489. A_UINT32 msg_type :8,
  8490. pdev_id :8,
  8491. enable :1,
  8492. periodic_interval :8,
  8493. reset_stats_bits :2,
  8494. reserved0 :5;
  8495. A_UINT32 vdev_id_lower_bitmask;
  8496. A_UINT32 vdev_id_upper_bitmask;
  8497. } POSTPACK;
  8498. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8499. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8500. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8501. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8502. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8503. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8504. do { \
  8505. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8506. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8507. } while (0)
  8508. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8509. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8510. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8511. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8512. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8513. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8514. do { \
  8515. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8516. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8517. } while (0)
  8518. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8519. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8520. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8521. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8522. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8523. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8526. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8527. } while (0)
  8528. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8529. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8530. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8531. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8532. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8533. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8534. do { \
  8535. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8536. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8537. } while (0)
  8538. /*
  8539. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8540. *
  8541. * @details
  8542. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8543. * the default MSDU queues for one of the TIDs within the specified peer
  8544. * to the specified service class.
  8545. * The TID is indirectly specified - each service class is associated
  8546. * with a TID. All default MSDU queues for this peer-TID will be
  8547. * linked to the service class in question.
  8548. *
  8549. * |31 16|15 8|7 0|
  8550. * |------------------------------+--------------+--------------|
  8551. * | peer ID | svc class ID | msg type |
  8552. * |------------------------------------------------------------|
  8553. * Header fields:
  8554. * dword0 - b'7:0 - msg_type: This will be set to
  8555. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8556. * b'15:8 - service class ID
  8557. * b'31:16 - peer ID
  8558. */
  8559. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8560. A_UINT32 msg_type :8,
  8561. svc_class_id :8,
  8562. peer_id :16;
  8563. } POSTPACK;
  8564. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8565. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8566. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8567. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8568. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8569. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8570. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8571. do { \
  8572. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8573. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8574. } while (0)
  8575. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8576. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8577. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8578. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8579. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8580. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8581. do { \
  8582. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8583. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8584. } while (0)
  8585. /*
  8586. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8587. *
  8588. * @details
  8589. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8590. * remove the linkage of the specified peer-TID's MSDU queues to
  8591. * service classes.
  8592. *
  8593. * |31 16|15 8|7 0|
  8594. * |------------------------------+--------------+--------------|
  8595. * | peer ID | svc class ID | msg type |
  8596. * |------------------------------------------------------------|
  8597. * Header fields:
  8598. * dword0 - b'7:0 - msg_type: This will be set to
  8599. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8600. * b'15:8 - service class ID
  8601. * b'31:16 - peer ID
  8602. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8603. * value for peer ID indicates that the target should
  8604. * apply the UNMAP_REQ to all peers.
  8605. */
  8606. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8607. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8608. A_UINT32 msg_type :8,
  8609. svc_class_id :8,
  8610. peer_id :16;
  8611. } POSTPACK;
  8612. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8613. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8614. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8615. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8616. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8617. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8618. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8621. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8622. } while (0)
  8623. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8624. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8625. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8626. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8627. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8628. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8631. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8632. } while (0)
  8633. /*
  8634. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8635. *
  8636. * @details
  8637. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8638. * request the target to report what service class the default MSDU queues
  8639. * of the specified TIDs within the peer are linked to.
  8640. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8641. * to report what service class (if any) the default MSDU queues for
  8642. * each of the specified TIDs are linked to.
  8643. *
  8644. * |31 16|15 8|7 1| 0|
  8645. * |------------------------------+--------------+--------------|
  8646. * | peer ID | TID mask | msg type |
  8647. * |------------------------------------------------------------|
  8648. * | reserved |ETO|
  8649. * |------------------------------------------------------------|
  8650. * Header fields:
  8651. * dword0 - b'7:0 - msg_type: This will be set to
  8652. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8653. * b'15:8 - TID mask
  8654. * b'31:16 - peer ID
  8655. * dword1 - b'0 - "Existing Tids Only" flag
  8656. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8657. * message generated by this REQ will only show the
  8658. * mapping for TIDs that actually exist in the target's
  8659. * peer object.
  8660. * Any TIDs that are covered by a MAP_REQ but which
  8661. * do not actually exist will be shown as being
  8662. * unmapped (i.e. svc class ID 0xff).
  8663. * If this flag is cleared, the MAP_REPORT_CONF message
  8664. * will consider not only the mapping of TIDs currently
  8665. * existing in the peer, but also the mapping that will
  8666. * be applied for any TID objects created within this
  8667. * peer in the future.
  8668. * b'31:1 - reserved for future use
  8669. */
  8670. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8671. A_UINT32 msg_type :8,
  8672. tid_mask :8,
  8673. peer_id :16;
  8674. A_UINT32 existing_tids_only:1,
  8675. reserved :31;
  8676. } POSTPACK;
  8677. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8678. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8679. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8680. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8681. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8682. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8683. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8684. do { \
  8685. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8686. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8687. } while (0)
  8688. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8689. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8690. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8691. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8692. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8693. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8694. do { \
  8695. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8696. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8697. } while (0)
  8698. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8699. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8700. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8701. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8702. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8703. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8704. do { \
  8705. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8706. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8707. } while (0)
  8708. /**
  8709. * @brief Format of shared memory between Host and Target
  8710. * for UMAC hang recovery feature messaging.
  8711. * @details
  8712. * This is shared memory between Host and Target allocated
  8713. * and used in chips where UMAC hang recovery feature is supported.
  8714. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8715. * then host interprets it as a new message from target.
  8716. * Host clears that particular read bit in t2h_msg after each read
  8717. * operation. It is vice versa for h2t_msg. At any given point
  8718. * of time there is expected to be only one bit set
  8719. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8720. *
  8721. * The message is interpreted as follows:
  8722. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8723. * added for debuggability purpose.
  8724. * dword1 - b'0 - do_pre_reset
  8725. * b'1 - do_post_reset_start
  8726. * b'2 - do_post_reset_complete
  8727. * b'3:31 - rsvd_t2h
  8728. * dword2 - b'0 - pre_reset_done
  8729. * b'1 - post_reset_start_done
  8730. * b'2 - post_reset_complete_done
  8731. * b'3:31 - rsvd_h2t
  8732. */
  8733. PREPACK typedef struct {
  8734. /** Magic number added for debuggability. */
  8735. A_UINT32 magic_num;
  8736. union {
  8737. /*
  8738. * BIT [0] :- T2H msg to do pre-reset
  8739. * BIT [1] :- T2H msg to do post-reset start
  8740. * BIT [2] :- T2H msg to do post-reset complete
  8741. * BIT [31 : 3] :- reserved
  8742. */
  8743. A_UINT32 t2h_msg;
  8744. struct {
  8745. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8746. do_post_reset_start : 1, /* BIT [1] */
  8747. do_post_reset_complete : 1, /* BIT [2] */
  8748. rsvd_t2h : 29; /* BIT [31 : 3] */
  8749. };
  8750. };
  8751. union {
  8752. /*
  8753. * BIT [0] :- H2T msg to send pre-reset done
  8754. * BIT [1] :- H2T msg to send post-reset start done
  8755. * BIT [2] :- H2T msg to send post-reset complete done
  8756. * BIT [31 : 3] :- reserved
  8757. */
  8758. A_UINT32 h2t_msg;
  8759. struct {
  8760. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8761. post_reset_start_done : 1, /* BIT [1] */
  8762. post_reset_complete_done : 1, /* BIT [2] */
  8763. rsvd_h2t : 29; /* BIT [31 : 3] */
  8764. };
  8765. };
  8766. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8767. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8768. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8769. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8770. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8771. /* dword1 - b'0 - do_pre_reset */
  8772. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8773. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8774. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8775. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8776. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8777. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8778. do { \
  8779. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8780. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8781. } while (0)
  8782. /* dword1 - b'1 - do_post_reset_start */
  8783. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8784. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8785. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8786. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8787. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8788. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8789. do { \
  8790. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8791. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8792. } while (0)
  8793. /* dword1 - b'2 - do_post_reset_complete */
  8794. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8795. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8796. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8797. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8798. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8799. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8800. do { \
  8801. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8802. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8803. } while (0)
  8804. /* dword2 - b'0 - pre_reset_done */
  8805. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8806. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8807. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8808. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8809. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8810. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8811. do { \
  8812. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8813. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8814. } while (0)
  8815. /* dword2 - b'1 - post_reset_start_done */
  8816. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8817. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8818. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8819. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8820. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8821. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8822. do { \
  8823. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8824. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8825. } while (0)
  8826. /* dword2 - b'2 - post_reset_complete_done */
  8827. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8828. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8829. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8830. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8831. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8832. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8833. do { \
  8834. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8835. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8836. } while (0)
  8837. /**
  8838. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8839. *
  8840. * @details
  8841. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8842. * by the host to provide prerequisite info to target for the UMAC hang
  8843. * recovery feature.
  8844. * The info sent in this H2T message are T2H message method, H2T message
  8845. * method, T2H MSI interrupt number and physical start address, size of
  8846. * the shared memory (refers to the shared memory dedicated for messaging
  8847. * between host and target when the DUT is in UMAC hang recovery mode).
  8848. * This H2T message is expected to be only sent if the WMI service bit
  8849. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8850. *
  8851. * |31 16|15 12|11 8|7 0|
  8852. * |-------------------------------+--------------+--------------+------------|
  8853. * | reserved |h2t msg method|t2h msg method| msg_type |
  8854. * |--------------------------------------------------------------------------|
  8855. * | t2h msi interrupt number |
  8856. * |--------------------------------------------------------------------------|
  8857. * | shared memory area size |
  8858. * |--------------------------------------------------------------------------|
  8859. * | shared memory area physical address low |
  8860. * |--------------------------------------------------------------------------|
  8861. * | shared memory area physical address high |
  8862. * |--------------------------------------------------------------------------|
  8863. *
  8864. * The message is interpreted as follows:
  8865. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8866. * b'8:11 - t2h_msg_method: indicates method to be used for
  8867. * T2H communication in UMAC hang recovery mode.
  8868. * Value zero indicates MSI interrupt (default method).
  8869. * Refer to htt_umac_hang_recovery_msg_method enum.
  8870. * b'12:15 - h2t_msg_method: indicates method to be used for
  8871. * H2T communication in UMAC hang recovery mode.
  8872. * Value zero indicates polling by target for this h2t msg
  8873. * during UMAC hang recovery mode.
  8874. * Refer to htt_umac_hang_recovery_msg_method enum.
  8875. * b'16:31 - reserved.
  8876. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8877. * T2H communication in UMAC hang recovery mode.
  8878. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8879. * only when in UMAC hang recovery mode.
  8880. * This refers to size in bytes.
  8881. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8882. * of the shared memory dedicated for messaging only when
  8883. * in UMAC hang recovery mode.
  8884. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8885. * of the shared memory dedicated for messaging only when
  8886. * in UMAC hang recovery mode.
  8887. */
  8888. /* t2h_msg_method and h2t_msg_method */
  8889. enum htt_umac_hang_recovery_msg_method {
  8890. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8891. };
  8892. PREPACK typedef struct {
  8893. A_UINT32 msg_type : 8,
  8894. t2h_msg_method : 4,
  8895. h2t_msg_method : 4,
  8896. reserved : 16;
  8897. A_UINT32 t2h_msi_data;
  8898. /* size bytes and physical address of shared memory. */
  8899. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8900. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8901. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8902. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8903. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8904. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8905. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8906. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8907. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8908. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8909. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8910. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8911. do { \
  8912. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8913. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8914. } while (0)
  8915. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8916. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8917. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8918. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8919. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8920. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8921. do { \
  8922. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8923. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8924. } while (0)
  8925. /*=== target -> host messages ===============================================*/
  8926. enum htt_t2h_msg_type {
  8927. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8928. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8929. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8930. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8931. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8932. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8933. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8934. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8935. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8936. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8937. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8938. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8939. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8940. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8941. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8942. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8943. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8944. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8945. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8946. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8947. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8948. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8949. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8950. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8951. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8952. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8953. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8954. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8955. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8956. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8957. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8958. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8959. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8960. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8961. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8962. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8963. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8964. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8965. /* TX_OFFLOAD_DELIVER_IND:
  8966. * Forward the target's locally-generated packets to the host,
  8967. * to provide to the monitor mode interface.
  8968. */
  8969. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8970. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8971. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8972. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8973. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8974. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8975. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8976. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8977. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8978. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8979. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8980. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8981. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8982. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8983. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8984. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8985. HTT_T2H_MSG_TYPE_TEST,
  8986. /* keep this last */
  8987. HTT_T2H_NUM_MSGS
  8988. };
  8989. /*
  8990. * HTT target to host message type -
  8991. * stored in bits 7:0 of the first word of the message
  8992. */
  8993. #define HTT_T2H_MSG_TYPE_M 0xff
  8994. #define HTT_T2H_MSG_TYPE_S 0
  8995. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8998. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8999. } while (0)
  9000. #define HTT_T2H_MSG_TYPE_GET(word) \
  9001. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9002. /**
  9003. * @brief target -> host version number confirmation message definition
  9004. *
  9005. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9006. *
  9007. * |31 24|23 16|15 8|7 0|
  9008. * |----------------+----------------+----------------+----------------|
  9009. * | reserved | major number | minor number | msg type |
  9010. * |-------------------------------------------------------------------|
  9011. * : option request TLV (optional) |
  9012. * :...................................................................:
  9013. *
  9014. * The VER_CONF message may consist of a single 4-byte word, or may be
  9015. * extended with TLVs that specify HTT options selected by the target.
  9016. * The following option TLVs may be appended to the VER_CONF message:
  9017. * - LL_BUS_ADDR_SIZE
  9018. * - HL_SUPPRESS_TX_COMPL_IND
  9019. * - MAX_TX_QUEUE_GROUPS
  9020. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9021. * may be appended to the VER_CONF message (but only one TLV of each type).
  9022. *
  9023. * Header fields:
  9024. * - MSG_TYPE
  9025. * Bits 7:0
  9026. * Purpose: identifies this as a version number confirmation message
  9027. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9028. * - VER_MINOR
  9029. * Bits 15:8
  9030. * Purpose: Specify the minor number of the HTT message library version
  9031. * in use by the target firmware.
  9032. * The minor number specifies the specific revision within a range
  9033. * of fundamentally compatible HTT message definition revisions.
  9034. * Compatible revisions involve adding new messages or perhaps
  9035. * adding new fields to existing messages, in a backwards-compatible
  9036. * manner.
  9037. * Incompatible revisions involve changing the message type values,
  9038. * or redefining existing messages.
  9039. * Value: minor number
  9040. * - VER_MAJOR
  9041. * Bits 15:8
  9042. * Purpose: Specify the major number of the HTT message library version
  9043. * in use by the target firmware.
  9044. * The major number specifies the family of minor revisions that are
  9045. * fundamentally compatible with each other, but not with prior or
  9046. * later families.
  9047. * Value: major number
  9048. */
  9049. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9050. #define HTT_VER_CONF_MINOR_S 8
  9051. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9052. #define HTT_VER_CONF_MAJOR_S 16
  9053. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9054. do { \
  9055. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9056. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9057. } while (0)
  9058. #define HTT_VER_CONF_MINOR_GET(word) \
  9059. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9060. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9061. do { \
  9062. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9063. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9064. } while (0)
  9065. #define HTT_VER_CONF_MAJOR_GET(word) \
  9066. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9067. #define HTT_VER_CONF_BYTES 4
  9068. /**
  9069. * @brief - target -> host HTT Rx In order indication message
  9070. *
  9071. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9072. *
  9073. * @details
  9074. *
  9075. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9076. * |----------------+-------------------+---------------------+---------------|
  9077. * | peer ID | P| F| O| ext TID | msg type |
  9078. * |--------------------------------------------------------------------------|
  9079. * | MSDU count | Reserved | vdev id |
  9080. * |--------------------------------------------------------------------------|
  9081. * | MSDU 0 bus address (bits 31:0) |
  9082. #if HTT_PADDR64
  9083. * | MSDU 0 bus address (bits 63:32) |
  9084. #endif
  9085. * |--------------------------------------------------------------------------|
  9086. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9087. * |--------------------------------------------------------------------------|
  9088. * | MSDU 1 bus address (bits 31:0) |
  9089. #if HTT_PADDR64
  9090. * | MSDU 1 bus address (bits 63:32) |
  9091. #endif
  9092. * |--------------------------------------------------------------------------|
  9093. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9094. * |--------------------------------------------------------------------------|
  9095. */
  9096. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9097. *
  9098. * @details
  9099. * bits
  9100. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9101. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9102. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9103. * | | frag | | | | fail |chksum fail|
  9104. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9105. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9106. */
  9107. struct htt_rx_in_ord_paddr_ind_hdr_t
  9108. {
  9109. A_UINT32 /* word 0 */
  9110. msg_type: 8,
  9111. ext_tid: 5,
  9112. offload: 1,
  9113. frag: 1,
  9114. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9115. peer_id: 16;
  9116. A_UINT32 /* word 1 */
  9117. vap_id: 8,
  9118. /* NOTE:
  9119. * This reserved_1 field is not truly reserved - certain targets use
  9120. * this field internally to store debug information, and do not zero
  9121. * out the contents of the field before uploading the message to the
  9122. * host. Thus, any host-target communication supported by this field
  9123. * is limited to using values that are never used by the debug
  9124. * information stored by certain targets in the reserved_1 field.
  9125. * In particular, the targets in question don't use the value 0x3
  9126. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9127. * so this previously-unused value within these bits is available to
  9128. * use as the host / target PKT_CAPTURE_MODE flag.
  9129. */
  9130. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9131. /* if pkt_capture_mode == 0x3, host should
  9132. * send rx frames to monitor mode interface
  9133. */
  9134. msdu_cnt: 16;
  9135. };
  9136. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9137. {
  9138. A_UINT32 dma_addr;
  9139. A_UINT32
  9140. length: 16,
  9141. fw_desc: 8,
  9142. msdu_info:8;
  9143. };
  9144. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9145. {
  9146. A_UINT32 dma_addr_lo;
  9147. A_UINT32 dma_addr_hi;
  9148. A_UINT32
  9149. length: 16,
  9150. fw_desc: 8,
  9151. msdu_info:8;
  9152. };
  9153. #if HTT_PADDR64
  9154. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9155. #else
  9156. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9157. #endif
  9158. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9159. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9160. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9161. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9162. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9163. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9164. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9165. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9166. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9167. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9168. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9169. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9170. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9171. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9172. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9173. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9174. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9175. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9176. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9177. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9178. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9179. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9180. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9181. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9182. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9183. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9184. /* for systems using 64-bit format for bus addresses */
  9185. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9186. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9187. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9188. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9189. /* for systems using 32-bit format for bus addresses */
  9190. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9191. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9192. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9193. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9194. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9195. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9198. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9199. do { \
  9200. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9201. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9202. } while (0)
  9203. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9204. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9205. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9206. do { \
  9207. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9208. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9209. } while (0)
  9210. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9211. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9212. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9213. do { \
  9214. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9215. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9216. } while (0)
  9217. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9218. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9219. /*
  9220. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9221. * deliver the rx frames to the monitor mode interface.
  9222. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9223. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9224. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9225. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9226. */
  9227. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9228. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9231. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9232. } while (0)
  9233. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9234. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9235. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9236. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9237. do { \
  9238. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9239. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9240. } while (0)
  9241. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9242. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9243. /* for systems using 64-bit format for bus addresses */
  9244. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9245. do { \
  9246. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9247. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9248. } while (0)
  9249. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9250. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9251. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9252. do { \
  9253. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9254. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9255. } while (0)
  9256. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9257. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9258. /* for systems using 32-bit format for bus addresses */
  9259. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9260. do { \
  9261. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9262. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9263. } while (0)
  9264. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9265. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9266. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9267. do { \
  9268. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9269. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9270. } while (0)
  9271. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9272. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9273. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9274. do { \
  9275. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9276. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9277. } while (0)
  9278. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9279. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9280. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9281. do { \
  9282. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9283. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9284. } while (0)
  9285. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9286. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9287. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9288. do { \
  9289. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9290. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9291. } while (0)
  9292. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9293. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9294. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9295. do { \
  9296. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9297. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9298. } while (0)
  9299. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9300. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9301. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9302. do { \
  9303. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9304. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9305. } while (0)
  9306. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9307. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9308. /* definitions used within target -> host rx indication message */
  9309. PREPACK struct htt_rx_ind_hdr_prefix_t
  9310. {
  9311. A_UINT32 /* word 0 */
  9312. msg_type: 8,
  9313. ext_tid: 5,
  9314. release_valid: 1,
  9315. flush_valid: 1,
  9316. reserved0: 1,
  9317. peer_id: 16;
  9318. A_UINT32 /* word 1 */
  9319. flush_start_seq_num: 6,
  9320. flush_end_seq_num: 6,
  9321. release_start_seq_num: 6,
  9322. release_end_seq_num: 6,
  9323. num_mpdu_ranges: 8;
  9324. } POSTPACK;
  9325. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9326. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9327. #define HTT_TGT_RSSI_INVALID 0x80
  9328. PREPACK struct htt_rx_ppdu_desc_t
  9329. {
  9330. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9331. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9332. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9333. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9334. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9335. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9336. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9337. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9338. A_UINT32 /* word 0 */
  9339. rssi_cmb: 8,
  9340. timestamp_submicrosec: 8,
  9341. phy_err_code: 8,
  9342. phy_err: 1,
  9343. legacy_rate: 4,
  9344. legacy_rate_sel: 1,
  9345. end_valid: 1,
  9346. start_valid: 1;
  9347. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9348. union {
  9349. A_UINT32 /* word 1 */
  9350. rssi0_pri20: 8,
  9351. rssi0_ext20: 8,
  9352. rssi0_ext40: 8,
  9353. rssi0_ext80: 8;
  9354. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9355. } u0;
  9356. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9357. union {
  9358. A_UINT32 /* word 2 */
  9359. rssi1_pri20: 8,
  9360. rssi1_ext20: 8,
  9361. rssi1_ext40: 8,
  9362. rssi1_ext80: 8;
  9363. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9364. } u1;
  9365. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9366. union {
  9367. A_UINT32 /* word 3 */
  9368. rssi2_pri20: 8,
  9369. rssi2_ext20: 8,
  9370. rssi2_ext40: 8,
  9371. rssi2_ext80: 8;
  9372. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9373. } u2;
  9374. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9375. union {
  9376. A_UINT32 /* word 4 */
  9377. rssi3_pri20: 8,
  9378. rssi3_ext20: 8,
  9379. rssi3_ext40: 8,
  9380. rssi3_ext80: 8;
  9381. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9382. } u3;
  9383. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9384. A_UINT32 tsf32; /* word 5 */
  9385. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9386. A_UINT32 timestamp_microsec; /* word 6 */
  9387. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9388. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9389. A_UINT32 /* word 7 */
  9390. vht_sig_a1: 24,
  9391. preamble_type: 8;
  9392. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9393. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9394. A_UINT32 /* word 8 */
  9395. vht_sig_a2: 24,
  9396. /* sa_ant_matrix
  9397. * For cases where a single rx chain has options to be connected to
  9398. * different rx antennas, show which rx antennas were in use during
  9399. * receipt of a given PPDU.
  9400. * This sa_ant_matrix provides a bitmask of the antennas used while
  9401. * receiving this frame.
  9402. */
  9403. sa_ant_matrix: 8;
  9404. } POSTPACK;
  9405. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9406. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9407. PREPACK struct htt_rx_ind_hdr_suffix_t
  9408. {
  9409. A_UINT32 /* word 0 */
  9410. fw_rx_desc_bytes: 16,
  9411. reserved0: 16;
  9412. } POSTPACK;
  9413. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9414. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9415. PREPACK struct htt_rx_ind_hdr_t
  9416. {
  9417. struct htt_rx_ind_hdr_prefix_t prefix;
  9418. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9419. struct htt_rx_ind_hdr_suffix_t suffix;
  9420. } POSTPACK;
  9421. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9422. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9423. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9424. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9425. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9426. /*
  9427. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9428. * the offset into the HTT rx indication message at which the
  9429. * FW rx PPDU descriptor resides
  9430. */
  9431. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9432. /*
  9433. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9434. * the offset into the HTT rx indication message at which the
  9435. * header suffix (FW rx MSDU byte count) resides
  9436. */
  9437. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9438. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9439. /*
  9440. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9441. * the offset into the HTT rx indication message at which the per-MSDU
  9442. * information starts
  9443. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9444. * per-MSDU information portion of the message. The per-MSDU info itself
  9445. * starts at byte 12.
  9446. */
  9447. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9448. /**
  9449. * @brief target -> host rx indication message definition
  9450. *
  9451. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9452. *
  9453. * @details
  9454. * The following field definitions describe the format of the rx indication
  9455. * message sent from the target to the host.
  9456. * The message consists of three major sections:
  9457. * 1. a fixed-length header
  9458. * 2. a variable-length list of firmware rx MSDU descriptors
  9459. * 3. one or more 4-octet MPDU range information elements
  9460. * The fixed length header itself has two sub-sections
  9461. * 1. the message meta-information, including identification of the
  9462. * sender and type of the received data, and a 4-octet flush/release IE
  9463. * 2. the firmware rx PPDU descriptor
  9464. *
  9465. * The format of the message is depicted below.
  9466. * in this depiction, the following abbreviations are used for information
  9467. * elements within the message:
  9468. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9469. * elements associated with the PPDU start are valid.
  9470. * Specifically, the following fields are valid only if SV is set:
  9471. * RSSI (all variants), L, legacy rate, preamble type, service,
  9472. * VHT-SIG-A
  9473. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9474. * elements associated with the PPDU end are valid.
  9475. * Specifically, the following fields are valid only if EV is set:
  9476. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9477. * - L - Legacy rate selector - if legacy rates are used, this flag
  9478. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9479. * (L == 0) PHY.
  9480. * - P - PHY error flag - boolean indication of whether the rx frame had
  9481. * a PHY error
  9482. *
  9483. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9484. * |----------------+-------------------+---------------------+---------------|
  9485. * | peer ID | |RV|FV| ext TID | msg type |
  9486. * |--------------------------------------------------------------------------|
  9487. * | num | release | release | flush | flush |
  9488. * | MPDU | end | start | end | start |
  9489. * | ranges | seq num | seq num | seq num | seq num |
  9490. * |==========================================================================|
  9491. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9492. * |V|V| | rate | | | timestamp | RSSI |
  9493. * |--------------------------------------------------------------------------|
  9494. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9495. * |--------------------------------------------------------------------------|
  9496. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9497. * |--------------------------------------------------------------------------|
  9498. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9499. * |--------------------------------------------------------------------------|
  9500. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9501. * |--------------------------------------------------------------------------|
  9502. * | TSF LSBs |
  9503. * |--------------------------------------------------------------------------|
  9504. * | microsec timestamp |
  9505. * |--------------------------------------------------------------------------|
  9506. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9507. * |--------------------------------------------------------------------------|
  9508. * | service | HT-SIG / VHT-SIG-A2 |
  9509. * |==========================================================================|
  9510. * | reserved | FW rx desc bytes |
  9511. * |--------------------------------------------------------------------------|
  9512. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9513. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9514. * |--------------------------------------------------------------------------|
  9515. * : : :
  9516. * |--------------------------------------------------------------------------|
  9517. * | alignment | MSDU Rx |
  9518. * | padding | desc Bn |
  9519. * |--------------------------------------------------------------------------|
  9520. * | reserved | MPDU range status | MPDU count |
  9521. * |--------------------------------------------------------------------------|
  9522. * : reserved : MPDU range status : MPDU count :
  9523. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9524. *
  9525. * Header fields:
  9526. * - MSG_TYPE
  9527. * Bits 7:0
  9528. * Purpose: identifies this as an rx indication message
  9529. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9530. * - EXT_TID
  9531. * Bits 12:8
  9532. * Purpose: identify the traffic ID of the rx data, including
  9533. * special "extended" TID values for multicast, broadcast, and
  9534. * non-QoS data frames
  9535. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9536. * - FLUSH_VALID (FV)
  9537. * Bit 13
  9538. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9539. * is valid
  9540. * Value:
  9541. * 1 -> flush IE is valid and needs to be processed
  9542. * 0 -> flush IE is not valid and should be ignored
  9543. * - REL_VALID (RV)
  9544. * Bit 13
  9545. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9546. * is valid
  9547. * Value:
  9548. * 1 -> release IE is valid and needs to be processed
  9549. * 0 -> release IE is not valid and should be ignored
  9550. * - PEER_ID
  9551. * Bits 31:16
  9552. * Purpose: Identify, by ID, which peer sent the rx data
  9553. * Value: ID of the peer who sent the rx data
  9554. * - FLUSH_SEQ_NUM_START
  9555. * Bits 5:0
  9556. * Purpose: Indicate the start of a series of MPDUs to flush
  9557. * Not all MPDUs within this series are necessarily valid - the host
  9558. * must check each sequence number within this range to see if the
  9559. * corresponding MPDU is actually present.
  9560. * This field is only valid if the FV bit is set.
  9561. * Value:
  9562. * The sequence number for the first MPDUs to check to flush.
  9563. * The sequence number is masked by 0x3f.
  9564. * - FLUSH_SEQ_NUM_END
  9565. * Bits 11:6
  9566. * Purpose: Indicate the end of a series of MPDUs to flush
  9567. * Value:
  9568. * The sequence number one larger than the sequence number of the
  9569. * last MPDU to check to flush.
  9570. * The sequence number is masked by 0x3f.
  9571. * Not all MPDUs within this series are necessarily valid - the host
  9572. * must check each sequence number within this range to see if the
  9573. * corresponding MPDU is actually present.
  9574. * This field is only valid if the FV bit is set.
  9575. * - REL_SEQ_NUM_START
  9576. * Bits 17:12
  9577. * Purpose: Indicate the start of a series of MPDUs to release.
  9578. * All MPDUs within this series are present and valid - the host
  9579. * need not check each sequence number within this range to see if
  9580. * the corresponding MPDU is actually present.
  9581. * This field is only valid if the RV bit is set.
  9582. * Value:
  9583. * The sequence number for the first MPDUs to check to release.
  9584. * The sequence number is masked by 0x3f.
  9585. * - REL_SEQ_NUM_END
  9586. * Bits 23:18
  9587. * Purpose: Indicate the end of a series of MPDUs to release.
  9588. * Value:
  9589. * The sequence number one larger than the sequence number of the
  9590. * last MPDU to check to release.
  9591. * The sequence number is masked by 0x3f.
  9592. * All MPDUs within this series are present and valid - the host
  9593. * need not check each sequence number within this range to see if
  9594. * the corresponding MPDU is actually present.
  9595. * This field is only valid if the RV bit is set.
  9596. * - NUM_MPDU_RANGES
  9597. * Bits 31:24
  9598. * Purpose: Indicate how many ranges of MPDUs are present.
  9599. * Each MPDU range consists of a series of contiguous MPDUs within the
  9600. * rx frame sequence which all have the same MPDU status.
  9601. * Value: 1-63 (typically a small number, like 1-3)
  9602. *
  9603. * Rx PPDU descriptor fields:
  9604. * - RSSI_CMB
  9605. * Bits 7:0
  9606. * Purpose: Combined RSSI from all active rx chains, across the active
  9607. * bandwidth.
  9608. * Value: RSSI dB units w.r.t. noise floor
  9609. * - TIMESTAMP_SUBMICROSEC
  9610. * Bits 15:8
  9611. * Purpose: high-resolution timestamp
  9612. * Value:
  9613. * Sub-microsecond time of PPDU reception.
  9614. * This timestamp ranges from [0,MAC clock MHz).
  9615. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9616. * to form a high-resolution, large range rx timestamp.
  9617. * - PHY_ERR_CODE
  9618. * Bits 23:16
  9619. * Purpose:
  9620. * If the rx frame processing resulted in a PHY error, indicate what
  9621. * type of rx PHY error occurred.
  9622. * Value:
  9623. * This field is valid if the "P" (PHY_ERR) flag is set.
  9624. * TBD: document/specify the values for this field
  9625. * - PHY_ERR
  9626. * Bit 24
  9627. * Purpose: indicate whether the rx PPDU had a PHY error
  9628. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9629. * - LEGACY_RATE
  9630. * Bits 28:25
  9631. * Purpose:
  9632. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9633. * specify which rate was used.
  9634. * Value:
  9635. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9636. * flag.
  9637. * If LEGACY_RATE_SEL is 0:
  9638. * 0x8: OFDM 48 Mbps
  9639. * 0x9: OFDM 24 Mbps
  9640. * 0xA: OFDM 12 Mbps
  9641. * 0xB: OFDM 6 Mbps
  9642. * 0xC: OFDM 54 Mbps
  9643. * 0xD: OFDM 36 Mbps
  9644. * 0xE: OFDM 18 Mbps
  9645. * 0xF: OFDM 9 Mbps
  9646. * If LEGACY_RATE_SEL is 1:
  9647. * 0x8: CCK 11 Mbps long preamble
  9648. * 0x9: CCK 5.5 Mbps long preamble
  9649. * 0xA: CCK 2 Mbps long preamble
  9650. * 0xB: CCK 1 Mbps long preamble
  9651. * 0xC: CCK 11 Mbps short preamble
  9652. * 0xD: CCK 5.5 Mbps short preamble
  9653. * 0xE: CCK 2 Mbps short preamble
  9654. * - LEGACY_RATE_SEL
  9655. * Bit 29
  9656. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9657. * Value:
  9658. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9659. * used a legacy rate.
  9660. * 0 -> OFDM, 1 -> CCK
  9661. * - END_VALID
  9662. * Bit 30
  9663. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9664. * the start of the PPDU are valid. Specifically, the following
  9665. * fields are only valid if END_VALID is set:
  9666. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9667. * TIMESTAMP_SUBMICROSEC
  9668. * Value:
  9669. * 0 -> rx PPDU desc end fields are not valid
  9670. * 1 -> rx PPDU desc end fields are valid
  9671. * - START_VALID
  9672. * Bit 31
  9673. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9674. * the end of the PPDU are valid. Specifically, the following
  9675. * fields are only valid if START_VALID is set:
  9676. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9677. * VHT-SIG-A
  9678. * Value:
  9679. * 0 -> rx PPDU desc start fields are not valid
  9680. * 1 -> rx PPDU desc start fields are valid
  9681. * - RSSI0_PRI20
  9682. * Bits 7:0
  9683. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9684. * Value: RSSI dB units w.r.t. noise floor
  9685. *
  9686. * - RSSI0_EXT20
  9687. * Bits 7:0
  9688. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9689. * (if the rx bandwidth was >= 40 MHz)
  9690. * Value: RSSI dB units w.r.t. noise floor
  9691. * - RSSI0_EXT40
  9692. * Bits 7:0
  9693. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9694. * (if the rx bandwidth was >= 80 MHz)
  9695. * Value: RSSI dB units w.r.t. noise floor
  9696. * - RSSI0_EXT80
  9697. * Bits 7:0
  9698. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9699. * (if the rx bandwidth was >= 160 MHz)
  9700. * Value: RSSI dB units w.r.t. noise floor
  9701. *
  9702. * - RSSI1_PRI20
  9703. * Bits 7:0
  9704. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9705. * Value: RSSI dB units w.r.t. noise floor
  9706. * - RSSI1_EXT20
  9707. * Bits 7:0
  9708. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9709. * (if the rx bandwidth was >= 40 MHz)
  9710. * Value: RSSI dB units w.r.t. noise floor
  9711. * - RSSI1_EXT40
  9712. * Bits 7:0
  9713. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9714. * (if the rx bandwidth was >= 80 MHz)
  9715. * Value: RSSI dB units w.r.t. noise floor
  9716. * - RSSI1_EXT80
  9717. * Bits 7:0
  9718. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9719. * (if the rx bandwidth was >= 160 MHz)
  9720. * Value: RSSI dB units w.r.t. noise floor
  9721. *
  9722. * - RSSI2_PRI20
  9723. * Bits 7:0
  9724. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9725. * Value: RSSI dB units w.r.t. noise floor
  9726. * - RSSI2_EXT20
  9727. * Bits 7:0
  9728. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9729. * (if the rx bandwidth was >= 40 MHz)
  9730. * Value: RSSI dB units w.r.t. noise floor
  9731. * - RSSI2_EXT40
  9732. * Bits 7:0
  9733. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9734. * (if the rx bandwidth was >= 80 MHz)
  9735. * Value: RSSI dB units w.r.t. noise floor
  9736. * - RSSI2_EXT80
  9737. * Bits 7:0
  9738. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9739. * (if the rx bandwidth was >= 160 MHz)
  9740. * Value: RSSI dB units w.r.t. noise floor
  9741. *
  9742. * - RSSI3_PRI20
  9743. * Bits 7:0
  9744. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9745. * Value: RSSI dB units w.r.t. noise floor
  9746. * - RSSI3_EXT20
  9747. * Bits 7:0
  9748. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9749. * (if the rx bandwidth was >= 40 MHz)
  9750. * Value: RSSI dB units w.r.t. noise floor
  9751. * - RSSI3_EXT40
  9752. * Bits 7:0
  9753. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9754. * (if the rx bandwidth was >= 80 MHz)
  9755. * Value: RSSI dB units w.r.t. noise floor
  9756. * - RSSI3_EXT80
  9757. * Bits 7:0
  9758. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9759. * (if the rx bandwidth was >= 160 MHz)
  9760. * Value: RSSI dB units w.r.t. noise floor
  9761. *
  9762. * - TSF32
  9763. * Bits 31:0
  9764. * Purpose: specify the time the rx PPDU was received, in TSF units
  9765. * Value: 32 LSBs of the TSF
  9766. * - TIMESTAMP_MICROSEC
  9767. * Bits 31:0
  9768. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9769. * Value: PPDU rx time, in microseconds
  9770. * - VHT_SIG_A1
  9771. * Bits 23:0
  9772. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9773. * from the rx PPDU
  9774. * Value:
  9775. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9776. * VHT-SIG-A1 data.
  9777. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9778. * first 24 bits of the HT-SIG data.
  9779. * Otherwise, this field is invalid.
  9780. * Refer to the the 802.11 protocol for the definition of the
  9781. * HT-SIG and VHT-SIG-A1 fields
  9782. * - VHT_SIG_A2
  9783. * Bits 23:0
  9784. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9785. * from the rx PPDU
  9786. * Value:
  9787. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9788. * VHT-SIG-A2 data.
  9789. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9790. * last 24 bits of the HT-SIG data.
  9791. * Otherwise, this field is invalid.
  9792. * Refer to the the 802.11 protocol for the definition of the
  9793. * HT-SIG and VHT-SIG-A2 fields
  9794. * - PREAMBLE_TYPE
  9795. * Bits 31:24
  9796. * Purpose: indicate the PHY format of the received burst
  9797. * Value:
  9798. * 0x4: Legacy (OFDM/CCK)
  9799. * 0x8: HT
  9800. * 0x9: HT with TxBF
  9801. * 0xC: VHT
  9802. * 0xD: VHT with TxBF
  9803. * - SERVICE
  9804. * Bits 31:24
  9805. * Purpose: TBD
  9806. * Value: TBD
  9807. *
  9808. * Rx MSDU descriptor fields:
  9809. * - FW_RX_DESC_BYTES
  9810. * Bits 15:0
  9811. * Purpose: Indicate how many bytes in the Rx indication are used for
  9812. * FW Rx descriptors
  9813. *
  9814. * Payload fields:
  9815. * - MPDU_COUNT
  9816. * Bits 7:0
  9817. * Purpose: Indicate how many sequential MPDUs share the same status.
  9818. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9819. * - MPDU_STATUS
  9820. * Bits 15:8
  9821. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9822. * received successfully.
  9823. * Value:
  9824. * 0x1: success
  9825. * 0x2: FCS error
  9826. * 0x3: duplicate error
  9827. * 0x4: replay error
  9828. * 0x5: invalid peer
  9829. */
  9830. /* header fields */
  9831. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9832. #define HTT_RX_IND_EXT_TID_S 8
  9833. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9834. #define HTT_RX_IND_FLUSH_VALID_S 13
  9835. #define HTT_RX_IND_REL_VALID_M 0x4000
  9836. #define HTT_RX_IND_REL_VALID_S 14
  9837. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9838. #define HTT_RX_IND_PEER_ID_S 16
  9839. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9840. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9841. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9842. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9843. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9844. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9845. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9846. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9847. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9848. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9849. /* rx PPDU descriptor fields */
  9850. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9851. #define HTT_RX_IND_RSSI_CMB_S 0
  9852. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9853. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9854. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9855. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9856. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9857. #define HTT_RX_IND_PHY_ERR_S 24
  9858. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9859. #define HTT_RX_IND_LEGACY_RATE_S 25
  9860. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9861. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9862. #define HTT_RX_IND_END_VALID_M 0x40000000
  9863. #define HTT_RX_IND_END_VALID_S 30
  9864. #define HTT_RX_IND_START_VALID_M 0x80000000
  9865. #define HTT_RX_IND_START_VALID_S 31
  9866. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9867. #define HTT_RX_IND_RSSI_PRI20_S 0
  9868. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9869. #define HTT_RX_IND_RSSI_EXT20_S 8
  9870. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9871. #define HTT_RX_IND_RSSI_EXT40_S 16
  9872. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9873. #define HTT_RX_IND_RSSI_EXT80_S 24
  9874. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9875. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9876. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9877. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9878. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9879. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9880. #define HTT_RX_IND_SERVICE_M 0xff000000
  9881. #define HTT_RX_IND_SERVICE_S 24
  9882. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9883. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9884. /* rx MSDU descriptor fields */
  9885. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9886. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9887. /* payload fields */
  9888. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9889. #define HTT_RX_IND_MPDU_COUNT_S 0
  9890. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9891. #define HTT_RX_IND_MPDU_STATUS_S 8
  9892. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9893. do { \
  9894. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9895. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9896. } while (0)
  9897. #define HTT_RX_IND_EXT_TID_GET(word) \
  9898. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9899. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9900. do { \
  9901. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9902. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9903. } while (0)
  9904. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9905. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9906. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9907. do { \
  9908. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9909. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9910. } while (0)
  9911. #define HTT_RX_IND_REL_VALID_GET(word) \
  9912. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9913. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9914. do { \
  9915. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9916. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9917. } while (0)
  9918. #define HTT_RX_IND_PEER_ID_GET(word) \
  9919. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9920. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9921. do { \
  9922. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9923. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9924. } while (0)
  9925. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9926. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9927. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9928. do { \
  9929. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9930. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9931. } while (0)
  9932. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9933. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9934. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9935. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9936. do { \
  9937. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9938. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9939. } while (0)
  9940. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9941. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9942. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9943. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9946. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9947. } while (0)
  9948. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9949. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9950. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9951. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9952. do { \
  9953. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9954. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9955. } while (0)
  9956. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9957. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9958. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9959. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9960. do { \
  9961. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9962. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9963. } while (0)
  9964. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9965. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9966. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9967. /* FW rx PPDU descriptor fields */
  9968. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9969. do { \
  9970. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9971. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9972. } while (0)
  9973. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9974. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9975. HTT_RX_IND_RSSI_CMB_S)
  9976. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9979. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9980. } while (0)
  9981. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9982. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9983. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9984. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9985. do { \
  9986. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9987. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9988. } while (0)
  9989. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9990. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9991. HTT_RX_IND_PHY_ERR_CODE_S)
  9992. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9993. do { \
  9994. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9995. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9996. } while (0)
  9997. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9998. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9999. HTT_RX_IND_PHY_ERR_S)
  10000. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10001. do { \
  10002. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10003. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10004. } while (0)
  10005. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10006. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10007. HTT_RX_IND_LEGACY_RATE_S)
  10008. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10011. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10012. } while (0)
  10013. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10014. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10015. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10016. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10017. do { \
  10018. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10019. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10020. } while (0)
  10021. #define HTT_RX_IND_END_VALID_GET(word) \
  10022. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10023. HTT_RX_IND_END_VALID_S)
  10024. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10025. do { \
  10026. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10027. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10028. } while (0)
  10029. #define HTT_RX_IND_START_VALID_GET(word) \
  10030. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10031. HTT_RX_IND_START_VALID_S)
  10032. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10033. do { \
  10034. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10035. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10036. } while (0)
  10037. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10038. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10039. HTT_RX_IND_RSSI_PRI20_S)
  10040. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10041. do { \
  10042. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10043. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10044. } while (0)
  10045. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10046. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10047. HTT_RX_IND_RSSI_EXT20_S)
  10048. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10049. do { \
  10050. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10051. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10052. } while (0)
  10053. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10054. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10055. HTT_RX_IND_RSSI_EXT40_S)
  10056. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10057. do { \
  10058. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10059. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10060. } while (0)
  10061. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10062. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10063. HTT_RX_IND_RSSI_EXT80_S)
  10064. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10067. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10068. } while (0)
  10069. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10070. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10071. HTT_RX_IND_VHT_SIG_A1_S)
  10072. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10073. do { \
  10074. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10075. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10076. } while (0)
  10077. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10078. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10079. HTT_RX_IND_VHT_SIG_A2_S)
  10080. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10081. do { \
  10082. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10083. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10084. } while (0)
  10085. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10086. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10087. HTT_RX_IND_PREAMBLE_TYPE_S)
  10088. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10091. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10092. } while (0)
  10093. #define HTT_RX_IND_SERVICE_GET(word) \
  10094. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10095. HTT_RX_IND_SERVICE_S)
  10096. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10097. do { \
  10098. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10099. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10100. } while (0)
  10101. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10102. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10103. HTT_RX_IND_SA_ANT_MATRIX_S)
  10104. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10105. do { \
  10106. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10107. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10108. } while (0)
  10109. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10110. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10111. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10112. do { \
  10113. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10114. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10115. } while (0)
  10116. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10117. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10118. #define HTT_RX_IND_HL_BYTES \
  10119. (HTT_RX_IND_HDR_BYTES + \
  10120. 4 /* single FW rx MSDU descriptor */ + \
  10121. 4 /* single MPDU range information element */)
  10122. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10123. /* Could we use one macro entry? */
  10124. #define HTT_WORD_SET(word, field, value) \
  10125. do { \
  10126. HTT_CHECK_SET_VAL(field, value); \
  10127. (word) |= ((value) << field ## _S); \
  10128. } while (0)
  10129. #define HTT_WORD_GET(word, field) \
  10130. (((word) & field ## _M) >> field ## _S)
  10131. PREPACK struct hl_htt_rx_ind_base {
  10132. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10133. } POSTPACK;
  10134. /*
  10135. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10136. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10137. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10138. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10139. * htt_rx_ind_hl_rx_desc_t.
  10140. */
  10141. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10142. struct htt_rx_ind_hl_rx_desc_t {
  10143. A_UINT8 ver;
  10144. A_UINT8 len;
  10145. struct {
  10146. A_UINT8
  10147. first_msdu: 1,
  10148. last_msdu: 1,
  10149. c3_failed: 1,
  10150. c4_failed: 1,
  10151. ipv6: 1,
  10152. tcp: 1,
  10153. udp: 1,
  10154. reserved: 1;
  10155. } flags;
  10156. /* NOTE: no reserved space - don't append any new fields here */
  10157. };
  10158. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10159. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10160. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10161. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10162. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10163. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10164. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10165. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10166. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10167. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10168. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10169. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10170. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10171. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10172. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10173. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10174. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10175. /* This structure is used in HL, the basic descriptor information
  10176. * used by host. the structure is translated by FW from HW desc
  10177. * or generated by FW. But in HL monitor mode, the host would use
  10178. * the same structure with LL.
  10179. */
  10180. PREPACK struct hl_htt_rx_desc_base {
  10181. A_UINT32
  10182. seq_num:12,
  10183. encrypted:1,
  10184. chan_info_present:1,
  10185. resv0:2,
  10186. mcast_bcast:1,
  10187. fragment:1,
  10188. key_id_oct:8,
  10189. resv1:6;
  10190. A_UINT32
  10191. pn_31_0;
  10192. union {
  10193. struct {
  10194. A_UINT16 pn_47_32;
  10195. A_UINT16 pn_63_48;
  10196. } pn16;
  10197. A_UINT32 pn_63_32;
  10198. } u0;
  10199. A_UINT32
  10200. pn_95_64;
  10201. A_UINT32
  10202. pn_127_96;
  10203. } POSTPACK;
  10204. /*
  10205. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10206. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10207. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10208. * Please see htt_chan_change_t for description of the fields.
  10209. */
  10210. PREPACK struct htt_chan_info_t
  10211. {
  10212. A_UINT32 primary_chan_center_freq_mhz: 16,
  10213. contig_chan1_center_freq_mhz: 16;
  10214. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10215. phy_mode: 8,
  10216. reserved: 8;
  10217. } POSTPACK;
  10218. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10219. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10220. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10221. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10222. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10223. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10224. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10225. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10226. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10227. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10228. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10229. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10230. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10231. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10232. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10233. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10234. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10235. /* Channel information */
  10236. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10237. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10238. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10239. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10240. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10241. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10242. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10243. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10244. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10245. do { \
  10246. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10247. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10248. } while (0)
  10249. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10250. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10251. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10252. do { \
  10253. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10254. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10255. } while (0)
  10256. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10257. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10258. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10259. do { \
  10260. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10261. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10262. } while (0)
  10263. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10264. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10265. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10266. do { \
  10267. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10268. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10269. } while (0)
  10270. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10271. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10272. /*
  10273. * @brief target -> host message definition for FW offloaded pkts
  10274. *
  10275. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10276. *
  10277. * @details
  10278. * The following field definitions describe the format of the firmware
  10279. * offload deliver message sent from the target to the host.
  10280. *
  10281. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10282. *
  10283. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10284. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10285. * | reserved_1 | msg type |
  10286. * |--------------------------------------------------------------------------|
  10287. * | phy_timestamp_l32 |
  10288. * |--------------------------------------------------------------------------|
  10289. * | WORD2 (see below) |
  10290. * |--------------------------------------------------------------------------|
  10291. * | seqno | framectrl |
  10292. * |--------------------------------------------------------------------------|
  10293. * | reserved_3 | vdev_id | tid_num|
  10294. * |--------------------------------------------------------------------------|
  10295. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10296. * |--------------------------------------------------------------------------|
  10297. *
  10298. * where:
  10299. * STAT = status
  10300. * F = format (802.3 vs. 802.11)
  10301. *
  10302. * definition for word 2
  10303. *
  10304. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10305. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10306. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10307. * |--------------------------------------------------------------------------|
  10308. *
  10309. * where:
  10310. * PR = preamble
  10311. * BF = beamformed
  10312. */
  10313. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10314. {
  10315. A_UINT32 /* word 0 */
  10316. msg_type:8, /* [ 7: 0] */
  10317. reserved_1:24; /* [31: 8] */
  10318. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10319. A_UINT32 /* word 2 */
  10320. /* preamble:
  10321. * 0-OFDM,
  10322. * 1-CCk,
  10323. * 2-HT,
  10324. * 3-VHT
  10325. */
  10326. preamble: 2, /* [1:0] */
  10327. /* mcs:
  10328. * In case of HT preamble interpret
  10329. * MCS along with NSS.
  10330. * Valid values for HT are 0 to 7.
  10331. * HT mcs 0 with NSS 2 is mcs 8.
  10332. * Valid values for VHT are 0 to 9.
  10333. */
  10334. mcs: 4, /* [5:2] */
  10335. /* rate:
  10336. * This is applicable only for
  10337. * CCK and OFDM preamble type
  10338. * rate 0: OFDM 48 Mbps,
  10339. * 1: OFDM 24 Mbps,
  10340. * 2: OFDM 12 Mbps
  10341. * 3: OFDM 6 Mbps
  10342. * 4: OFDM 54 Mbps
  10343. * 5: OFDM 36 Mbps
  10344. * 6: OFDM 18 Mbps
  10345. * 7: OFDM 9 Mbps
  10346. * rate 0: CCK 11 Mbps Long
  10347. * 1: CCK 5.5 Mbps Long
  10348. * 2: CCK 2 Mbps Long
  10349. * 3: CCK 1 Mbps Long
  10350. * 4: CCK 11 Mbps Short
  10351. * 5: CCK 5.5 Mbps Short
  10352. * 6: CCK 2 Mbps Short
  10353. */
  10354. rate : 3, /* [ 8: 6] */
  10355. rssi : 8, /* [16: 9] units=dBm */
  10356. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10357. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10358. stbc : 1, /* [22] */
  10359. sgi : 1, /* [23] */
  10360. ldpc : 1, /* [24] */
  10361. beamformed: 1, /* [25] */
  10362. reserved_2: 6; /* [31:26] */
  10363. A_UINT32 /* word 3 */
  10364. framectrl:16, /* [15: 0] */
  10365. seqno:16; /* [31:16] */
  10366. A_UINT32 /* word 4 */
  10367. tid_num:5, /* [ 4: 0] actual TID number */
  10368. vdev_id:8, /* [12: 5] */
  10369. reserved_3:19; /* [31:13] */
  10370. A_UINT32 /* word 5 */
  10371. /* status:
  10372. * 0: tx_ok
  10373. * 1: retry
  10374. * 2: drop
  10375. * 3: filtered
  10376. * 4: abort
  10377. * 5: tid delete
  10378. * 6: sw abort
  10379. * 7: dropped by peer migration
  10380. */
  10381. status:3, /* [2:0] */
  10382. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10383. tx_mpdu_bytes:16, /* [19:4] */
  10384. /* Indicates retry count of offloaded/local generated Data tx frames */
  10385. tx_retry_cnt:6, /* [25:20] */
  10386. reserved_4:6; /* [31:26] */
  10387. } POSTPACK;
  10388. /* FW offload deliver ind message header fields */
  10389. /* DWORD one */
  10390. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10391. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10392. /* DWORD two */
  10393. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10394. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10395. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10396. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10397. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10398. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10399. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10400. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10401. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10402. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10403. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10404. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10405. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10406. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10407. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10408. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10409. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10410. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10411. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10412. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10413. /* DWORD three*/
  10414. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10415. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10416. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10417. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10418. /* DWORD four */
  10419. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10420. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10421. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10422. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10423. /* DWORD five */
  10424. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10425. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10426. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10427. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10428. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10429. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10430. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10431. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10432. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10433. do { \
  10434. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10435. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10436. } while (0)
  10437. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10438. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10439. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10442. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10443. } while (0)
  10444. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10445. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10446. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10447. do { \
  10448. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10449. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10450. } while (0)
  10451. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10452. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10453. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10456. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10457. } while (0)
  10458. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10459. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10460. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10461. do { \
  10462. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10463. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10464. } while (0)
  10465. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10466. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10467. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10468. do { \
  10469. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10470. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10471. } while (0)
  10472. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10473. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10474. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10475. do { \
  10476. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10477. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10478. } while (0)
  10479. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10480. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10481. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10482. do { \
  10483. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10484. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10485. } while (0)
  10486. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10487. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10488. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10489. do { \
  10490. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10491. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10492. } while (0)
  10493. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10494. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10495. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10496. do { \
  10497. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10498. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10499. } while (0)
  10500. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10501. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10502. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10503. do { \
  10504. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10505. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10506. } while (0)
  10507. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10508. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10509. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10512. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10513. } while (0)
  10514. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10515. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10516. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10519. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10520. } while (0)
  10521. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10522. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10523. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10524. do { \
  10525. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10526. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10527. } while (0)
  10528. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10529. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10530. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10533. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10534. } while (0)
  10535. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10536. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10537. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10538. do { \
  10539. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10540. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10541. } while (0)
  10542. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10543. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10544. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10545. do { \
  10546. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10547. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10548. } while (0)
  10549. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10550. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10551. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10552. do { \
  10553. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10554. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10555. } while (0)
  10556. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10557. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10558. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10559. do { \
  10560. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10561. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10562. } while (0)
  10563. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10564. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10565. /*
  10566. * @brief target -> host rx reorder flush message definition
  10567. *
  10568. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10569. *
  10570. * @details
  10571. * The following field definitions describe the format of the rx flush
  10572. * message sent from the target to the host.
  10573. * The message consists of a 4-octet header, followed by one or more
  10574. * 4-octet payload information elements.
  10575. *
  10576. * |31 24|23 8|7 0|
  10577. * |--------------------------------------------------------------|
  10578. * | TID | peer ID | msg type |
  10579. * |--------------------------------------------------------------|
  10580. * | seq num end | seq num start | MPDU status | reserved |
  10581. * |--------------------------------------------------------------|
  10582. * First DWORD:
  10583. * - MSG_TYPE
  10584. * Bits 7:0
  10585. * Purpose: identifies this as an rx flush message
  10586. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10587. * - PEER_ID
  10588. * Bits 23:8 (only bits 18:8 actually used)
  10589. * Purpose: identify which peer's rx data is being flushed
  10590. * Value: (rx) peer ID
  10591. * - TID
  10592. * Bits 31:24 (only bits 27:24 actually used)
  10593. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10594. * Value: traffic identifier
  10595. * Second DWORD:
  10596. * - MPDU_STATUS
  10597. * Bits 15:8
  10598. * Purpose:
  10599. * Indicate whether the flushed MPDUs should be discarded or processed.
  10600. * Value:
  10601. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10602. * stages of rx processing
  10603. * other: discard the MPDUs
  10604. * It is anticipated that flush messages will always have
  10605. * MPDU status == 1, but the status flag is included for
  10606. * flexibility.
  10607. * - SEQ_NUM_START
  10608. * Bits 23:16
  10609. * Purpose:
  10610. * Indicate the start of a series of consecutive MPDUs being flushed.
  10611. * Not all MPDUs within this range are necessarily valid - the host
  10612. * must check each sequence number within this range to see if the
  10613. * corresponding MPDU is actually present.
  10614. * Value:
  10615. * The sequence number for the first MPDU in the sequence.
  10616. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10617. * - SEQ_NUM_END
  10618. * Bits 30:24
  10619. * Purpose:
  10620. * Indicate the end of a series of consecutive MPDUs being flushed.
  10621. * Value:
  10622. * The sequence number one larger than the sequence number of the
  10623. * last MPDU being flushed.
  10624. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10625. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10626. * are to be released for further rx processing.
  10627. * Not all MPDUs within this range are necessarily valid - the host
  10628. * must check each sequence number within this range to see if the
  10629. * corresponding MPDU is actually present.
  10630. */
  10631. /* first DWORD */
  10632. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10633. #define HTT_RX_FLUSH_PEER_ID_S 8
  10634. #define HTT_RX_FLUSH_TID_M 0xff000000
  10635. #define HTT_RX_FLUSH_TID_S 24
  10636. /* second DWORD */
  10637. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10638. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10639. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10640. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10641. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10642. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10643. #define HTT_RX_FLUSH_BYTES 8
  10644. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10645. do { \
  10646. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10647. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10648. } while (0)
  10649. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10650. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10651. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10652. do { \
  10653. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10654. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10655. } while (0)
  10656. #define HTT_RX_FLUSH_TID_GET(word) \
  10657. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10658. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10659. do { \
  10660. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10661. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10662. } while (0)
  10663. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10664. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10665. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10666. do { \
  10667. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10668. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10669. } while (0)
  10670. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10671. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10672. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10673. do { \
  10674. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10675. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10676. } while (0)
  10677. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10678. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10679. /*
  10680. * @brief target -> host rx pn check indication message
  10681. *
  10682. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10683. *
  10684. * @details
  10685. * The following field definitions describe the format of the Rx PN check
  10686. * indication message sent from the target to the host.
  10687. * The message consists of a 4-octet header, followed by the start and
  10688. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10689. * IE is one octet containing the sequence number that failed the PN
  10690. * check.
  10691. *
  10692. * |31 24|23 8|7 0|
  10693. * |--------------------------------------------------------------|
  10694. * | TID | peer ID | msg type |
  10695. * |--------------------------------------------------------------|
  10696. * | Reserved | PN IE count | seq num end | seq num start|
  10697. * |--------------------------------------------------------------|
  10698. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10699. * |--------------------------------------------------------------|
  10700. * First DWORD:
  10701. * - MSG_TYPE
  10702. * Bits 7:0
  10703. * Purpose: Identifies this as an rx pn check indication message
  10704. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10705. * - PEER_ID
  10706. * Bits 23:8 (only bits 18:8 actually used)
  10707. * Purpose: identify which peer
  10708. * Value: (rx) peer ID
  10709. * - TID
  10710. * Bits 31:24 (only bits 27:24 actually used)
  10711. * Purpose: identify traffic identifier
  10712. * Value: traffic identifier
  10713. * Second DWORD:
  10714. * - SEQ_NUM_START
  10715. * Bits 7:0
  10716. * Purpose:
  10717. * Indicates the starting sequence number of the MPDU in this
  10718. * series of MPDUs that went though PN check.
  10719. * Value:
  10720. * The sequence number for the first MPDU in the sequence.
  10721. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10722. * - SEQ_NUM_END
  10723. * Bits 15:8
  10724. * Purpose:
  10725. * Indicates the ending sequence number of the MPDU in this
  10726. * series of MPDUs that went though PN check.
  10727. * Value:
  10728. * The sequence number one larger then the sequence number of the last
  10729. * MPDU being flushed.
  10730. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10731. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10732. * for invalid PN numbers and are ready to be released for further processing.
  10733. * Not all MPDUs within this range are necessarily valid - the host
  10734. * must check each sequence number within this range to see if the
  10735. * corresponding MPDU is actually present.
  10736. * - PN_IE_COUNT
  10737. * Bits 23:16
  10738. * Purpose:
  10739. * Used to determine the variable number of PN information elements in this
  10740. * message
  10741. *
  10742. * PN information elements:
  10743. * - PN_IE_x-
  10744. * Purpose:
  10745. * Each PN information element contains the sequence number of the MPDU that
  10746. * has failed the target PN check.
  10747. * Value:
  10748. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10749. * that failed the PN check.
  10750. */
  10751. /* first DWORD */
  10752. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10753. #define HTT_RX_PN_IND_PEER_ID_S 8
  10754. #define HTT_RX_PN_IND_TID_M 0xff000000
  10755. #define HTT_RX_PN_IND_TID_S 24
  10756. /* second DWORD */
  10757. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10758. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10759. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10760. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10761. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10762. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10763. #define HTT_RX_PN_IND_BYTES 8
  10764. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10765. do { \
  10766. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10767. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10768. } while (0)
  10769. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10770. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10771. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10772. do { \
  10773. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10774. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10775. } while (0)
  10776. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10777. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10778. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10779. do { \
  10780. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10781. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10782. } while (0)
  10783. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10784. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10785. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10786. do { \
  10787. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10788. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10789. } while (0)
  10790. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10791. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10792. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10795. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10796. } while (0)
  10797. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10798. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10799. /*
  10800. * @brief target -> host rx offload deliver message for LL system
  10801. *
  10802. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10803. *
  10804. * @details
  10805. * In a low latency system this message is sent whenever the offload
  10806. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10807. * The DMA of the actual packets into host memory is done before sending out
  10808. * this message. This message indicates only how many MSDUs to reap. The
  10809. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10810. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10811. * DMA'd by the MAC directly into host memory these packets do not contain
  10812. * the MAC descriptors in the header portion of the packet. Instead they contain
  10813. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10814. * message, the packets are delivered directly to the NW stack without going
  10815. * through the regular reorder buffering and PN checking path since it has
  10816. * already been done in target.
  10817. *
  10818. * |31 24|23 16|15 8|7 0|
  10819. * |-----------------------------------------------------------------------|
  10820. * | Total MSDU count | reserved | msg type |
  10821. * |-----------------------------------------------------------------------|
  10822. *
  10823. * @brief target -> host rx offload deliver message for HL system
  10824. *
  10825. * @details
  10826. * In a high latency system this message is sent whenever the offload manager
  10827. * flushes out the packets it has coalesced in its coalescing buffer. The
  10828. * actual packets are also carried along with this message. When the host
  10829. * receives this message, it is expected to deliver these packets to the NW
  10830. * stack directly instead of routing them through the reorder buffering and
  10831. * PN checking path since it has already been done in target.
  10832. *
  10833. * |31 24|23 16|15 8|7 0|
  10834. * |-----------------------------------------------------------------------|
  10835. * | Total MSDU count | reserved | msg type |
  10836. * |-----------------------------------------------------------------------|
  10837. * | peer ID | MSDU length |
  10838. * |-----------------------------------------------------------------------|
  10839. * | MSDU payload | FW Desc | tid | vdev ID |
  10840. * |-----------------------------------------------------------------------|
  10841. * | MSDU payload contd. |
  10842. * |-----------------------------------------------------------------------|
  10843. * | peer ID | MSDU length |
  10844. * |-----------------------------------------------------------------------|
  10845. * | MSDU payload | FW Desc | tid | vdev ID |
  10846. * |-----------------------------------------------------------------------|
  10847. * | MSDU payload contd. |
  10848. * |-----------------------------------------------------------------------|
  10849. *
  10850. */
  10851. /* first DWORD */
  10852. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10853. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10854. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10855. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10856. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10857. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10858. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10859. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10860. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10861. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10862. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10863. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10864. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10865. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10866. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10867. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10868. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10869. do { \
  10870. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10871. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10872. } while (0)
  10873. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10874. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10875. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10876. do { \
  10877. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10878. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10879. } while (0)
  10880. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10881. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10882. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10883. do { \
  10884. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10885. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10886. } while (0)
  10887. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10888. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10889. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10890. do { \
  10891. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10892. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10893. } while (0)
  10894. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10895. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10896. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10897. do { \
  10898. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10899. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10900. } while (0)
  10901. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10902. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10903. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10904. do { \
  10905. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10906. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10907. } while (0)
  10908. /**
  10909. * @brief target -> host rx peer map/unmap message definition
  10910. *
  10911. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10912. *
  10913. * @details
  10914. * The following diagram shows the format of the rx peer map message sent
  10915. * from the target to the host. This layout assumes the target operates
  10916. * as little-endian.
  10917. *
  10918. * This message always contains a SW peer ID. The main purpose of the
  10919. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10920. * with, so that the host can use that peer ID to determine which peer
  10921. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10922. * other purposes, such as identifying during tx completions which peer
  10923. * the tx frames in question were transmitted to.
  10924. *
  10925. * In certain generations of chips, the peer map message also contains
  10926. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10927. * to identify which peer the frame needs to be forwarded to (i.e. the
  10928. * peer assocated with the Destination MAC Address within the packet),
  10929. * and particularly which vdev needs to transmit the frame (for cases
  10930. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10931. * meaning as AST_INDEX_0.
  10932. * This DA-based peer ID that is provided for certain rx frames
  10933. * (the rx frames that need to be re-transmitted as tx frames)
  10934. * is the ID that the HW uses for referring to the peer in question,
  10935. * rather than the peer ID that the SW+FW use to refer to the peer.
  10936. *
  10937. *
  10938. * |31 24|23 16|15 8|7 0|
  10939. * |-----------------------------------------------------------------------|
  10940. * | SW peer ID | VDEV ID | msg type |
  10941. * |-----------------------------------------------------------------------|
  10942. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10943. * |-----------------------------------------------------------------------|
  10944. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10945. * |-----------------------------------------------------------------------|
  10946. *
  10947. *
  10948. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10949. *
  10950. * The following diagram shows the format of the rx peer unmap message sent
  10951. * from the target to the host.
  10952. *
  10953. * |31 24|23 16|15 8|7 0|
  10954. * |-----------------------------------------------------------------------|
  10955. * | SW peer ID | VDEV ID | msg type |
  10956. * |-----------------------------------------------------------------------|
  10957. *
  10958. * The following field definitions describe the format of the rx peer map
  10959. * and peer unmap messages sent from the target to the host.
  10960. * - MSG_TYPE
  10961. * Bits 7:0
  10962. * Purpose: identifies this as an rx peer map or peer unmap message
  10963. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10964. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10965. * - VDEV_ID
  10966. * Bits 15:8
  10967. * Purpose: Indicates which virtual device the peer is associated
  10968. * with.
  10969. * Value: vdev ID (used in the host to look up the vdev object)
  10970. * - PEER_ID (a.k.a. SW_PEER_ID)
  10971. * Bits 31:16
  10972. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10973. * freeing (unmap)
  10974. * Value: (rx) peer ID
  10975. * - MAC_ADDR_L32 (peer map only)
  10976. * Bits 31:0
  10977. * Purpose: Identifies which peer node the peer ID is for.
  10978. * Value: lower 4 bytes of peer node's MAC address
  10979. * - MAC_ADDR_U16 (peer map only)
  10980. * Bits 15:0
  10981. * Purpose: Identifies which peer node the peer ID is for.
  10982. * Value: upper 2 bytes of peer node's MAC address
  10983. * - HW_PEER_ID
  10984. * Bits 31:16
  10985. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10986. * address, so for rx frames marked for rx --> tx forwarding, the
  10987. * host can determine from the HW peer ID provided as meta-data with
  10988. * the rx frame which peer the frame is supposed to be forwarded to.
  10989. * Value: ID used by the MAC HW to identify the peer
  10990. */
  10991. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10992. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10993. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10994. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10995. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10996. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10997. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10998. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10999. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11000. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11001. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11002. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11003. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11004. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11005. do { \
  11006. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11007. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11008. } while (0)
  11009. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11010. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11011. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11012. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11013. do { \
  11014. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11015. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11016. } while (0)
  11017. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11018. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11019. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11020. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11021. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11022. do { \
  11023. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11024. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11025. } while (0)
  11026. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11027. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11028. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11029. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11030. #define HTT_RX_PEER_MAP_BYTES 12
  11031. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11032. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11033. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11034. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11035. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11036. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11037. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11038. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11039. #define HTT_RX_PEER_UNMAP_BYTES 4
  11040. /**
  11041. * @brief target -> host rx peer map V2 message definition
  11042. *
  11043. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11044. *
  11045. * @details
  11046. * The following diagram shows the format of the rx peer map v2 message sent
  11047. * from the target to the host. This layout assumes the target operates
  11048. * as little-endian.
  11049. *
  11050. * This message always contains a SW peer ID. The main purpose of the
  11051. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11052. * with, so that the host can use that peer ID to determine which peer
  11053. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11054. * other purposes, such as identifying during tx completions which peer
  11055. * the tx frames in question were transmitted to.
  11056. *
  11057. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11058. * is used during rx --> tx frame forwarding to identify which peer the
  11059. * frame needs to be forwarded to (i.e. the peer assocated with the
  11060. * Destination MAC Address within the packet), and particularly which vdev
  11061. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11062. * This DA-based peer ID that is provided for certain rx frames
  11063. * (the rx frames that need to be re-transmitted as tx frames)
  11064. * is the ID that the HW uses for referring to the peer in question,
  11065. * rather than the peer ID that the SW+FW use to refer to the peer.
  11066. *
  11067. * The HW peer id here is the same meaning as AST_INDEX_0.
  11068. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11069. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11070. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11071. * AST is valid.
  11072. *
  11073. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11074. * |-------------------------------------------------------------------------|
  11075. * | SW peer ID | VDEV ID | msg type |
  11076. * |-------------------------------------------------------------------------|
  11077. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11078. * |-------------------------------------------------------------------------|
  11079. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11080. * |-------------------------------------------------------------------------|
  11081. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11082. * |-------------------------------------------------------------------------|
  11083. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11084. * |-------------------------------------------------------------------------|
  11085. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11086. * |-------------------------------------------------------------------------|
  11087. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11088. * |-------------------------------------------------------------------------|
  11089. * | Reserved_2 |
  11090. * |-------------------------------------------------------------------------|
  11091. * Where:
  11092. * NH = Next Hop
  11093. * ASTVM = AST valid mask
  11094. * OA = on-chip AST valid bit
  11095. * ASTFM = AST flow mask
  11096. *
  11097. * The following field definitions describe the format of the rx peer map v2
  11098. * messages sent from the target to the host.
  11099. * - MSG_TYPE
  11100. * Bits 7:0
  11101. * Purpose: identifies this as an rx peer map v2 message
  11102. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11103. * - VDEV_ID
  11104. * Bits 15:8
  11105. * Purpose: Indicates which virtual device the peer is associated with.
  11106. * Value: vdev ID (used in the host to look up the vdev object)
  11107. * - SW_PEER_ID
  11108. * Bits 31:16
  11109. * Purpose: The peer ID (index) that WAL is allocating
  11110. * Value: (rx) peer ID
  11111. * - MAC_ADDR_L32
  11112. * Bits 31:0
  11113. * Purpose: Identifies which peer node the peer ID is for.
  11114. * Value: lower 4 bytes of peer node's MAC address
  11115. * - MAC_ADDR_U16
  11116. * Bits 15:0
  11117. * Purpose: Identifies which peer node the peer ID is for.
  11118. * Value: upper 2 bytes of peer node's MAC address
  11119. * - HW_PEER_ID / AST_INDEX_0
  11120. * Bits 31:16
  11121. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11122. * address, so for rx frames marked for rx --> tx forwarding, the
  11123. * host can determine from the HW peer ID provided as meta-data with
  11124. * the rx frame which peer the frame is supposed to be forwarded to.
  11125. * Value: ID used by the MAC HW to identify the peer
  11126. * - AST_HASH_VALUE
  11127. * Bits 15:0
  11128. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11129. * override feature.
  11130. * - NEXT_HOP
  11131. * Bit 16
  11132. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11133. * (Wireless Distribution System).
  11134. * - AST_VALID_MASK
  11135. * Bits 19:17
  11136. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11137. * - ONCHIP_AST_VALID_FLAG
  11138. * Bit 20
  11139. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11140. * is valid.
  11141. * - AST_INDEX_1
  11142. * Bits 15:0
  11143. * Purpose: indicate the second AST index for this peer
  11144. * - AST_0_FLOW_MASK
  11145. * Bits 19:16
  11146. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11147. * - AST_1_FLOW_MASK
  11148. * Bits 23:20
  11149. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11150. * - AST_2_FLOW_MASK
  11151. * Bits 27:24
  11152. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11153. * - AST_3_FLOW_MASK
  11154. * Bits 31:28
  11155. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11156. * - AST_INDEX_2
  11157. * Bits 15:0
  11158. * Purpose: indicate the third AST index for this peer
  11159. * - TID_VALID_HI_PRI
  11160. * Bits 23:16
  11161. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11162. * - TID_VALID_LOW_PRI
  11163. * Bits 31:24
  11164. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11165. * - AST_INDEX_3
  11166. * Bits 15:0
  11167. * Purpose: indicate the fourth AST index for this peer
  11168. * - ONCHIP_AST_IDX / RESERVED
  11169. * Bits 31:16
  11170. * Purpose: This field is valid only when split AST feature is enabled.
  11171. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11172. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11173. * address, this ast_idx is used for LMAC modules for RXPCU.
  11174. * Value: ID used by the LMAC HW to identify the peer
  11175. */
  11176. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11177. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11178. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11179. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11180. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11181. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11182. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11183. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11184. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11185. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11186. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11187. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11188. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11189. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11190. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11191. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11192. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11193. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11194. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11195. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11196. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11197. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11198. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11199. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11200. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11201. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11202. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11203. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11204. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11205. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11206. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11207. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11208. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11209. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11210. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11211. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11212. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11213. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11214. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11215. do { \
  11216. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11217. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11218. } while (0)
  11219. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11220. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11221. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11222. do { \
  11223. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11224. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11225. } while (0)
  11226. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11227. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11228. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11229. do { \
  11230. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11231. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11232. } while (0)
  11233. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11234. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11235. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11236. do { \
  11237. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11238. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11239. } while (0)
  11240. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11241. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11242. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11243. do { \
  11244. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11245. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11246. } while (0)
  11247. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11248. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11249. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11250. do { \
  11251. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11252. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11253. } while (0)
  11254. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11255. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11256. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11257. do { \
  11258. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11259. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11260. } while (0)
  11261. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11262. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11263. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11264. do { \
  11265. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11266. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11267. } while (0)
  11268. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11269. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11270. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11271. do { \
  11272. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11273. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11274. } while (0)
  11275. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11276. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11277. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11278. do { \
  11279. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11280. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11281. } while (0)
  11282. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11283. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11284. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11285. do { \
  11286. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11287. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11288. } while (0)
  11289. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11290. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11291. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11292. do { \
  11293. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11294. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11295. } while (0)
  11296. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11297. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11298. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11299. do { \
  11300. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11301. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11302. } while (0)
  11303. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11304. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11305. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11306. do { \
  11307. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11308. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11309. } while (0)
  11310. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11311. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11312. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11313. do { \
  11314. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11315. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11316. } while (0)
  11317. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11318. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11319. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11320. do { \
  11321. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11322. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11323. } while (0)
  11324. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11325. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11326. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11327. do { \
  11328. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11329. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11330. } while (0)
  11331. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11332. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11333. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11334. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11335. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11336. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11337. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11338. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11339. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11340. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11341. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11342. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11343. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11344. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11345. /**
  11346. * @brief target -> host rx peer map V3 message definition
  11347. *
  11348. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11349. *
  11350. * @details
  11351. * The following diagram shows the format of the rx peer map v3 message sent
  11352. * from the target to the host.
  11353. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11354. * This layout assumes the target operates as little-endian.
  11355. *
  11356. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11357. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11358. * | SW peer ID | VDEV ID | msg type |
  11359. * |-----------------+--------------------+-----------------+-----------------|
  11360. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11361. * |-----------------+--------------------+-----------------+-----------------|
  11362. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11363. * |-----------------+--------+-----------+-----------------+-----------------|
  11364. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11365. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11366. * | (8bits) | | (4bits) | |
  11367. * |-----------------+--------+--+--+--+--------------------------------------|
  11368. * | RESERVED |E |O | | |
  11369. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11370. * | |V |V | | |
  11371. * |-----------------+--------------------+-----------------------------------|
  11372. * | HTT_MSDU_IDX_ | RESERVED | |
  11373. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11374. * | (8bits) | | |
  11375. * |-----------------+--------------------+-----------------------------------|
  11376. * | Reserved_2 |
  11377. * |--------------------------------------------------------------------------|
  11378. * | Reserved_3 |
  11379. * |--------------------------------------------------------------------------|
  11380. *
  11381. * Where:
  11382. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11383. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11384. * NH = Next Hop
  11385. * The following field definitions describe the format of the rx peer map v3
  11386. * messages sent from the target to the host.
  11387. * - MSG_TYPE
  11388. * Bits 7:0
  11389. * Purpose: identifies this as a peer map v3 message
  11390. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11391. * - VDEV_ID
  11392. * Bits 15:8
  11393. * Purpose: Indicates which virtual device the peer is associated with.
  11394. * - SW_PEER_ID
  11395. * Bits 31:16
  11396. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11397. * - MAC_ADDR_L32
  11398. * Bits 31:0
  11399. * Purpose: Identifies which peer node the peer ID is for.
  11400. * Value: lower 4 bytes of peer node's MAC address
  11401. * - MAC_ADDR_U16
  11402. * Bits 15:0
  11403. * Purpose: Identifies which peer node the peer ID is for.
  11404. * Value: upper 2 bytes of peer node's MAC address
  11405. * - MULTICAST_SW_PEER_ID
  11406. * Bits 31:16
  11407. * Purpose: The multicast peer ID (index)
  11408. * Value: set to HTT_INVALID_PEER if not valid
  11409. * - HW_PEER_ID / AST_INDEX
  11410. * Bits 15:0
  11411. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11412. * address, so for rx frames marked for rx --> tx forwarding, the
  11413. * host can determine from the HW peer ID provided as meta-data with
  11414. * the rx frame which peer the frame is supposed to be forwarded to.
  11415. * - CACHE_SET_NUM
  11416. * Bits 19:16
  11417. * Purpose: Cache Set Number for AST_INDEX
  11418. * Cache set number that should be used to cache the index based
  11419. * search results, for address and flow search.
  11420. * This value should be equal to LSB 4 bits of the hash value
  11421. * of match data, in case of search index points to an entry which
  11422. * may be used in content based search also. The value can be
  11423. * anything when the entry pointed by search index will not be
  11424. * used for content based search.
  11425. * - HTT_MSDU_IDX_VALID_MASK
  11426. * Bits 31:24
  11427. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11428. * - ONCHIP_AST_IDX / RESERVED
  11429. * Bits 15:0
  11430. * Purpose: This field is valid only when split AST feature is enabled.
  11431. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11432. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11433. * address, this ast_idx is used for LMAC modules for RXPCU.
  11434. * - NEXT_HOP
  11435. * Bits 16
  11436. * Purpose: Flag indicates next_hop AST entry used for WDS
  11437. * (Wireless Distribution System).
  11438. * - ONCHIP_AST_VALID
  11439. * Bits 17
  11440. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11441. * - EXT_AST_VALID
  11442. * Bits 18
  11443. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11444. * - EXT_AST_INDEX
  11445. * Bits 15:0
  11446. * Purpose: This field describes Extended AST index
  11447. * Valid if EXT_AST_VALID flag set
  11448. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11449. * Bits 31:24
  11450. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11451. */
  11452. /* dword 0 */
  11453. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11454. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11455. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11456. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11457. /* dword 1 */
  11458. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11459. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11460. /* dword 2 */
  11461. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11462. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11463. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11464. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11465. /* dword 3 */
  11466. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11467. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11468. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11469. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11470. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11471. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11472. /* dword 4 */
  11473. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11474. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11475. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11476. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11477. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11478. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11479. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11480. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11481. /* dword 5 */
  11482. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11483. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11484. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11485. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11486. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11487. do { \
  11488. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11489. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11490. } while (0)
  11491. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11492. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11493. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11494. do { \
  11495. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11496. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11497. } while (0)
  11498. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11499. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11500. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11501. do { \
  11502. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11503. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11504. } while (0)
  11505. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11506. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11507. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11508. do { \
  11509. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11510. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11511. } while (0)
  11512. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11513. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11514. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11515. do { \
  11516. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11517. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11518. } while (0)
  11519. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11520. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11521. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11522. do { \
  11523. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11524. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11525. } while (0)
  11526. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11527. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11528. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11529. do { \
  11530. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11531. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11532. } while (0)
  11533. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11534. (((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)
  11535. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11536. do { \
  11537. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11538. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11539. } while (0)
  11540. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11541. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11542. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11543. do { \
  11544. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11545. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11546. } while (0)
  11547. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11548. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11549. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11550. do { \
  11551. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11552. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11553. } while (0)
  11554. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11555. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11556. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11557. do { \
  11558. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11559. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11560. } while (0)
  11561. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11562. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11563. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11564. do { \
  11565. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11566. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11567. } while (0)
  11568. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11569. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11570. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11571. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11572. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11573. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11574. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11575. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11576. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11577. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11578. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11579. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11580. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11581. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11582. /**
  11583. * @brief target -> host rx peer unmap V2 message definition
  11584. *
  11585. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11586. *
  11587. * The following diagram shows the format of the rx peer unmap message sent
  11588. * from the target to the host.
  11589. *
  11590. * |31 24|23 16|15 8|7 0|
  11591. * |-----------------------------------------------------------------------|
  11592. * | SW peer ID | VDEV ID | msg type |
  11593. * |-----------------------------------------------------------------------|
  11594. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11595. * |-----------------------------------------------------------------------|
  11596. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11597. * |-----------------------------------------------------------------------|
  11598. * | Peer Delete Duration |
  11599. * |-----------------------------------------------------------------------|
  11600. * | Reserved_0 | WDS Free Count |
  11601. * |-----------------------------------------------------------------------|
  11602. * | Reserved_1 |
  11603. * |-----------------------------------------------------------------------|
  11604. * | Reserved_2 |
  11605. * |-----------------------------------------------------------------------|
  11606. *
  11607. *
  11608. * The following field definitions describe the format of the rx peer unmap
  11609. * messages sent from the target to the host.
  11610. * - MSG_TYPE
  11611. * Bits 7:0
  11612. * Purpose: identifies this as an rx peer unmap v2 message
  11613. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11614. * - VDEV_ID
  11615. * Bits 15:8
  11616. * Purpose: Indicates which virtual device the peer is associated
  11617. * with.
  11618. * Value: vdev ID (used in the host to look up the vdev object)
  11619. * - SW_PEER_ID
  11620. * Bits 31:16
  11621. * Purpose: The peer ID (index) that WAL is freeing
  11622. * Value: (rx) peer ID
  11623. * - MAC_ADDR_L32
  11624. * Bits 31:0
  11625. * Purpose: Identifies which peer node the peer ID is for.
  11626. * Value: lower 4 bytes of peer node's MAC address
  11627. * - MAC_ADDR_U16
  11628. * Bits 15:0
  11629. * Purpose: Identifies which peer node the peer ID is for.
  11630. * Value: upper 2 bytes of peer node's MAC address
  11631. * - NEXT_HOP
  11632. * Bits 16
  11633. * Purpose: Bit indicates next_hop AST entry used for WDS
  11634. * (Wireless Distribution System).
  11635. * - PEER_DELETE_DURATION
  11636. * Bits 31:0
  11637. * Purpose: Time taken to delete peer, in msec,
  11638. * Used for monitoring / debugging PEER delete response delay
  11639. * - PEER_WDS_FREE_COUNT
  11640. * Bits 15:0
  11641. * Purpose: Count of WDS entries deleted associated to peer deleted
  11642. */
  11643. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11644. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11645. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11646. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11647. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11648. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11649. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11650. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11651. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11652. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11653. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11654. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11655. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11656. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11657. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11658. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11659. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11660. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11661. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11662. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11663. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11664. do { \
  11665. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11666. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11667. } while (0)
  11668. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11669. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11670. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11671. do { \
  11672. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11673. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11674. } while (0)
  11675. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11676. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11677. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11678. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11679. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11680. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11681. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11682. /**
  11683. * @brief target -> host rx peer mlo map message definition
  11684. *
  11685. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11686. *
  11687. * @details
  11688. * The following diagram shows the format of the rx mlo peer map message sent
  11689. * from the target to the host. This layout assumes the target operates
  11690. * as little-endian.
  11691. *
  11692. * MCC:
  11693. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11694. *
  11695. * WIN:
  11696. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11697. * It will be sent on the Assoc Link.
  11698. *
  11699. * This message always contains a MLO peer ID. The main purpose of the
  11700. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11701. * with, so that the host can use that MLO peer ID to determine which peer
  11702. * transmitted the rx frame.
  11703. *
  11704. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11705. * |-------------------------------------------------------------------------|
  11706. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11707. * |-------------------------------------------------------------------------|
  11708. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11709. * |-------------------------------------------------------------------------|
  11710. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11711. * |-------------------------------------------------------------------------|
  11712. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11713. * |-------------------------------------------------------------------------|
  11714. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11715. * |-------------------------------------------------------------------------|
  11716. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11717. * |-------------------------------------------------------------------------|
  11718. * |RSVD |
  11719. * |-------------------------------------------------------------------------|
  11720. * |RSVD |
  11721. * |-------------------------------------------------------------------------|
  11722. * | htt_tlv_hdr_t |
  11723. * |-------------------------------------------------------------------------|
  11724. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11725. * |-------------------------------------------------------------------------|
  11726. * | htt_tlv_hdr_t |
  11727. * |-------------------------------------------------------------------------|
  11728. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11729. * |-------------------------------------------------------------------------|
  11730. * | htt_tlv_hdr_t |
  11731. * |-------------------------------------------------------------------------|
  11732. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11733. * |-------------------------------------------------------------------------|
  11734. *
  11735. * Where:
  11736. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11737. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11738. * V (valid) - 1 Bit Bit17
  11739. * CHIPID - 3 Bits
  11740. * TIDMASK - 8 Bits
  11741. * CACHE_SET_NUM - 8 Bits
  11742. *
  11743. * The following field definitions describe the format of the rx MLO peer map
  11744. * messages sent from the target to the host.
  11745. * - MSG_TYPE
  11746. * Bits 7:0
  11747. * Purpose: identifies this as an rx mlo peer map message
  11748. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11749. *
  11750. * - MLO_PEER_ID
  11751. * Bits 23:8
  11752. * Purpose: The MLO peer ID (index).
  11753. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11754. * Value: MLO peer ID
  11755. *
  11756. * - NUMLINK
  11757. * Bits: 26:24 (3Bits)
  11758. * Purpose: Indicate the max number of logical links supported per client.
  11759. * Value: number of logical links
  11760. *
  11761. * - PRC
  11762. * Bits: 29:27 (3Bits)
  11763. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11764. * if there is migration of the primary chip.
  11765. * Value: Primary REO CHIPID
  11766. *
  11767. * - MAC_ADDR_L32
  11768. * Bits 31:0
  11769. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11770. * Value: lower 4 bytes of peer node's MAC address
  11771. *
  11772. * - MAC_ADDR_U16
  11773. * Bits 15:0
  11774. * Purpose: Identifies which peer node the peer ID is for.
  11775. * Value: upper 2 bytes of peer node's MAC address
  11776. *
  11777. * - PRIMARY_TCL_AST_IDX
  11778. * Bits 15:0
  11779. * Purpose: Primary TCL AST index for this peer.
  11780. *
  11781. * - V
  11782. * 1 Bit Position 16
  11783. * Purpose: If the ast idx is valid.
  11784. *
  11785. * - CHIPID
  11786. * Bits 19:17
  11787. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11788. *
  11789. * - TIDMASK
  11790. * Bits 27:20
  11791. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11792. *
  11793. * - CACHE_SET_NUM
  11794. * Bits 31:28
  11795. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11796. * Cache set number that should be used to cache the index based
  11797. * search results, for address and flow search.
  11798. * This value should be equal to LSB four bits of the hash value
  11799. * of match data, in case of search index points to an entry which
  11800. * may be used in content based search also. The value can be
  11801. * anything when the entry pointed by search index will not be
  11802. * used for content based search.
  11803. *
  11804. * - htt_tlv_hdr_t
  11805. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11806. *
  11807. * Bits 11:0
  11808. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11809. *
  11810. * Bits 23:12
  11811. * Purpose: Length, Length of the value that follows the header
  11812. *
  11813. * Bits 31:28
  11814. * Purpose: Reserved.
  11815. *
  11816. *
  11817. * - SW_PEER_ID
  11818. * Bits 15:0
  11819. * Purpose: The peer ID (index) that WAL is allocating
  11820. * Value: (rx) peer ID
  11821. *
  11822. * - VDEV_ID
  11823. * Bits 23:16
  11824. * Purpose: Indicates which virtual device the peer is associated with.
  11825. * Value: vdev ID (used in the host to look up the vdev object)
  11826. *
  11827. * - CHIPID
  11828. * Bits 26:24
  11829. * Purpose: Indicates which Chip id the peer is associated with.
  11830. * Value: chip ID (Provided by Host as part of QMI exchange)
  11831. */
  11832. typedef enum {
  11833. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11834. } MLO_PEER_MAP_TLV_TAG_ID;
  11835. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11836. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11837. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11838. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11839. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11840. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11841. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11842. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11843. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11844. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11845. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11846. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11847. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11848. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11849. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11850. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11851. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11852. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11853. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11854. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11855. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11856. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11857. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11858. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11859. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11860. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11861. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11862. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11863. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11864. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11865. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11866. do { \
  11867. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11868. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11869. } while (0)
  11870. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11871. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11872. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11873. do { \
  11874. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11875. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11876. } while (0)
  11877. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11878. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11879. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11880. do { \
  11881. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11882. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11883. } while (0)
  11884. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11885. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11886. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11887. do { \
  11888. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11889. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11890. } while (0)
  11891. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11892. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11893. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11894. do { \
  11895. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11896. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11897. } while (0)
  11898. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11899. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11900. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11901. do { \
  11902. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11903. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11904. } while (0)
  11905. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11906. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11907. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11908. do { \
  11909. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11910. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11911. } while (0)
  11912. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11913. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11914. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11915. do { \
  11916. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11917. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11918. } while (0)
  11919. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11920. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11921. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11922. do { \
  11923. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11924. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11925. } while (0)
  11926. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11927. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11928. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11929. do { \
  11930. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11931. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11932. } while (0)
  11933. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11934. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11935. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11936. do { \
  11937. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11938. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11939. } while (0)
  11940. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11941. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11942. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11943. do { \
  11944. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11945. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11946. } while (0)
  11947. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11948. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11949. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11950. do { \
  11951. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11952. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11953. } while (0)
  11954. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11955. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11956. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11957. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11958. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11959. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11960. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11961. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11962. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11963. *
  11964. * The following diagram shows the format of the rx mlo peer unmap message sent
  11965. * from the target to the host.
  11966. *
  11967. * |31 24|23 16|15 8|7 0|
  11968. * |-----------------------------------------------------------------------|
  11969. * | RSVD_24_31 | MLO peer ID | msg type |
  11970. * |-----------------------------------------------------------------------|
  11971. */
  11972. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11973. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11974. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11975. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11976. /**
  11977. * @brief target -> host message specifying security parameters
  11978. *
  11979. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11980. *
  11981. * @details
  11982. * The following diagram shows the format of the security specification
  11983. * message sent from the target to the host.
  11984. * This security specification message tells the host whether a PN check is
  11985. * necessary on rx data frames, and if so, how large the PN counter is.
  11986. * This message also tells the host about the security processing to apply
  11987. * to defragmented rx frames - specifically, whether a Message Integrity
  11988. * Check is required, and the Michael key to use.
  11989. *
  11990. * |31 24|23 16|15|14 8|7 0|
  11991. * |-----------------------------------------------------------------------|
  11992. * | peer ID | U| security type | msg type |
  11993. * |-----------------------------------------------------------------------|
  11994. * | Michael Key K0 |
  11995. * |-----------------------------------------------------------------------|
  11996. * | Michael Key K1 |
  11997. * |-----------------------------------------------------------------------|
  11998. * | WAPI RSC Low0 |
  11999. * |-----------------------------------------------------------------------|
  12000. * | WAPI RSC Low1 |
  12001. * |-----------------------------------------------------------------------|
  12002. * | WAPI RSC Hi0 |
  12003. * |-----------------------------------------------------------------------|
  12004. * | WAPI RSC Hi1 |
  12005. * |-----------------------------------------------------------------------|
  12006. *
  12007. * The following field definitions describe the format of the security
  12008. * indication message sent from the target to the host.
  12009. * - MSG_TYPE
  12010. * Bits 7:0
  12011. * Purpose: identifies this as a security specification message
  12012. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12013. * - SEC_TYPE
  12014. * Bits 14:8
  12015. * Purpose: specifies which type of security applies to the peer
  12016. * Value: htt_sec_type enum value
  12017. * - UNICAST
  12018. * Bit 15
  12019. * Purpose: whether this security is applied to unicast or multicast data
  12020. * Value: 1 -> unicast, 0 -> multicast
  12021. * - PEER_ID
  12022. * Bits 31:16
  12023. * Purpose: The ID number for the peer the security specification is for
  12024. * Value: peer ID
  12025. * - MICHAEL_KEY_K0
  12026. * Bits 31:0
  12027. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12028. * Value: Michael Key K0 (if security type is TKIP)
  12029. * - MICHAEL_KEY_K1
  12030. * Bits 31:0
  12031. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12032. * Value: Michael Key K1 (if security type is TKIP)
  12033. * - WAPI_RSC_LOW0
  12034. * Bits 31:0
  12035. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12036. * Value: WAPI RSC Low0 (if security type is WAPI)
  12037. * - WAPI_RSC_LOW1
  12038. * Bits 31:0
  12039. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12040. * Value: WAPI RSC Low1 (if security type is WAPI)
  12041. * - WAPI_RSC_HI0
  12042. * Bits 31:0
  12043. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12044. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12045. * - WAPI_RSC_HI1
  12046. * Bits 31:0
  12047. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12048. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12049. */
  12050. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12051. #define HTT_SEC_IND_SEC_TYPE_S 8
  12052. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12053. #define HTT_SEC_IND_UNICAST_S 15
  12054. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12055. #define HTT_SEC_IND_PEER_ID_S 16
  12056. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12057. do { \
  12058. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12059. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12060. } while (0)
  12061. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12062. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12063. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12064. do { \
  12065. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12066. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12067. } while (0)
  12068. #define HTT_SEC_IND_UNICAST_GET(word) \
  12069. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12070. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12071. do { \
  12072. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12073. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12074. } while (0)
  12075. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12076. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12077. #define HTT_SEC_IND_BYTES 28
  12078. /**
  12079. * @brief target -> host rx ADDBA / DELBA message definitions
  12080. *
  12081. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12082. *
  12083. * @details
  12084. * The following diagram shows the format of the rx ADDBA message sent
  12085. * from the target to the host:
  12086. *
  12087. * |31 20|19 16|15 8|7 0|
  12088. * |---------------------------------------------------------------------|
  12089. * | peer ID | TID | window size | msg type |
  12090. * |---------------------------------------------------------------------|
  12091. *
  12092. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12093. *
  12094. * The following diagram shows the format of the rx DELBA message sent
  12095. * from the target to the host:
  12096. *
  12097. * |31 20|19 16|15 10|9 8|7 0|
  12098. * |---------------------------------------------------------------------|
  12099. * | peer ID | TID | window size | IR| msg type |
  12100. * |---------------------------------------------------------------------|
  12101. *
  12102. * The following field definitions describe the format of the rx ADDBA
  12103. * and DELBA messages sent from the target to the host.
  12104. * - MSG_TYPE
  12105. * Bits 7:0
  12106. * Purpose: identifies this as an rx ADDBA or DELBA message
  12107. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12108. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12109. * - IR (initiator / recipient)
  12110. * Bits 9:8 (DELBA only)
  12111. * Purpose: specify whether the DELBA handshake was initiated by the
  12112. * local STA/AP, or by the peer STA/AP
  12113. * Value:
  12114. * 0 - unspecified
  12115. * 1 - initiator (a.k.a. originator)
  12116. * 2 - recipient (a.k.a. responder)
  12117. * 3 - unused / reserved
  12118. * - WIN_SIZE
  12119. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12120. * Purpose: Specifies the length of the block ack window (max = 64).
  12121. * Value:
  12122. * block ack window length specified by the received ADDBA/DELBA
  12123. * management message.
  12124. * - TID
  12125. * Bits 19:16
  12126. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12127. * Value:
  12128. * TID specified by the received ADDBA or DELBA management message.
  12129. * - PEER_ID
  12130. * Bits 31:20
  12131. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12132. * Value:
  12133. * ID (hash value) used by the host for fast, direct lookup of
  12134. * host SW peer info, including rx reorder states.
  12135. */
  12136. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12137. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12138. #define HTT_RX_ADDBA_TID_M 0xf0000
  12139. #define HTT_RX_ADDBA_TID_S 16
  12140. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12141. #define HTT_RX_ADDBA_PEER_ID_S 20
  12142. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12143. do { \
  12144. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12145. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12146. } while (0)
  12147. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12148. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12149. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12150. do { \
  12151. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12152. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12153. } while (0)
  12154. #define HTT_RX_ADDBA_TID_GET(word) \
  12155. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12156. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12157. do { \
  12158. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12159. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12160. } while (0)
  12161. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12162. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12163. #define HTT_RX_ADDBA_BYTES 4
  12164. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12165. #define HTT_RX_DELBA_INITIATOR_S 8
  12166. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12167. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12168. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12169. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12170. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12171. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12172. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12173. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12174. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12175. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12176. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12177. do { \
  12178. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12179. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12180. } while (0)
  12181. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12182. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12183. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12184. do { \
  12185. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12186. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12187. } while (0)
  12188. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12189. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12190. #define HTT_RX_DELBA_BYTES 4
  12191. /**
  12192. * @brief target -> host rx ADDBA / DELBA message definitions
  12193. *
  12194. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12195. *
  12196. * @details
  12197. * The following diagram shows the format of the rx ADDBA extn message sent
  12198. * from the target to the host:
  12199. *
  12200. * |31 20|19 16|15 13|12 8|7 0|
  12201. * |---------------------------------------------------------------------|
  12202. * | peer ID | TID | reserved | msg type |
  12203. * |---------------------------------------------------------------------|
  12204. * | reserved | window size |
  12205. * |---------------------------------------------------------------------|
  12206. *
  12207. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12208. *
  12209. * The following diagram shows the format of the rx DELBA message sent
  12210. * from the target to the host:
  12211. *
  12212. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12213. * |---------------------------------------------------------------------|
  12214. * | peer ID | TID | reserved | IR| msg type |
  12215. * |---------------------------------------------------------------------|
  12216. * | reserved | window size |
  12217. * |---------------------------------------------------------------------|
  12218. *
  12219. * The following field definitions describe the format of the rx ADDBA
  12220. * and DELBA messages sent from the target to the host.
  12221. * - MSG_TYPE
  12222. * Bits 7:0
  12223. * Purpose: identifies this as an rx ADDBA or DELBA message
  12224. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12225. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12226. * - IR (initiator / recipient)
  12227. * Bits 9:8 (DELBA only)
  12228. * Purpose: specify whether the DELBA handshake was initiated by the
  12229. * local STA/AP, or by the peer STA/AP
  12230. * Value:
  12231. * 0 - unspecified
  12232. * 1 - initiator (a.k.a. originator)
  12233. * 2 - recipient (a.k.a. responder)
  12234. * 3 - unused / reserved
  12235. * Value:
  12236. * block ack window length specified by the received ADDBA/DELBA
  12237. * management message.
  12238. * - TID
  12239. * Bits 19:16
  12240. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12241. * Value:
  12242. * TID specified by the received ADDBA or DELBA management message.
  12243. * - PEER_ID
  12244. * Bits 31:20
  12245. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12246. * Value:
  12247. * ID (hash value) used by the host for fast, direct lookup of
  12248. * host SW peer info, including rx reorder states.
  12249. * == DWORD 1
  12250. * - WIN_SIZE
  12251. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12252. * Purpose: Specifies the length of the block ack window (max = 8191).
  12253. */
  12254. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12255. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12256. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12257. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12258. /*--- Dword 0 ---*/
  12259. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12260. do { \
  12261. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12262. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12263. } while (0)
  12264. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12265. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12266. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12267. do { \
  12268. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12269. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12270. } while (0)
  12271. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12272. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12273. /*--- Dword 1 ---*/
  12274. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12275. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12276. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12277. do { \
  12278. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12279. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12280. } while (0)
  12281. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12282. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12283. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12284. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12285. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12286. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12287. #define HTT_RX_DELBA_EXTN_TID_S 16
  12288. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12289. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12290. /*--- Dword 0 ---*/
  12291. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12292. do { \
  12293. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12294. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12295. } while (0)
  12296. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12297. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12298. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12299. do { \
  12300. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12301. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12302. } while (0)
  12303. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12304. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12305. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12306. do { \
  12307. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12308. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12309. } while (0)
  12310. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12311. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12312. /*--- Dword 1 ---*/
  12313. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12314. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12315. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12316. do { \
  12317. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12318. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12319. } while (0)
  12320. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12321. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12322. #define HTT_RX_DELBA_EXTN_BYTES 8
  12323. /**
  12324. * @brief tx queue group information element definition
  12325. *
  12326. * @details
  12327. * The following diagram shows the format of the tx queue group
  12328. * information element, which can be included in target --> host
  12329. * messages to specify the number of tx "credits" (tx descriptors
  12330. * for LL, or tx buffers for HL) available to a particular group
  12331. * of host-side tx queues, and which host-side tx queues belong to
  12332. * the group.
  12333. *
  12334. * |31|30 24|23 16|15|14|13 0|
  12335. * |------------------------------------------------------------------------|
  12336. * | X| reserved | tx queue grp ID | A| S| credit count |
  12337. * |------------------------------------------------------------------------|
  12338. * | vdev ID mask | AC mask |
  12339. * |------------------------------------------------------------------------|
  12340. *
  12341. * The following definitions describe the fields within the tx queue group
  12342. * information element:
  12343. * - credit_count
  12344. * Bits 13:1
  12345. * Purpose: specify how many tx credits are available to the tx queue group
  12346. * Value: An absolute or relative, positive or negative credit value
  12347. * The 'A' bit specifies whether the value is absolute or relative.
  12348. * The 'S' bit specifies whether the value is positive or negative.
  12349. * A negative value can only be relative, not absolute.
  12350. * An absolute value replaces any prior credit value the host has for
  12351. * the tx queue group in question.
  12352. * A relative value is added to the prior credit value the host has for
  12353. * the tx queue group in question.
  12354. * - sign
  12355. * Bit 14
  12356. * Purpose: specify whether the credit count is positive or negative
  12357. * Value: 0 -> positive, 1 -> negative
  12358. * - absolute
  12359. * Bit 15
  12360. * Purpose: specify whether the credit count is absolute or relative
  12361. * Value: 0 -> relative, 1 -> absolute
  12362. * - txq_group_id
  12363. * Bits 23:16
  12364. * Purpose: indicate which tx queue group's credit and/or membership are
  12365. * being specified
  12366. * Value: 0 to max_tx_queue_groups-1
  12367. * - reserved
  12368. * Bits 30:16
  12369. * Value: 0x0
  12370. * - eXtension
  12371. * Bit 31
  12372. * Purpose: specify whether another tx queue group info element follows
  12373. * Value: 0 -> no more tx queue group information elements
  12374. * 1 -> another tx queue group information element immediately follows
  12375. * - ac_mask
  12376. * Bits 15:0
  12377. * Purpose: specify which Access Categories belong to the tx queue group
  12378. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12379. * the tx queue group.
  12380. * The AC bit-mask values are obtained by left-shifting by the
  12381. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12382. * - vdev_id_mask
  12383. * Bits 31:16
  12384. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12385. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12386. * belong to the tx queue group.
  12387. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12388. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12389. */
  12390. PREPACK struct htt_txq_group {
  12391. A_UINT32
  12392. credit_count: 14,
  12393. sign: 1,
  12394. absolute: 1,
  12395. tx_queue_group_id: 8,
  12396. reserved0: 7,
  12397. extension: 1;
  12398. A_UINT32
  12399. ac_mask: 16,
  12400. vdev_id_mask: 16;
  12401. } POSTPACK;
  12402. /* first word */
  12403. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12404. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12405. #define HTT_TXQ_GROUP_SIGN_S 14
  12406. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12407. #define HTT_TXQ_GROUP_ABS_S 15
  12408. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12409. #define HTT_TXQ_GROUP_ID_S 16
  12410. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12411. #define HTT_TXQ_GROUP_EXT_S 31
  12412. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12413. /* second word */
  12414. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12415. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12416. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12417. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12418. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12419. do { \
  12420. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12421. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12422. } while (0)
  12423. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12424. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12425. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12426. do { \
  12427. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12428. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12429. } while (0)
  12430. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12431. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12432. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12433. do { \
  12434. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12435. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12436. } while (0)
  12437. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12438. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12439. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12440. do { \
  12441. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12442. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12443. } while (0)
  12444. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12445. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12446. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12447. do { \
  12448. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12449. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12450. } while (0)
  12451. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12452. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12453. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12454. do { \
  12455. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12456. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12457. } while (0)
  12458. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12459. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12460. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12461. do { \
  12462. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12463. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12464. } while (0)
  12465. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12466. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12467. /**
  12468. * @brief target -> host TX completion indication message definition
  12469. *
  12470. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12471. *
  12472. * @details
  12473. * The following diagram shows the format of the TX completion indication sent
  12474. * from the target to the host
  12475. *
  12476. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12477. * |-------------------------------------------------------------------|
  12478. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12479. * |-------------------------------------------------------------------|
  12480. * payload:| MSDU1 ID | MSDU0 ID |
  12481. * |-------------------------------------------------------------------|
  12482. * : MSDU3 ID | MSDU2 ID :
  12483. * |-------------------------------------------------------------------|
  12484. * | struct htt_tx_compl_ind_append_retries |
  12485. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12486. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12487. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12488. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12489. * |-------------------------------------------------------------------|
  12490. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12491. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12492. * | MSDU0 tx_tsf64_low |
  12493. * |-------------------------------------------------------------------|
  12494. * | MSDU0 tx_tsf64_high |
  12495. * |-------------------------------------------------------------------|
  12496. * | MSDU1 tx_tsf64_low |
  12497. * |-------------------------------------------------------------------|
  12498. * | MSDU1 tx_tsf64_high |
  12499. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12500. * | phy_timestamp |
  12501. * |-------------------------------------------------------------------|
  12502. * | rate specs (see below) |
  12503. * |-------------------------------------------------------------------|
  12504. * | seqctrl | framectrl |
  12505. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12506. * Where:
  12507. * A0 = append (a.k.a. append0)
  12508. * A1 = append1
  12509. * TP = MSDU tx power presence
  12510. * A2 = append2
  12511. * A3 = append3
  12512. * A4 = append4
  12513. *
  12514. * The following field definitions describe the format of the TX completion
  12515. * indication sent from the target to the host
  12516. * Header fields:
  12517. * - msg_type
  12518. * Bits 7:0
  12519. * Purpose: identifies this as HTT TX completion indication
  12520. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12521. * - status
  12522. * Bits 10:8
  12523. * Purpose: the TX completion status of payload fragmentations descriptors
  12524. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12525. * - tid
  12526. * Bits 14:11
  12527. * Purpose: the tid associated with those fragmentation descriptors. It is
  12528. * valid or not, depending on the tid_invalid bit.
  12529. * Value: 0 to 15
  12530. * - tid_invalid
  12531. * Bits 15:15
  12532. * Purpose: this bit indicates whether the tid field is valid or not
  12533. * Value: 0 indicates valid; 1 indicates invalid
  12534. * - num
  12535. * Bits 23:16
  12536. * Purpose: the number of payload in this indication
  12537. * Value: 1 to 255
  12538. * - append (a.k.a. append0)
  12539. * Bits 24:24
  12540. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12541. * the number of tx retries for one MSDU at the end of this message
  12542. * Value: 0 indicates no appending; 1 indicates appending
  12543. * - append1
  12544. * Bits 25:25
  12545. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12546. * contains the timestamp info for each TX msdu id in payload.
  12547. * The order of the timestamps matches the order of the MSDU IDs.
  12548. * Note that a big-endian host needs to account for the reordering
  12549. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12550. * conversion) when determining which tx timestamp corresponds to
  12551. * which MSDU ID.
  12552. * Value: 0 indicates no appending; 1 indicates appending
  12553. * - msdu_tx_power_presence
  12554. * Bits 26:26
  12555. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12556. * for each MSDU referenced by the TX_COMPL_IND message.
  12557. * The tx power is reported in 0.5 dBm units.
  12558. * The order of the per-MSDU tx power reports matches the order
  12559. * of the MSDU IDs.
  12560. * Note that a big-endian host needs to account for the reordering
  12561. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12562. * conversion) when determining which Tx Power corresponds to
  12563. * which MSDU ID.
  12564. * Value: 0 indicates MSDU tx power reports are not appended,
  12565. * 1 indicates MSDU tx power reports are appended
  12566. * - append2
  12567. * Bits 27:27
  12568. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12569. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12570. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12571. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12572. * for each MSDU, for convenience.
  12573. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12574. * this append2 bit is set).
  12575. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12576. * dB above the noise floor.
  12577. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12578. * 1 indicates MSDU ACK RSSI values are appended.
  12579. * - append3
  12580. * Bits 28:28
  12581. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12582. * contains the tx tsf info based on wlan global TSF for
  12583. * each TX msdu id in payload.
  12584. * The order of the tx tsf matches the order of the MSDU IDs.
  12585. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12586. * values to indicate the the lower 32 bits and higher 32 bits of
  12587. * the tx tsf.
  12588. * The tx_tsf64 here represents the time MSDU was acked and the
  12589. * tx_tsf64 has microseconds units.
  12590. * Value: 0 indicates no appending; 1 indicates appending
  12591. * - append4
  12592. * Bits 29:29
  12593. * Purpose: Indicate whether data frame control fields and fields required
  12594. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12595. * message. The order of the this message matches the order of
  12596. * the MSDU IDs.
  12597. * Value: 0 indicates frame control fields and fields required for
  12598. * radio tap header values are not appended,
  12599. * 1 indicates frame control fields and fields required for
  12600. * radio tap header values are appended.
  12601. * Payload fields:
  12602. * - hmsdu_id
  12603. * Bits 15:0
  12604. * Purpose: this ID is used to track the Tx buffer in host
  12605. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12606. */
  12607. PREPACK struct htt_tx_data_hdr_information {
  12608. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12609. A_UINT32 /* word 1 */
  12610. /* preamble:
  12611. * 0-OFDM,
  12612. * 1-CCk,
  12613. * 2-HT,
  12614. * 3-VHT
  12615. */
  12616. preamble: 2, /* [1:0] */
  12617. /* mcs:
  12618. * In case of HT preamble interpret
  12619. * MCS along with NSS.
  12620. * Valid values for HT are 0 to 7.
  12621. * HT mcs 0 with NSS 2 is mcs 8.
  12622. * Valid values for VHT are 0 to 9.
  12623. */
  12624. mcs: 4, /* [5:2] */
  12625. /* rate:
  12626. * This is applicable only for
  12627. * CCK and OFDM preamble type
  12628. * rate 0: OFDM 48 Mbps,
  12629. * 1: OFDM 24 Mbps,
  12630. * 2: OFDM 12 Mbps
  12631. * 3: OFDM 6 Mbps
  12632. * 4: OFDM 54 Mbps
  12633. * 5: OFDM 36 Mbps
  12634. * 6: OFDM 18 Mbps
  12635. * 7: OFDM 9 Mbps
  12636. * rate 0: CCK 11 Mbps Long
  12637. * 1: CCK 5.5 Mbps Long
  12638. * 2: CCK 2 Mbps Long
  12639. * 3: CCK 1 Mbps Long
  12640. * 4: CCK 11 Mbps Short
  12641. * 5: CCK 5.5 Mbps Short
  12642. * 6: CCK 2 Mbps Short
  12643. */
  12644. rate : 3, /* [ 8: 6] */
  12645. rssi : 8, /* [16: 9] units=dBm */
  12646. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12647. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12648. stbc : 1, /* [22] */
  12649. sgi : 1, /* [23] */
  12650. ldpc : 1, /* [24] */
  12651. beamformed: 1, /* [25] */
  12652. /* tx_retry_cnt:
  12653. * Indicates retry count of data tx frames provided by the host.
  12654. */
  12655. tx_retry_cnt: 6; /* [31:26] */
  12656. A_UINT32 /* word 2 */
  12657. framectrl:16, /* [15: 0] */
  12658. seqno:16; /* [31:16] */
  12659. } POSTPACK;
  12660. #define HTT_TX_COMPL_IND_STATUS_S 8
  12661. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12662. #define HTT_TX_COMPL_IND_TID_S 11
  12663. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12664. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12665. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12666. #define HTT_TX_COMPL_IND_NUM_S 16
  12667. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12668. #define HTT_TX_COMPL_IND_APPEND_S 24
  12669. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12670. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12671. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12672. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12673. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12674. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12675. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12676. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12677. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12678. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12679. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12680. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12681. do { \
  12682. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12683. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12684. } while (0)
  12685. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12686. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12687. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12688. do { \
  12689. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12690. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12691. } while (0)
  12692. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12693. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12694. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12695. do { \
  12696. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12697. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12698. } while (0)
  12699. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12700. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12701. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12702. do { \
  12703. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12704. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12705. } while (0)
  12706. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12707. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12708. HTT_TX_COMPL_IND_TID_INV_S)
  12709. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12710. do { \
  12711. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12712. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12713. } while (0)
  12714. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12715. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12716. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12717. do { \
  12718. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12719. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12720. } while (0)
  12721. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12722. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12723. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12724. do { \
  12725. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12726. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12727. } while (0)
  12728. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12729. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12730. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12731. do { \
  12732. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12733. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12734. } while (0)
  12735. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12736. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12737. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12738. do { \
  12739. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12740. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12741. } while (0)
  12742. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12743. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12744. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12745. do { \
  12746. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12747. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12748. } while (0)
  12749. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12750. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12751. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12752. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12753. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12754. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12755. #define HTT_TX_COMPL_IND_STAT_OK 0
  12756. /* DISCARD:
  12757. * current meaning:
  12758. * MSDUs were queued for transmission but filtered by HW or SW
  12759. * without any over the air attempts
  12760. * legacy meaning (HL Rome):
  12761. * MSDUs were discarded by the target FW without any over the air
  12762. * attempts due to lack of space
  12763. */
  12764. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12765. /* NO_ACK:
  12766. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12767. */
  12768. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12769. /* POSTPONE:
  12770. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12771. * be downloaded again later (in the appropriate order), when they are
  12772. * deliverable.
  12773. */
  12774. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12775. /*
  12776. * The PEER_DEL tx completion status is used for HL cases
  12777. * where the peer the frame is for has been deleted.
  12778. * The host has already discarded its copy of the frame, but
  12779. * it still needs the tx completion to restore its credit.
  12780. */
  12781. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12782. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12783. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12784. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12785. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12786. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12787. PREPACK struct htt_tx_compl_ind_base {
  12788. A_UINT32 hdr;
  12789. A_UINT16 payload[1/*or more*/];
  12790. } POSTPACK;
  12791. PREPACK struct htt_tx_compl_ind_append_retries {
  12792. A_UINT16 msdu_id;
  12793. A_UINT8 tx_retries;
  12794. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12795. 0: this is the last append_retries struct */
  12796. } POSTPACK;
  12797. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12798. A_UINT32 timestamp[1/*or more*/];
  12799. } POSTPACK;
  12800. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12801. A_UINT32 tx_tsf64_low;
  12802. A_UINT32 tx_tsf64_high;
  12803. } POSTPACK;
  12804. /* htt_tx_data_hdr_information payload extension fields: */
  12805. /* DWORD zero */
  12806. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12807. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12808. /* DWORD one */
  12809. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12810. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12811. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12812. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12813. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12814. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12815. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12816. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12817. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12818. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12819. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12820. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12821. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12822. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12823. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12824. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12825. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12826. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12827. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12828. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12829. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12830. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12831. /* DWORD two */
  12832. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12833. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12834. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12835. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12836. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12837. do { \
  12838. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12839. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12840. } while (0)
  12841. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12842. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12843. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12844. do { \
  12845. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12846. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12847. } while (0)
  12848. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12849. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12850. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12851. do { \
  12852. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12853. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12854. } while (0)
  12855. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12856. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12857. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12858. do { \
  12859. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12860. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12861. } while (0)
  12862. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12863. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12864. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12865. do { \
  12866. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12867. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12868. } while (0)
  12869. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12870. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12871. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12872. do { \
  12873. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12874. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12875. } while (0)
  12876. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12877. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12878. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12879. do { \
  12880. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12881. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12882. } while (0)
  12883. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12884. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12885. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12886. do { \
  12887. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12888. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12889. } while (0)
  12890. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12891. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12892. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12893. do { \
  12894. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12895. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12896. } while (0)
  12897. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12898. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12899. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12900. do { \
  12901. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12902. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12903. } while (0)
  12904. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12905. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12906. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12907. do { \
  12908. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12909. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12910. } while (0)
  12911. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12912. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12913. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12914. do { \
  12915. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12916. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12917. } while (0)
  12918. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12919. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12920. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12921. do { \
  12922. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12923. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12924. } while (0)
  12925. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12926. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12927. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12928. do { \
  12929. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12930. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12931. } while (0)
  12932. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12933. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12934. /**
  12935. * @brief target -> host rate-control update indication message
  12936. *
  12937. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12938. *
  12939. * @details
  12940. * The following diagram shows the format of the RC Update message
  12941. * sent from the target to the host, while processing the tx-completion
  12942. * of a transmitted PPDU.
  12943. *
  12944. * |31 24|23 16|15 8|7 0|
  12945. * |-------------------------------------------------------------|
  12946. * | peer ID | vdev ID | msg_type |
  12947. * |-------------------------------------------------------------|
  12948. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12949. * |-------------------------------------------------------------|
  12950. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12951. * |-------------------------------------------------------------|
  12952. * | : |
  12953. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12954. * | : |
  12955. * |-------------------------------------------------------------|
  12956. * | : |
  12957. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12958. * | : |
  12959. * |-------------------------------------------------------------|
  12960. * : :
  12961. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12962. *
  12963. */
  12964. typedef struct {
  12965. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12966. A_UINT32 rate_code_flags;
  12967. A_UINT32 flags; /* Encodes information such as excessive
  12968. retransmission, aggregate, some info
  12969. from .11 frame control,
  12970. STBC, LDPC, (SGI and Tx Chain Mask
  12971. are encoded in ptx_rc->flags field),
  12972. AMPDU truncation (BT/time based etc.),
  12973. RTS/CTS attempt */
  12974. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12975. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12976. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12977. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12978. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12979. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12980. } HTT_RC_TX_DONE_PARAMS;
  12981. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12982. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12983. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12984. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12985. #define HTT_RC_UPDATE_VDEVID_S 8
  12986. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12987. #define HTT_RC_UPDATE_PEERID_S 16
  12988. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12989. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12990. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12991. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12992. do { \
  12993. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12994. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12995. } while (0)
  12996. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12997. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12998. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12999. do { \
  13000. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13001. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13002. } while (0)
  13003. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13004. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13005. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13006. do { \
  13007. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13008. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13009. } while (0)
  13010. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13011. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13012. /**
  13013. * @brief target -> host rx fragment indication message definition
  13014. *
  13015. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13016. *
  13017. * @details
  13018. * The following field definitions describe the format of the rx fragment
  13019. * indication message sent from the target to the host.
  13020. * The rx fragment indication message shares the format of the
  13021. * rx indication message, but not all fields from the rx indication message
  13022. * are relevant to the rx fragment indication message.
  13023. *
  13024. *
  13025. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13026. * |-----------+-------------------+---------------------+-------------|
  13027. * | peer ID | |FV| ext TID | msg type |
  13028. * |-------------------------------------------------------------------|
  13029. * | | flush | flush |
  13030. * | | end | start |
  13031. * | | seq num | seq num |
  13032. * |-------------------------------------------------------------------|
  13033. * | reserved | FW rx desc bytes |
  13034. * |-------------------------------------------------------------------|
  13035. * | | FW MSDU Rx |
  13036. * | | desc B0 |
  13037. * |-------------------------------------------------------------------|
  13038. * Header fields:
  13039. * - MSG_TYPE
  13040. * Bits 7:0
  13041. * Purpose: identifies this as an rx fragment indication message
  13042. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13043. * - EXT_TID
  13044. * Bits 12:8
  13045. * Purpose: identify the traffic ID of the rx data, including
  13046. * special "extended" TID values for multicast, broadcast, and
  13047. * non-QoS data frames
  13048. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13049. * - FLUSH_VALID (FV)
  13050. * Bit 13
  13051. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13052. * is valid
  13053. * Value:
  13054. * 1 -> flush IE is valid and needs to be processed
  13055. * 0 -> flush IE is not valid and should be ignored
  13056. * - PEER_ID
  13057. * Bits 31:16
  13058. * Purpose: Identify, by ID, which peer sent the rx data
  13059. * Value: ID of the peer who sent the rx data
  13060. * - FLUSH_SEQ_NUM_START
  13061. * Bits 5:0
  13062. * Purpose: Indicate the start of a series of MPDUs to flush
  13063. * Not all MPDUs within this series are necessarily valid - the host
  13064. * must check each sequence number within this range to see if the
  13065. * corresponding MPDU is actually present.
  13066. * This field is only valid if the FV bit is set.
  13067. * Value:
  13068. * The sequence number for the first MPDUs to check to flush.
  13069. * The sequence number is masked by 0x3f.
  13070. * - FLUSH_SEQ_NUM_END
  13071. * Bits 11:6
  13072. * Purpose: Indicate the end of a series of MPDUs to flush
  13073. * Value:
  13074. * The sequence number one larger than the sequence number of the
  13075. * last MPDU to check to flush.
  13076. * The sequence number is masked by 0x3f.
  13077. * Not all MPDUs within this series are necessarily valid - the host
  13078. * must check each sequence number within this range to see if the
  13079. * corresponding MPDU is actually present.
  13080. * This field is only valid if the FV bit is set.
  13081. * Rx descriptor fields:
  13082. * - FW_RX_DESC_BYTES
  13083. * Bits 15:0
  13084. * Purpose: Indicate how many bytes in the Rx indication are used for
  13085. * FW Rx descriptors
  13086. * Value: 1
  13087. */
  13088. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13089. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13090. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13091. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13092. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13093. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13094. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13095. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13096. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13097. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13098. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13099. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13100. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13101. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13102. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13103. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13104. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13105. #define HTT_RX_FRAG_IND_BYTES \
  13106. (4 /* msg hdr */ + \
  13107. 4 /* flush spec */ + \
  13108. 4 /* (unused) FW rx desc bytes spec */ + \
  13109. 4 /* FW rx desc */)
  13110. /**
  13111. * @brief target -> host test message definition
  13112. *
  13113. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13114. *
  13115. * @details
  13116. * The following field definitions describe the format of the test
  13117. * message sent from the target to the host.
  13118. * The message consists of a 4-octet header, followed by a variable
  13119. * number of 32-bit integer values, followed by a variable number
  13120. * of 8-bit character values.
  13121. *
  13122. * |31 16|15 8|7 0|
  13123. * |-----------------------------------------------------------|
  13124. * | num chars | num ints | msg type |
  13125. * |-----------------------------------------------------------|
  13126. * | int 0 |
  13127. * |-----------------------------------------------------------|
  13128. * | int 1 |
  13129. * |-----------------------------------------------------------|
  13130. * | ... |
  13131. * |-----------------------------------------------------------|
  13132. * | char 3 | char 2 | char 1 | char 0 |
  13133. * |-----------------------------------------------------------|
  13134. * | | | ... | char 4 |
  13135. * |-----------------------------------------------------------|
  13136. * - MSG_TYPE
  13137. * Bits 7:0
  13138. * Purpose: identifies this as a test message
  13139. * Value: HTT_MSG_TYPE_TEST
  13140. * - NUM_INTS
  13141. * Bits 15:8
  13142. * Purpose: indicate how many 32-bit integers follow the message header
  13143. * - NUM_CHARS
  13144. * Bits 31:16
  13145. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13146. */
  13147. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13148. #define HTT_RX_TEST_NUM_INTS_S 8
  13149. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13150. #define HTT_RX_TEST_NUM_CHARS_S 16
  13151. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13152. do { \
  13153. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13154. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13155. } while (0)
  13156. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13157. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13158. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13159. do { \
  13160. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13161. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13162. } while (0)
  13163. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13164. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13165. /**
  13166. * @brief target -> host packet log message
  13167. *
  13168. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13169. *
  13170. * @details
  13171. * The following field definitions describe the format of the packet log
  13172. * message sent from the target to the host.
  13173. * The message consists of a 4-octet header,followed by a variable number
  13174. * of 32-bit character values.
  13175. *
  13176. * |31 16|15 12|11 10|9 8|7 0|
  13177. * |------------------------------------------------------------------|
  13178. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13179. * |------------------------------------------------------------------|
  13180. * | payload |
  13181. * |------------------------------------------------------------------|
  13182. * - MSG_TYPE
  13183. * Bits 7:0
  13184. * Purpose: identifies this as a pktlog message
  13185. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13186. * - mac_id
  13187. * Bits 9:8
  13188. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13189. * Value: 0-3
  13190. * - pdev_id
  13191. * Bits 11:10
  13192. * Purpose: pdev_id
  13193. * Value: 0-3
  13194. * 0 (for rings at SOC level),
  13195. * 1/2/3 PDEV -> 0/1/2
  13196. * - payload_size
  13197. * Bits 31:16
  13198. * Purpose: explicitly specify the payload size
  13199. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13200. */
  13201. PREPACK struct htt_pktlog_msg {
  13202. A_UINT32 header;
  13203. A_UINT32 payload[1/* or more */];
  13204. } POSTPACK;
  13205. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13206. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13207. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13208. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13209. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13210. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13211. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13212. do { \
  13213. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13214. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13215. } while (0)
  13216. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13217. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13218. HTT_T2H_PKTLOG_MAC_ID_S)
  13219. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13220. do { \
  13221. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13222. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13223. } while (0)
  13224. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13225. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13226. HTT_T2H_PKTLOG_PDEV_ID_S)
  13227. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13228. do { \
  13229. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13230. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13231. } while (0)
  13232. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13233. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13234. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13235. /*
  13236. * Rx reorder statistics
  13237. * NB: all the fields must be defined in 4 octets size.
  13238. */
  13239. struct rx_reorder_stats {
  13240. /* Non QoS MPDUs received */
  13241. A_UINT32 deliver_non_qos;
  13242. /* MPDUs received in-order */
  13243. A_UINT32 deliver_in_order;
  13244. /* Flush due to reorder timer expired */
  13245. A_UINT32 deliver_flush_timeout;
  13246. /* Flush due to move out of window */
  13247. A_UINT32 deliver_flush_oow;
  13248. /* Flush due to DELBA */
  13249. A_UINT32 deliver_flush_delba;
  13250. /* MPDUs dropped due to FCS error */
  13251. A_UINT32 fcs_error;
  13252. /* MPDUs dropped due to monitor mode non-data packet */
  13253. A_UINT32 mgmt_ctrl;
  13254. /* Unicast-data MPDUs dropped due to invalid peer */
  13255. A_UINT32 invalid_peer;
  13256. /* MPDUs dropped due to duplication (non aggregation) */
  13257. A_UINT32 dup_non_aggr;
  13258. /* MPDUs dropped due to processed before */
  13259. A_UINT32 dup_past;
  13260. /* MPDUs dropped due to duplicate in reorder queue */
  13261. A_UINT32 dup_in_reorder;
  13262. /* Reorder timeout happened */
  13263. A_UINT32 reorder_timeout;
  13264. /* invalid bar ssn */
  13265. A_UINT32 invalid_bar_ssn;
  13266. /* reorder reset due to bar ssn */
  13267. A_UINT32 ssn_reset;
  13268. /* Flush due to delete peer */
  13269. A_UINT32 deliver_flush_delpeer;
  13270. /* Flush due to offload*/
  13271. A_UINT32 deliver_flush_offload;
  13272. /* Flush due to out of buffer*/
  13273. A_UINT32 deliver_flush_oob;
  13274. /* MPDUs dropped due to PN check fail */
  13275. A_UINT32 pn_fail;
  13276. /* MPDUs dropped due to unable to allocate memory */
  13277. A_UINT32 store_fail;
  13278. /* Number of times the tid pool alloc succeeded */
  13279. A_UINT32 tid_pool_alloc_succ;
  13280. /* Number of times the MPDU pool alloc succeeded */
  13281. A_UINT32 mpdu_pool_alloc_succ;
  13282. /* Number of times the MSDU pool alloc succeeded */
  13283. A_UINT32 msdu_pool_alloc_succ;
  13284. /* Number of times the tid pool alloc failed */
  13285. A_UINT32 tid_pool_alloc_fail;
  13286. /* Number of times the MPDU pool alloc failed */
  13287. A_UINT32 mpdu_pool_alloc_fail;
  13288. /* Number of times the MSDU pool alloc failed */
  13289. A_UINT32 msdu_pool_alloc_fail;
  13290. /* Number of times the tid pool freed */
  13291. A_UINT32 tid_pool_free;
  13292. /* Number of times the MPDU pool freed */
  13293. A_UINT32 mpdu_pool_free;
  13294. /* Number of times the MSDU pool freed */
  13295. A_UINT32 msdu_pool_free;
  13296. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13297. A_UINT32 msdu_queued;
  13298. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13299. A_UINT32 msdu_recycled;
  13300. /* Number of MPDUs with invalid peer but A2 found in AST */
  13301. A_UINT32 invalid_peer_a2_in_ast;
  13302. /* Number of MPDUs with invalid peer but A3 found in AST */
  13303. A_UINT32 invalid_peer_a3_in_ast;
  13304. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13305. A_UINT32 invalid_peer_bmc_mpdus;
  13306. /* Number of MSDUs with err attention word */
  13307. A_UINT32 rxdesc_err_att;
  13308. /* Number of MSDUs with flag of peer_idx_invalid */
  13309. A_UINT32 rxdesc_err_peer_idx_inv;
  13310. /* Number of MSDUs with flag of peer_idx_timeout */
  13311. A_UINT32 rxdesc_err_peer_idx_to;
  13312. /* Number of MSDUs with flag of overflow */
  13313. A_UINT32 rxdesc_err_ov;
  13314. /* Number of MSDUs with flag of msdu_length_err */
  13315. A_UINT32 rxdesc_err_msdu_len;
  13316. /* Number of MSDUs with flag of mpdu_length_err */
  13317. A_UINT32 rxdesc_err_mpdu_len;
  13318. /* Number of MSDUs with flag of tkip_mic_err */
  13319. A_UINT32 rxdesc_err_tkip_mic;
  13320. /* Number of MSDUs with flag of decrypt_err */
  13321. A_UINT32 rxdesc_err_decrypt;
  13322. /* Number of MSDUs with flag of fcs_err */
  13323. A_UINT32 rxdesc_err_fcs;
  13324. /* Number of Unicast (bc_mc bit is not set in attention word)
  13325. * frames with invalid peer handler
  13326. */
  13327. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13328. /* Number of unicast frame directly (direct bit is set in attention word)
  13329. * to DUT with invalid peer handler
  13330. */
  13331. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13332. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13333. * frames with invalid peer handler
  13334. */
  13335. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13336. /* Number of MSDUs dropped due to no first MSDU flag */
  13337. A_UINT32 rxdesc_no_1st_msdu;
  13338. /* Number of MSDUs droped due to ring overflow */
  13339. A_UINT32 msdu_drop_ring_ov;
  13340. /* Number of MSDUs dropped due to FC mismatch */
  13341. A_UINT32 msdu_drop_fc_mismatch;
  13342. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13343. A_UINT32 msdu_drop_mgmt_remote_ring;
  13344. /* Number of MSDUs dropped due to errors not reported in attention word */
  13345. A_UINT32 msdu_drop_misc;
  13346. /* Number of MSDUs go to offload before reorder */
  13347. A_UINT32 offload_msdu_wal;
  13348. /* Number of data frame dropped by offload after reorder */
  13349. A_UINT32 offload_msdu_reorder;
  13350. /* Number of MPDUs with sequence number in the past and within the BA window */
  13351. A_UINT32 dup_past_within_window;
  13352. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13353. A_UINT32 dup_past_outside_window;
  13354. /* Number of MSDUs with decrypt/MIC error */
  13355. A_UINT32 rxdesc_err_decrypt_mic;
  13356. /* Number of data MSDUs received on both local and remote rings */
  13357. A_UINT32 data_msdus_on_both_rings;
  13358. /* MPDUs never filled */
  13359. A_UINT32 holes_not_filled;
  13360. };
  13361. /*
  13362. * Rx Remote buffer statistics
  13363. * NB: all the fields must be defined in 4 octets size.
  13364. */
  13365. struct rx_remote_buffer_mgmt_stats {
  13366. /* Total number of MSDUs reaped for Rx processing */
  13367. A_UINT32 remote_reaped;
  13368. /* MSDUs recycled within firmware */
  13369. A_UINT32 remote_recycled;
  13370. /* MSDUs stored by Data Rx */
  13371. A_UINT32 data_rx_msdus_stored;
  13372. /* Number of HTT indications from WAL Rx MSDU */
  13373. A_UINT32 wal_rx_ind;
  13374. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13375. A_UINT32 wal_rx_ind_unconsumed;
  13376. /* Number of HTT indications from Data Rx MSDU */
  13377. A_UINT32 data_rx_ind;
  13378. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13379. A_UINT32 data_rx_ind_unconsumed;
  13380. /* Number of HTT indications from ATHBUF */
  13381. A_UINT32 athbuf_rx_ind;
  13382. /* Number of remote buffers requested for refill */
  13383. A_UINT32 refill_buf_req;
  13384. /* Number of remote buffers filled by the host */
  13385. A_UINT32 refill_buf_rsp;
  13386. /* Number of times MAC hw_index = f/w write_index */
  13387. A_INT32 mac_no_bufs;
  13388. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13389. A_INT32 fw_indices_equal;
  13390. /* Number of times f/w finds no buffers to post */
  13391. A_INT32 host_no_bufs;
  13392. };
  13393. /*
  13394. * TXBF MU/SU packets and NDPA statistics
  13395. * NB: all the fields must be defined in 4 octets size.
  13396. */
  13397. struct rx_txbf_musu_ndpa_pkts_stats {
  13398. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13399. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13400. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13401. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13402. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13403. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13404. };
  13405. /*
  13406. * htt_dbg_stats_status -
  13407. * present - The requested stats have been delivered in full.
  13408. * This indicates that either the stats information was contained
  13409. * in its entirety within this message, or else this message
  13410. * completes the delivery of the requested stats info that was
  13411. * partially delivered through earlier STATS_CONF messages.
  13412. * partial - The requested stats have been delivered in part.
  13413. * One or more subsequent STATS_CONF messages with the same
  13414. * cookie value will be sent to deliver the remainder of the
  13415. * information.
  13416. * error - The requested stats could not be delivered, for example due
  13417. * to a shortage of memory to construct a message holding the
  13418. * requested stats.
  13419. * invalid - The requested stat type is either not recognized, or the
  13420. * target is configured to not gather the stats type in question.
  13421. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13422. * series_done - This special value indicates that no further stats info
  13423. * elements are present within a series of stats info elems
  13424. * (within a stats upload confirmation message).
  13425. */
  13426. enum htt_dbg_stats_status {
  13427. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13428. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13429. HTT_DBG_STATS_STATUS_ERROR = 2,
  13430. HTT_DBG_STATS_STATUS_INVALID = 3,
  13431. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13432. };
  13433. /**
  13434. * @brief target -> host statistics upload
  13435. *
  13436. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13437. *
  13438. * @details
  13439. * The following field definitions describe the format of the HTT target
  13440. * to host stats upload confirmation message.
  13441. * The message contains a cookie echoed from the HTT host->target stats
  13442. * upload request, which identifies which request the confirmation is
  13443. * for, and a series of tag-length-value stats information elements.
  13444. * The tag-length header for each stats info element also includes a
  13445. * status field, to indicate whether the request for the stat type in
  13446. * question was fully met, partially met, unable to be met, or invalid
  13447. * (if the stat type in question is disabled in the target).
  13448. * A special value of all 1's in this status field is used to indicate
  13449. * the end of the series of stats info elements.
  13450. *
  13451. *
  13452. * |31 16|15 8|7 5|4 0|
  13453. * |------------------------------------------------------------|
  13454. * | reserved | msg type |
  13455. * |------------------------------------------------------------|
  13456. * | cookie LSBs |
  13457. * |------------------------------------------------------------|
  13458. * | cookie MSBs |
  13459. * |------------------------------------------------------------|
  13460. * | stats entry length | reserved | S |stat type|
  13461. * |------------------------------------------------------------|
  13462. * | |
  13463. * | type-specific stats info |
  13464. * | |
  13465. * |------------------------------------------------------------|
  13466. * | stats entry length | reserved | S |stat type|
  13467. * |------------------------------------------------------------|
  13468. * | |
  13469. * | type-specific stats info |
  13470. * | |
  13471. * |------------------------------------------------------------|
  13472. * | n/a | reserved | 111 | n/a |
  13473. * |------------------------------------------------------------|
  13474. * Header fields:
  13475. * - MSG_TYPE
  13476. * Bits 7:0
  13477. * Purpose: identifies this is a statistics upload confirmation message
  13478. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13479. * - COOKIE_LSBS
  13480. * Bits 31:0
  13481. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13482. * message with its preceding host->target stats request message.
  13483. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13484. * - COOKIE_MSBS
  13485. * Bits 31:0
  13486. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13487. * message with its preceding host->target stats request message.
  13488. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13489. *
  13490. * Stats Information Element tag-length header fields:
  13491. * - STAT_TYPE
  13492. * Bits 4:0
  13493. * Purpose: identifies the type of statistics info held in the
  13494. * following information element
  13495. * Value: htt_dbg_stats_type
  13496. * - STATUS
  13497. * Bits 7:5
  13498. * Purpose: indicate whether the requested stats are present
  13499. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13500. * the completion of the stats entry series
  13501. * - LENGTH
  13502. * Bits 31:16
  13503. * Purpose: indicate the stats information size
  13504. * Value: This field specifies the number of bytes of stats information
  13505. * that follows the element tag-length header.
  13506. * It is expected but not required that this length is a multiple of
  13507. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13508. * subsequent stats entry header will begin on a 4-byte aligned
  13509. * boundary.
  13510. */
  13511. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13512. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13513. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13514. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13515. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13516. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13517. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13518. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13519. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13520. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13521. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13522. do { \
  13523. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13524. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13525. } while (0)
  13526. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13527. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13528. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13529. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13530. do { \
  13531. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13532. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13533. } while (0)
  13534. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13535. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13536. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13537. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13538. do { \
  13539. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13540. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13541. } while (0)
  13542. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13543. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13544. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13545. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13546. #define HTT_MAX_AGGR 64
  13547. #define HTT_HL_MAX_AGGR 18
  13548. /**
  13549. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13550. *
  13551. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13552. *
  13553. * @details
  13554. * The following field definitions describe the format of the HTT host
  13555. * to target frag_desc/msdu_ext bank configuration message.
  13556. * The message contains the based address and the min and max id of the
  13557. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13558. * MSDU_EXT/FRAG_DESC.
  13559. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13560. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13561. * the hardware does the mapping/translation.
  13562. *
  13563. * Total banks that can be configured is configured to 16.
  13564. *
  13565. * This should be called before any TX has be initiated by the HTT
  13566. *
  13567. * |31 16|15 8|7 5|4 0|
  13568. * |------------------------------------------------------------|
  13569. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13570. * |------------------------------------------------------------|
  13571. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13572. #if HTT_PADDR64
  13573. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13574. #endif
  13575. * |------------------------------------------------------------|
  13576. * | ... |
  13577. * |------------------------------------------------------------|
  13578. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13579. #if HTT_PADDR64
  13580. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13581. #endif
  13582. * |------------------------------------------------------------|
  13583. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13584. * |------------------------------------------------------------|
  13585. * | ... |
  13586. * |------------------------------------------------------------|
  13587. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13588. * |------------------------------------------------------------|
  13589. * Header fields:
  13590. * - MSG_TYPE
  13591. * Bits 7:0
  13592. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13593. * for systems with 64-bit format for bus addresses:
  13594. * - BANKx_BASE_ADDRESS_LO
  13595. * Bits 31:0
  13596. * Purpose: Provide a mechanism to specify the base address of the
  13597. * MSDU_EXT bank physical/bus address.
  13598. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13599. * - BANKx_BASE_ADDRESS_HI
  13600. * Bits 31:0
  13601. * Purpose: Provide a mechanism to specify the base address of the
  13602. * MSDU_EXT bank physical/bus address.
  13603. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13604. * for systems with 32-bit format for bus addresses:
  13605. * - BANKx_BASE_ADDRESS
  13606. * Bits 31:0
  13607. * Purpose: Provide a mechanism to specify the base address of the
  13608. * MSDU_EXT bank physical/bus address.
  13609. * Value: MSDU_EXT bank physical / bus address
  13610. * - BANKx_MIN_ID
  13611. * Bits 15:0
  13612. * Purpose: Provide a mechanism to specify the min index that needs to
  13613. * mapped.
  13614. * - BANKx_MAX_ID
  13615. * Bits 31:16
  13616. * Purpose: Provide a mechanism to specify the max index that needs to
  13617. * mapped.
  13618. *
  13619. */
  13620. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13621. * safe value.
  13622. * @note MAX supported banks is 16.
  13623. */
  13624. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13625. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13626. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13627. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13628. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13629. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13630. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13631. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13632. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13633. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13634. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13635. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13636. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13637. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13638. do { \
  13639. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13640. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13641. } while (0)
  13642. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13643. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13644. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13645. do { \
  13646. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13647. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13648. } while (0)
  13649. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13650. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13651. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13652. do { \
  13653. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13654. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13655. } while (0)
  13656. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13657. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13658. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13659. do { \
  13660. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13661. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13662. } while (0)
  13663. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13664. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13665. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13666. do { \
  13667. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13668. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13669. } while (0)
  13670. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13671. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13672. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13673. do { \
  13674. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13675. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13676. } while (0)
  13677. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13678. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13679. /*
  13680. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13681. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13682. * addresses are stored in a XXX-bit field.
  13683. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13684. * htt_tx_frag_desc64_bank_cfg_t structs.
  13685. */
  13686. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13687. _paddr_bits_, \
  13688. _paddr__bank_base_address_) \
  13689. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13690. /** word 0 \
  13691. * msg_type: 8, \
  13692. * pdev_id: 2, \
  13693. * swap: 1, \
  13694. * reserved0: 5, \
  13695. * num_banks: 8, \
  13696. * desc_size: 8; \
  13697. */ \
  13698. A_UINT32 word0; \
  13699. /* \
  13700. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13701. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13702. * the second A_UINT32). \
  13703. */ \
  13704. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13705. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13706. } POSTPACK
  13707. /* define htt_tx_frag_desc32_bank_cfg_t */
  13708. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13709. /* define htt_tx_frag_desc64_bank_cfg_t */
  13710. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13711. /*
  13712. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13713. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13714. */
  13715. #if HTT_PADDR64
  13716. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13717. #else
  13718. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13719. #endif
  13720. /**
  13721. * @brief target -> host HTT TX Credit total count update message definition
  13722. *
  13723. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13724. *
  13725. *|31 16|15|14 9| 8 |7 0 |
  13726. *|---------------------+--+----------+-------+----------|
  13727. *|cur htt credit delta | Q| reserved | sign | msg type |
  13728. *|------------------------------------------------------|
  13729. *
  13730. * Header fields:
  13731. * - MSG_TYPE
  13732. * Bits 7:0
  13733. * Purpose: identifies this as a htt tx credit delta update message
  13734. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13735. * - SIGN
  13736. * Bits 8
  13737. * identifies whether credit delta is positive or negative
  13738. * Value:
  13739. * - 0x0: credit delta is positive, rebalance in some buffers
  13740. * - 0x1: credit delta is negative, rebalance out some buffers
  13741. * - reserved
  13742. * Bits 14:9
  13743. * Value: 0x0
  13744. * - TXQ_GRP
  13745. * Bit 15
  13746. * Purpose: indicates whether any tx queue group information elements
  13747. * are appended to the tx credit update message
  13748. * Value: 0 -> no tx queue group information element is present
  13749. * 1 -> a tx queue group information element immediately follows
  13750. * - DELTA_COUNT
  13751. * Bits 31:16
  13752. * Purpose: Specify current htt credit delta absolute count
  13753. */
  13754. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13755. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13756. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13757. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13758. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13759. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13760. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13761. do { \
  13762. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13763. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13764. } while (0)
  13765. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13766. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13767. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13768. do { \
  13769. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13770. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13771. } while (0)
  13772. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13773. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13774. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13775. do { \
  13776. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13777. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13778. } while (0)
  13779. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13780. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13781. #define HTT_TX_CREDIT_MSG_BYTES 4
  13782. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13783. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13784. /**
  13785. * @brief HTT WDI_IPA Operation Response Message
  13786. *
  13787. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13788. *
  13789. * @details
  13790. * HTT WDI_IPA Operation Response message is sent by target
  13791. * to host confirming suspend or resume operation.
  13792. * |31 24|23 16|15 8|7 0|
  13793. * |----------------+----------------+----------------+----------------|
  13794. * | op_code | Rsvd | msg_type |
  13795. * |-------------------------------------------------------------------|
  13796. * | Rsvd | Response len |
  13797. * |-------------------------------------------------------------------|
  13798. * | |
  13799. * | Response-type specific info |
  13800. * | |
  13801. * | |
  13802. * |-------------------------------------------------------------------|
  13803. * Header fields:
  13804. * - MSG_TYPE
  13805. * Bits 7:0
  13806. * Purpose: Identifies this as WDI_IPA Operation Response message
  13807. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13808. * - OP_CODE
  13809. * Bits 31:16
  13810. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13811. * value: = enum htt_wdi_ipa_op_code
  13812. * - RSP_LEN
  13813. * Bits 16:0
  13814. * Purpose: length for the response-type specific info
  13815. * value: = length in bytes for response-type specific info
  13816. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13817. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13818. */
  13819. PREPACK struct htt_wdi_ipa_op_response_t
  13820. {
  13821. /* DWORD 0: flags and meta-data */
  13822. A_UINT32
  13823. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13824. reserved1: 8,
  13825. op_code: 16;
  13826. A_UINT32
  13827. rsp_len: 16,
  13828. reserved2: 16;
  13829. } POSTPACK;
  13830. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13831. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13832. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13833. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13834. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13835. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13836. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13837. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13838. do { \
  13839. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13840. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13841. } while (0)
  13842. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13843. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13844. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13845. do { \
  13846. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13847. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13848. } while (0)
  13849. enum htt_phy_mode {
  13850. htt_phy_mode_11a = 0,
  13851. htt_phy_mode_11g = 1,
  13852. htt_phy_mode_11b = 2,
  13853. htt_phy_mode_11g_only = 3,
  13854. htt_phy_mode_11na_ht20 = 4,
  13855. htt_phy_mode_11ng_ht20 = 5,
  13856. htt_phy_mode_11na_ht40 = 6,
  13857. htt_phy_mode_11ng_ht40 = 7,
  13858. htt_phy_mode_11ac_vht20 = 8,
  13859. htt_phy_mode_11ac_vht40 = 9,
  13860. htt_phy_mode_11ac_vht80 = 10,
  13861. htt_phy_mode_11ac_vht20_2g = 11,
  13862. htt_phy_mode_11ac_vht40_2g = 12,
  13863. htt_phy_mode_11ac_vht80_2g = 13,
  13864. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13865. htt_phy_mode_11ac_vht160 = 15,
  13866. htt_phy_mode_max,
  13867. };
  13868. /**
  13869. * @brief target -> host HTT channel change indication
  13870. *
  13871. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13872. *
  13873. * @details
  13874. * Specify when a channel change occurs.
  13875. * This allows the host to precisely determine which rx frames arrived
  13876. * on the old channel and which rx frames arrived on the new channel.
  13877. *
  13878. *|31 |7 0 |
  13879. *|-------------------------------------------+----------|
  13880. *| reserved | msg type |
  13881. *|------------------------------------------------------|
  13882. *| primary_chan_center_freq_mhz |
  13883. *|------------------------------------------------------|
  13884. *| contiguous_chan1_center_freq_mhz |
  13885. *|------------------------------------------------------|
  13886. *| contiguous_chan2_center_freq_mhz |
  13887. *|------------------------------------------------------|
  13888. *| phy_mode |
  13889. *|------------------------------------------------------|
  13890. *
  13891. * Header fields:
  13892. * - MSG_TYPE
  13893. * Bits 7:0
  13894. * Purpose: identifies this as a htt channel change indication message
  13895. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13896. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13897. * Bits 31:0
  13898. * Purpose: identify the (center of the) new 20 MHz primary channel
  13899. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13900. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13901. * Bits 31:0
  13902. * Purpose: identify the (center of the) contiguous frequency range
  13903. * comprising the new channel.
  13904. * For example, if the new channel is a 80 MHz channel extending
  13905. * 60 MHz beyond the primary channel, this field would be 30 larger
  13906. * than the primary channel center frequency field.
  13907. * Value: center frequency of the contiguous frequency range comprising
  13908. * the full channel in MHz units
  13909. * (80+80 channels also use the CONTIG_CHAN2 field)
  13910. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13911. * Bits 31:0
  13912. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13913. * within a VHT 80+80 channel.
  13914. * This field is only relevant for VHT 80+80 channels.
  13915. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13916. * channel (arbitrary value for cases besides VHT 80+80)
  13917. * - PHY_MODE
  13918. * Bits 31:0
  13919. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13920. * and band
  13921. * Value: htt_phy_mode enum value
  13922. */
  13923. PREPACK struct htt_chan_change_t
  13924. {
  13925. /* DWORD 0: flags and meta-data */
  13926. A_UINT32
  13927. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13928. reserved1: 24;
  13929. A_UINT32 primary_chan_center_freq_mhz;
  13930. A_UINT32 contig_chan1_center_freq_mhz;
  13931. A_UINT32 contig_chan2_center_freq_mhz;
  13932. A_UINT32 phy_mode;
  13933. } POSTPACK;
  13934. /*
  13935. * Due to historical / backwards-compatibility reasons, maintain the
  13936. * below htt_chan_change_msg struct definition, which needs to be
  13937. * consistent with the above htt_chan_change_t struct definition
  13938. * (aside from the htt_chan_change_t definition including the msg_type
  13939. * dword within the message, and the htt_chan_change_msg only containing
  13940. * the payload of the message that follows the msg_type dword).
  13941. */
  13942. PREPACK struct htt_chan_change_msg {
  13943. A_UINT32 chan_mhz; /* frequency in mhz */
  13944. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13945. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13946. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13947. } POSTPACK;
  13948. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13949. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13950. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13951. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13952. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13953. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13954. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13955. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13956. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13957. do { \
  13958. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13959. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13960. } while (0)
  13961. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13962. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13963. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13964. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13965. do { \
  13966. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13967. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13968. } while (0)
  13969. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13970. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13971. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13972. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13973. do { \
  13974. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13975. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13976. } while (0)
  13977. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13978. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13979. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13980. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13981. do { \
  13982. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13983. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13984. } while (0)
  13985. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13986. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13987. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13988. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13989. /**
  13990. * @brief rx offload packet error message
  13991. *
  13992. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13993. *
  13994. * @details
  13995. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13996. * of target payload like mic err.
  13997. *
  13998. * |31 24|23 16|15 8|7 0|
  13999. * |----------------+----------------+----------------+----------------|
  14000. * | tid | vdev_id | msg_sub_type | msg_type |
  14001. * |-------------------------------------------------------------------|
  14002. * : (sub-type dependent content) :
  14003. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14004. * Header fields:
  14005. * - msg_type
  14006. * Bits 7:0
  14007. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14008. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14009. * - msg_sub_type
  14010. * Bits 15:8
  14011. * Purpose: Identifies which type of rx error is reported by this message
  14012. * value: htt_rx_ofld_pkt_err_type
  14013. * - vdev_id
  14014. * Bits 23:16
  14015. * Purpose: Identifies which vdev received the erroneous rx frame
  14016. * value:
  14017. * - tid
  14018. * Bits 31:24
  14019. * Purpose: Identifies the traffic type of the rx frame
  14020. * value:
  14021. *
  14022. * - The payload fields used if the sub-type == MIC error are shown below.
  14023. * Note - MIC err is per MSDU, while PN is per MPDU.
  14024. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14025. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14026. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14027. * instead of sending separate HTT messages for each wrong MSDU within
  14028. * the MPDU.
  14029. *
  14030. * |31 24|23 16|15 8|7 0|
  14031. * |----------------+----------------+----------------+----------------|
  14032. * | Rsvd | key_id | peer_id |
  14033. * |-------------------------------------------------------------------|
  14034. * | receiver MAC addr 31:0 |
  14035. * |-------------------------------------------------------------------|
  14036. * | Rsvd | receiver MAC addr 47:32 |
  14037. * |-------------------------------------------------------------------|
  14038. * | transmitter MAC addr 31:0 |
  14039. * |-------------------------------------------------------------------|
  14040. * | Rsvd | transmitter MAC addr 47:32 |
  14041. * |-------------------------------------------------------------------|
  14042. * | PN 31:0 |
  14043. * |-------------------------------------------------------------------|
  14044. * | Rsvd | PN 47:32 |
  14045. * |-------------------------------------------------------------------|
  14046. * - peer_id
  14047. * Bits 15:0
  14048. * Purpose: identifies which peer is frame is from
  14049. * value:
  14050. * - key_id
  14051. * Bits 23:16
  14052. * Purpose: identifies key_id of rx frame
  14053. * value:
  14054. * - RA_31_0 (receiver MAC addr 31:0)
  14055. * Bits 31:0
  14056. * Purpose: identifies by MAC address which vdev received the frame
  14057. * value: MAC address lower 4 bytes
  14058. * - RA_47_32 (receiver MAC addr 47:32)
  14059. * Bits 15:0
  14060. * Purpose: identifies by MAC address which vdev received the frame
  14061. * value: MAC address upper 2 bytes
  14062. * - TA_31_0 (transmitter MAC addr 31:0)
  14063. * Bits 31:0
  14064. * Purpose: identifies by MAC address which peer transmitted the frame
  14065. * value: MAC address lower 4 bytes
  14066. * - TA_47_32 (transmitter MAC addr 47:32)
  14067. * Bits 15:0
  14068. * Purpose: identifies by MAC address which peer transmitted the frame
  14069. * value: MAC address upper 2 bytes
  14070. * - PN_31_0
  14071. * Bits 31:0
  14072. * Purpose: Identifies pn of rx frame
  14073. * value: PN lower 4 bytes
  14074. * - PN_47_32
  14075. * Bits 15:0
  14076. * Purpose: Identifies pn of rx frame
  14077. * value:
  14078. * TKIP or CCMP: PN upper 2 bytes
  14079. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14080. */
  14081. enum htt_rx_ofld_pkt_err_type {
  14082. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14083. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14084. };
  14085. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14086. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14087. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14088. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14089. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14090. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14091. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14092. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14093. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14094. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14095. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14096. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14097. do { \
  14098. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14099. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14100. } while (0)
  14101. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14102. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14103. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14104. do { \
  14105. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14106. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14107. } while (0)
  14108. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14109. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14110. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14111. do { \
  14112. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14113. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14114. } while (0)
  14115. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14116. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14117. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14118. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14119. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14120. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14121. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14122. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14123. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14124. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14125. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14126. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14127. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14128. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14129. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14130. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14131. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14132. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14133. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14134. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14135. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14136. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14137. do { \
  14138. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14139. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14140. } while (0)
  14141. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14142. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14143. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14144. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14145. do { \
  14146. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14147. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14148. } while (0)
  14149. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14150. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14151. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14152. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14153. do { \
  14154. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14155. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14156. } while (0)
  14157. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14158. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14159. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14160. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14161. do { \
  14162. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14163. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14164. } while (0)
  14165. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14166. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14167. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14168. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14169. do { \
  14170. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14171. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14172. } while (0)
  14173. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14174. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14175. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14176. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14177. do { \
  14178. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14179. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14180. } while (0)
  14181. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14182. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14183. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14184. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14185. do { \
  14186. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14187. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14188. } while (0)
  14189. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14190. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14191. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14192. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14193. do { \
  14194. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14195. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14196. } while (0)
  14197. /**
  14198. * @brief target -> host peer rate report message
  14199. *
  14200. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14201. *
  14202. * @details
  14203. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14204. * justified rate of all the peers.
  14205. *
  14206. * |31 24|23 16|15 8|7 0|
  14207. * |----------------+----------------+----------------+----------------|
  14208. * | peer_count | | msg_type |
  14209. * |-------------------------------------------------------------------|
  14210. * : Payload (variant number of peer rate report) :
  14211. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14212. * Header fields:
  14213. * - msg_type
  14214. * Bits 7:0
  14215. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14216. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14217. * - reserved
  14218. * Bits 15:8
  14219. * Purpose:
  14220. * value:
  14221. * - peer_count
  14222. * Bits 31:16
  14223. * Purpose: Specify how many peer rate report elements are present in the payload.
  14224. * value:
  14225. *
  14226. * Payload:
  14227. * There are variant number of peer rate report follow the first 32 bits.
  14228. * The peer rate report is defined as follows.
  14229. *
  14230. * |31 20|19 16|15 0|
  14231. * |-----------------------+---------+---------------------------------|-
  14232. * | reserved | phy | peer_id | \
  14233. * |-------------------------------------------------------------------| -> report #0
  14234. * | rate | /
  14235. * |-----------------------+---------+---------------------------------|-
  14236. * | reserved | phy | peer_id | \
  14237. * |-------------------------------------------------------------------| -> report #1
  14238. * | rate | /
  14239. * |-----------------------+---------+---------------------------------|-
  14240. * | reserved | phy | peer_id | \
  14241. * |-------------------------------------------------------------------| -> report #2
  14242. * | rate | /
  14243. * |-------------------------------------------------------------------|-
  14244. * : :
  14245. * : :
  14246. * : :
  14247. * :-------------------------------------------------------------------:
  14248. *
  14249. * - peer_id
  14250. * Bits 15:0
  14251. * Purpose: identify the peer
  14252. * value:
  14253. * - phy
  14254. * Bits 19:16
  14255. * Purpose: identify which phy is in use
  14256. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14257. * Please see enum htt_peer_report_phy_type for detail.
  14258. * - reserved
  14259. * Bits 31:20
  14260. * Purpose:
  14261. * value:
  14262. * - rate
  14263. * Bits 31:0
  14264. * Purpose: represent the justified rate of the peer specified by peer_id
  14265. * value:
  14266. */
  14267. enum htt_peer_rate_report_phy_type {
  14268. HTT_PEER_RATE_REPORT_11B = 0,
  14269. HTT_PEER_RATE_REPORT_11A_G,
  14270. HTT_PEER_RATE_REPORT_11N,
  14271. HTT_PEER_RATE_REPORT_11AC,
  14272. };
  14273. #define HTT_PEER_RATE_REPORT_SIZE 8
  14274. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14275. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14276. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14277. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14278. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14279. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14280. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14281. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14282. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14283. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14284. do { \
  14285. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14286. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14287. } while (0)
  14288. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14289. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14290. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14291. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14292. do { \
  14293. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14294. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14295. } while (0)
  14296. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14297. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14298. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14299. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14300. do { \
  14301. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14302. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14303. } while (0)
  14304. /**
  14305. * @brief target -> host flow pool map message
  14306. *
  14307. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14308. *
  14309. * @details
  14310. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14311. * a flow of descriptors.
  14312. *
  14313. * This message is in TLV format and indicates the parameters to be setup a
  14314. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14315. * receive descriptors from a specified pool.
  14316. *
  14317. * The message would appear as follows:
  14318. *
  14319. * |31 24|23 16|15 8|7 0|
  14320. * |----------------+----------------+----------------+----------------|
  14321. * header | reserved | num_flows | msg_type |
  14322. * |-------------------------------------------------------------------|
  14323. * | |
  14324. * : payload :
  14325. * | |
  14326. * |-------------------------------------------------------------------|
  14327. *
  14328. * The header field is one DWORD long and is interpreted as follows:
  14329. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14330. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14331. * this message
  14332. * b'16-31 - reserved: These bits are reserved for future use
  14333. *
  14334. * Payload:
  14335. * The payload would contain multiple objects of the following structure. Each
  14336. * object represents a flow.
  14337. *
  14338. * |31 24|23 16|15 8|7 0|
  14339. * |----------------+----------------+----------------+----------------|
  14340. * header | reserved | num_flows | msg_type |
  14341. * |-------------------------------------------------------------------|
  14342. * payload0| flow_type |
  14343. * |-------------------------------------------------------------------|
  14344. * | flow_id |
  14345. * |-------------------------------------------------------------------|
  14346. * | reserved0 | flow_pool_id |
  14347. * |-------------------------------------------------------------------|
  14348. * | reserved1 | flow_pool_size |
  14349. * |-------------------------------------------------------------------|
  14350. * | reserved2 |
  14351. * |-------------------------------------------------------------------|
  14352. * payload1| flow_type |
  14353. * |-------------------------------------------------------------------|
  14354. * | flow_id |
  14355. * |-------------------------------------------------------------------|
  14356. * | reserved0 | flow_pool_id |
  14357. * |-------------------------------------------------------------------|
  14358. * | reserved1 | flow_pool_size |
  14359. * |-------------------------------------------------------------------|
  14360. * | reserved2 |
  14361. * |-------------------------------------------------------------------|
  14362. * | . |
  14363. * | . |
  14364. * | . |
  14365. * |-------------------------------------------------------------------|
  14366. *
  14367. * Each payload is 5 DWORDS long and is interpreted as follows:
  14368. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14369. * this flow is associated. It can be VDEV, peer,
  14370. * or tid (AC). Based on enum htt_flow_type.
  14371. *
  14372. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14373. * object. For flow_type vdev it is set to the
  14374. * vdevid, for peer it is peerid and for tid, it is
  14375. * tid_num.
  14376. *
  14377. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14378. * in the host for this flow
  14379. * b'16:31 - reserved0: This field in reserved for the future. In case
  14380. * we have a hierarchical implementation (HCM) of
  14381. * pools, it can be used to indicate the ID of the
  14382. * parent-pool.
  14383. *
  14384. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14385. * Descriptors for this flow will be
  14386. * allocated from this pool in the host.
  14387. * b'16:31 - reserved1: This field in reserved for the future. In case
  14388. * we have a hierarchical implementation of pools,
  14389. * it can be used to indicate the max number of
  14390. * descriptors in the pool. The b'0:15 can be used
  14391. * to indicate min number of descriptors in the
  14392. * HCM scheme.
  14393. *
  14394. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14395. * we have a hierarchical implementation of pools,
  14396. * b'0:15 can be used to indicate the
  14397. * priority-based borrowing (PBB) threshold of
  14398. * the flow's pool. The b'16:31 are still left
  14399. * reserved.
  14400. */
  14401. enum htt_flow_type {
  14402. FLOW_TYPE_VDEV = 0,
  14403. /* Insert new flow types above this line */
  14404. };
  14405. PREPACK struct htt_flow_pool_map_payload_t {
  14406. A_UINT32 flow_type;
  14407. A_UINT32 flow_id;
  14408. A_UINT32 flow_pool_id:16,
  14409. reserved0:16;
  14410. A_UINT32 flow_pool_size:16,
  14411. reserved1:16;
  14412. A_UINT32 reserved2;
  14413. } POSTPACK;
  14414. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14415. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14416. (sizeof(struct htt_flow_pool_map_payload_t))
  14417. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14418. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14419. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14420. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14421. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14422. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14423. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14424. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14425. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14426. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14427. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14428. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14429. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14430. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14431. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14432. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14433. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14434. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14435. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14436. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14437. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14438. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14439. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14440. do { \
  14441. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14442. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14443. } while (0)
  14444. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14445. do { \
  14446. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14447. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14448. } while (0)
  14449. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14450. do { \
  14451. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14452. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14453. } while (0)
  14454. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14455. do { \
  14456. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14457. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14458. } while (0)
  14459. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14460. do { \
  14461. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14462. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14463. } while (0)
  14464. /**
  14465. * @brief target -> host flow pool unmap message
  14466. *
  14467. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14468. *
  14469. * @details
  14470. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14471. * down a flow of descriptors.
  14472. * This message indicates that for the flow (whose ID is provided) is wanting
  14473. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14474. * pool of descriptors from where descriptors are being allocated for this
  14475. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14476. * be unmapped by the host.
  14477. *
  14478. * The message would appear as follows:
  14479. *
  14480. * |31 24|23 16|15 8|7 0|
  14481. * |----------------+----------------+----------------+----------------|
  14482. * | reserved0 | msg_type |
  14483. * |-------------------------------------------------------------------|
  14484. * | flow_type |
  14485. * |-------------------------------------------------------------------|
  14486. * | flow_id |
  14487. * |-------------------------------------------------------------------|
  14488. * | reserved1 | flow_pool_id |
  14489. * |-------------------------------------------------------------------|
  14490. *
  14491. * The message is interpreted as follows:
  14492. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14493. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14494. * b'8:31 - reserved0: Reserved for future use
  14495. *
  14496. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14497. * this flow is associated. It can be VDEV, peer,
  14498. * or tid (AC). Based on enum htt_flow_type.
  14499. *
  14500. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14501. * object. For flow_type vdev it is set to the
  14502. * vdevid, for peer it is peerid and for tid, it is
  14503. * tid_num.
  14504. *
  14505. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14506. * used in the host for this flow
  14507. * b'16:31 - reserved0: This field in reserved for the future.
  14508. *
  14509. */
  14510. PREPACK struct htt_flow_pool_unmap_t {
  14511. A_UINT32 msg_type:8,
  14512. reserved0:24;
  14513. A_UINT32 flow_type;
  14514. A_UINT32 flow_id;
  14515. A_UINT32 flow_pool_id:16,
  14516. reserved1:16;
  14517. } POSTPACK;
  14518. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14519. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14520. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14521. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14522. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14523. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14524. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14525. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14526. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14527. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14528. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14529. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14530. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14531. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14532. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14533. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14534. do { \
  14535. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14536. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14537. } while (0)
  14538. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14539. do { \
  14540. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14541. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14542. } while (0)
  14543. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14544. do { \
  14545. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14546. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14547. } while (0)
  14548. /**
  14549. * @brief target -> host SRING setup done message
  14550. *
  14551. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14552. *
  14553. * @details
  14554. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14555. * SRNG ring setup is done
  14556. *
  14557. * This message indicates whether the last setup operation is successful.
  14558. * It will be sent to host when host set respose_required bit in
  14559. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14560. * The message would appear as follows:
  14561. *
  14562. * |31 24|23 16|15 8|7 0|
  14563. * |--------------- +----------------+----------------+----------------|
  14564. * | setup_status | ring_id | pdev_id | msg_type |
  14565. * |-------------------------------------------------------------------|
  14566. *
  14567. * The message is interpreted as follows:
  14568. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14569. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14570. * b'8:15 - pdev_id:
  14571. * 0 (for rings at SOC/UMAC level),
  14572. * 1/2/3 mac id (for rings at LMAC level)
  14573. * b'16:23 - ring_id: Identify the ring which is set up
  14574. * More details can be got from enum htt_srng_ring_id
  14575. * b'24:31 - setup_status: Indicate status of setup operation
  14576. * Refer to htt_ring_setup_status
  14577. */
  14578. PREPACK struct htt_sring_setup_done_t {
  14579. A_UINT32 msg_type: 8,
  14580. pdev_id: 8,
  14581. ring_id: 8,
  14582. setup_status: 8;
  14583. } POSTPACK;
  14584. enum htt_ring_setup_status {
  14585. htt_ring_setup_status_ok = 0,
  14586. htt_ring_setup_status_error,
  14587. };
  14588. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14589. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14590. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14591. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14592. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14593. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14594. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14595. do { \
  14596. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14597. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14598. } while (0)
  14599. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14600. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14601. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14602. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14603. HTT_SRING_SETUP_DONE_RING_ID_S)
  14604. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14605. do { \
  14606. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14607. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14608. } while (0)
  14609. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14610. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14611. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14612. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14613. HTT_SRING_SETUP_DONE_STATUS_S)
  14614. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14615. do { \
  14616. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14617. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14618. } while (0)
  14619. /**
  14620. * @brief target -> flow map flow info
  14621. *
  14622. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14623. *
  14624. * @details
  14625. * HTT TX map flow entry with tqm flow pointer
  14626. * Sent from firmware to host to add tqm flow pointer in corresponding
  14627. * flow search entry. Flow metadata is replayed back to host as part of this
  14628. * struct to enable host to find the specific flow search entry
  14629. *
  14630. * The message would appear as follows:
  14631. *
  14632. * |31 28|27 18|17 14|13 8|7 0|
  14633. * |-------+------------------------------------------+----------------|
  14634. * | rsvd0 | fse_hsh_idx | msg_type |
  14635. * |-------------------------------------------------------------------|
  14636. * | rsvd1 | tid | peer_id |
  14637. * |-------------------------------------------------------------------|
  14638. * | tqm_flow_pntr_lo |
  14639. * |-------------------------------------------------------------------|
  14640. * | tqm_flow_pntr_hi |
  14641. * |-------------------------------------------------------------------|
  14642. * | fse_meta_data |
  14643. * |-------------------------------------------------------------------|
  14644. *
  14645. * The message is interpreted as follows:
  14646. *
  14647. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14648. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14649. *
  14650. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14651. * for this flow entry
  14652. *
  14653. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14654. *
  14655. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14656. *
  14657. * dword1 - b'14:17 - tid
  14658. *
  14659. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14660. *
  14661. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14662. *
  14663. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14664. *
  14665. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14666. * given by host
  14667. */
  14668. PREPACK struct htt_tx_map_flow_info {
  14669. A_UINT32
  14670. msg_type: 8,
  14671. fse_hsh_idx: 20,
  14672. rsvd0: 4;
  14673. A_UINT32
  14674. peer_id: 14,
  14675. tid: 4,
  14676. rsvd1: 14;
  14677. A_UINT32 tqm_flow_pntr_lo;
  14678. A_UINT32 tqm_flow_pntr_hi;
  14679. struct htt_tx_flow_metadata fse_meta_data;
  14680. } POSTPACK;
  14681. /* DWORD 0 */
  14682. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14683. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14684. /* DWORD 1 */
  14685. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14686. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14687. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14688. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14689. /* DWORD 0 */
  14690. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14691. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14692. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14693. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14694. do { \
  14695. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14696. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14697. } while (0)
  14698. /* DWORD 1 */
  14699. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14700. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14701. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14702. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14703. do { \
  14704. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14705. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14706. } while (0)
  14707. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14708. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14709. HTT_TX_MAP_FLOW_INFO_TID_S)
  14710. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14711. do { \
  14712. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14713. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14714. } while (0)
  14715. /*
  14716. * htt_dbg_ext_stats_status -
  14717. * present - The requested stats have been delivered in full.
  14718. * This indicates that either the stats information was contained
  14719. * in its entirety within this message, or else this message
  14720. * completes the delivery of the requested stats info that was
  14721. * partially delivered through earlier STATS_CONF messages.
  14722. * partial - The requested stats have been delivered in part.
  14723. * One or more subsequent STATS_CONF messages with the same
  14724. * cookie value will be sent to deliver the remainder of the
  14725. * information.
  14726. * error - The requested stats could not be delivered, for example due
  14727. * to a shortage of memory to construct a message holding the
  14728. * requested stats.
  14729. * invalid - The requested stat type is either not recognized, or the
  14730. * target is configured to not gather the stats type in question.
  14731. */
  14732. enum htt_dbg_ext_stats_status {
  14733. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14734. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14735. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14736. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14737. };
  14738. /**
  14739. * @brief target -> host ppdu stats upload
  14740. *
  14741. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14742. *
  14743. * @details
  14744. * The following field definitions describe the format of the HTT target
  14745. * to host ppdu stats indication message.
  14746. *
  14747. *
  14748. * |31 16|15 12|11 10|9 8|7 0 |
  14749. * |----------------------------------------------------------------------|
  14750. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14751. * |----------------------------------------------------------------------|
  14752. * | ppdu_id |
  14753. * |----------------------------------------------------------------------|
  14754. * | Timestamp in us |
  14755. * |----------------------------------------------------------------------|
  14756. * | reserved |
  14757. * |----------------------------------------------------------------------|
  14758. * | type-specific stats info |
  14759. * | (see htt_ppdu_stats.h) |
  14760. * |----------------------------------------------------------------------|
  14761. * Header fields:
  14762. * - MSG_TYPE
  14763. * Bits 7:0
  14764. * Purpose: Identifies this is a PPDU STATS indication
  14765. * message.
  14766. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14767. * - mac_id
  14768. * Bits 9:8
  14769. * Purpose: mac_id of this ppdu_id
  14770. * Value: 0-3
  14771. * - pdev_id
  14772. * Bits 11:10
  14773. * Purpose: pdev_id of this ppdu_id
  14774. * Value: 0-3
  14775. * 0 (for rings at SOC level),
  14776. * 1/2/3 PDEV -> 0/1/2
  14777. * - payload_size
  14778. * Bits 31:16
  14779. * Purpose: total tlv size
  14780. * Value: payload_size in bytes
  14781. */
  14782. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14783. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14784. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14785. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14786. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14787. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14788. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14789. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14790. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14791. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14792. do { \
  14793. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14794. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14795. } while (0)
  14796. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14797. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14798. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14799. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14800. do { \
  14801. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14802. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14803. } while (0)
  14804. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14805. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14806. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14807. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14808. do { \
  14809. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14810. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14811. } while (0)
  14812. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14813. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14814. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14815. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14816. do { \
  14817. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14818. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14819. } while (0)
  14820. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14821. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14822. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14823. /* htt_t2h_ppdu_stats_ind_hdr_t
  14824. * This struct contains the fields within the header of the
  14825. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14826. * stats info.
  14827. * This struct assumes little-endian layout, and thus is only
  14828. * suitable for use within processors known to be little-endian
  14829. * (such as the target).
  14830. * In contrast, the above macros provide endian-portable methods
  14831. * to get and set the bitfields within this PPDU_STATS_IND header.
  14832. */
  14833. typedef struct {
  14834. A_UINT32 msg_type: 8, /* bits 7:0 */
  14835. mac_id: 2, /* bits 9:8 */
  14836. pdev_id: 2, /* bits 11:10 */
  14837. reserved1: 4, /* bits 15:12 */
  14838. payload_size: 16; /* bits 31:16 */
  14839. A_UINT32 ppdu_id;
  14840. A_UINT32 timestamp_us;
  14841. A_UINT32 reserved2;
  14842. } htt_t2h_ppdu_stats_ind_hdr_t;
  14843. /**
  14844. * @brief target -> host extended statistics upload
  14845. *
  14846. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14847. *
  14848. * @details
  14849. * The following field definitions describe the format of the HTT target
  14850. * to host stats upload confirmation message.
  14851. * The message contains a cookie echoed from the HTT host->target stats
  14852. * upload request, which identifies which request the confirmation is
  14853. * for, and a single stats can span over multiple HTT stats indication
  14854. * due to the HTT message size limitation so every HTT ext stats indication
  14855. * will have tag-length-value stats information elements.
  14856. * The tag-length header for each HTT stats IND message also includes a
  14857. * status field, to indicate whether the request for the stat type in
  14858. * question was fully met, partially met, unable to be met, or invalid
  14859. * (if the stat type in question is disabled in the target).
  14860. * A Done bit 1's indicate the end of the of stats info elements.
  14861. *
  14862. *
  14863. * |31 16|15 12|11|10 8|7 5|4 0|
  14864. * |--------------------------------------------------------------|
  14865. * | reserved | msg type |
  14866. * |--------------------------------------------------------------|
  14867. * | cookie LSBs |
  14868. * |--------------------------------------------------------------|
  14869. * | cookie MSBs |
  14870. * |--------------------------------------------------------------|
  14871. * | stats entry length | rsvd | D| S | stat type |
  14872. * |--------------------------------------------------------------|
  14873. * | type-specific stats info |
  14874. * | (see htt_stats.h) |
  14875. * |--------------------------------------------------------------|
  14876. * Header fields:
  14877. * - MSG_TYPE
  14878. * Bits 7:0
  14879. * Purpose: Identifies this is a extended statistics upload confirmation
  14880. * message.
  14881. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14882. * - COOKIE_LSBS
  14883. * Bits 31:0
  14884. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14885. * message with its preceding host->target stats request message.
  14886. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14887. * - COOKIE_MSBS
  14888. * Bits 31:0
  14889. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14890. * message with its preceding host->target stats request message.
  14891. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14892. *
  14893. * Stats Information Element tag-length header fields:
  14894. * - STAT_TYPE
  14895. * Bits 7:0
  14896. * Purpose: identifies the type of statistics info held in the
  14897. * following information element
  14898. * Value: htt_dbg_ext_stats_type
  14899. * - STATUS
  14900. * Bits 10:8
  14901. * Purpose: indicate whether the requested stats are present
  14902. * Value: htt_dbg_ext_stats_status
  14903. * - DONE
  14904. * Bits 11
  14905. * Purpose:
  14906. * Indicates the completion of the stats entry, this will be the last
  14907. * stats conf HTT segment for the requested stats type.
  14908. * Value:
  14909. * 0 -> the stats retrieval is ongoing
  14910. * 1 -> the stats retrieval is complete
  14911. * - LENGTH
  14912. * Bits 31:16
  14913. * Purpose: indicate the stats information size
  14914. * Value: This field specifies the number of bytes of stats information
  14915. * that follows the element tag-length header.
  14916. * It is expected but not required that this length is a multiple of
  14917. * 4 bytes.
  14918. */
  14919. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14920. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14921. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14922. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14923. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14924. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14925. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14926. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14927. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14928. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14929. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14930. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14931. do { \
  14932. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14933. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14934. } while (0)
  14935. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14936. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14937. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14938. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14939. do { \
  14940. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14941. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14942. } while (0)
  14943. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14944. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14945. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14946. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14947. do { \
  14948. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14949. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14950. } while (0)
  14951. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14952. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14953. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14954. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14955. do { \
  14956. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14957. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14958. } while (0)
  14959. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14960. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14961. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14962. /**
  14963. * @brief target -> host streaming statistics upload
  14964. *
  14965. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14966. *
  14967. * @details
  14968. * The following field definitions describe the format of the HTT target
  14969. * to host streaming stats upload indication message.
  14970. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14971. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14972. * use the STREAMING_STATS_REQ message to halt the target's production of
  14973. * STREAMING_STATS_IND messages.
  14974. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14975. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14976. *
  14977. * |31 8|7 0|
  14978. * |--------------------------------------------------------------|
  14979. * | reserved | msg type |
  14980. * |--------------------------------------------------------------|
  14981. * | type-specific stats info |
  14982. * | (see htt_stats.h) |
  14983. * |--------------------------------------------------------------|
  14984. * Header fields:
  14985. * - MSG_TYPE
  14986. * Bits 7:0
  14987. * Purpose: Identifies this as a streaming statistics upload indication
  14988. * message.
  14989. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14990. */
  14991. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14992. typedef enum {
  14993. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14994. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14995. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14996. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14997. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14998. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14999. /* Reserved from 128 - 255 for target internal use.*/
  15000. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15001. } HTT_PEER_TYPE;
  15002. /** macro to convert MAC address from char array to HTT word format */
  15003. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15004. (phtt_mac_addr)->mac_addr31to0 = \
  15005. (((c_macaddr)[0] << 0) | \
  15006. ((c_macaddr)[1] << 8) | \
  15007. ((c_macaddr)[2] << 16) | \
  15008. ((c_macaddr)[3] << 24)); \
  15009. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15010. } while (0)
  15011. /**
  15012. * @brief target -> host monitor mac header indication message
  15013. *
  15014. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15015. *
  15016. * @details
  15017. * The following diagram shows the format of the monitor mac header message
  15018. * sent from the target to the host.
  15019. * This message is primarily sent when promiscuous rx mode is enabled.
  15020. * One message is sent per rx PPDU.
  15021. *
  15022. * |31 24|23 16|15 8|7 0|
  15023. * |-------------------------------------------------------------|
  15024. * | peer_id | reserved0 | msg_type |
  15025. * |-------------------------------------------------------------|
  15026. * | reserved1 | num_mpdu |
  15027. * |-------------------------------------------------------------|
  15028. * | struct hw_rx_desc |
  15029. * | (see wal_rx_desc.h) |
  15030. * |-------------------------------------------------------------|
  15031. * | struct ieee80211_frame_addr4 |
  15032. * | (see ieee80211_defs.h) |
  15033. * |-------------------------------------------------------------|
  15034. * | struct ieee80211_frame_addr4 |
  15035. * | (see ieee80211_defs.h) |
  15036. * |-------------------------------------------------------------|
  15037. * | ...... |
  15038. * |-------------------------------------------------------------|
  15039. *
  15040. * Header fields:
  15041. * - msg_type
  15042. * Bits 7:0
  15043. * Purpose: Identifies this is a monitor mac header indication message.
  15044. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15045. * - peer_id
  15046. * Bits 31:16
  15047. * Purpose: Software peer id given by host during association,
  15048. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15049. * for rx PPDUs received from unassociated peers.
  15050. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15051. * - num_mpdu
  15052. * Bits 15:0
  15053. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15054. * delivered within the message.
  15055. * Value: 1 to 32
  15056. * num_mpdu is limited to a maximum value of 32, due to buffer
  15057. * size limits. For PPDUs with more than 32 MPDUs, only the
  15058. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15059. * the PPDU will be provided.
  15060. */
  15061. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15062. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15063. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15064. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15065. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15066. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15067. do { \
  15068. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15069. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15070. } while (0)
  15071. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15072. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15073. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15074. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15075. do { \
  15076. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15077. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15078. } while (0)
  15079. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15080. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15081. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15082. /**
  15083. * @brief target -> host flow pool resize Message
  15084. *
  15085. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15086. *
  15087. * @details
  15088. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15089. * the flow pool associated with the specified ID is resized
  15090. *
  15091. * The message would appear as follows:
  15092. *
  15093. * |31 16|15 8|7 0|
  15094. * |---------------------------------+----------------+----------------|
  15095. * | reserved0 | Msg type |
  15096. * |-------------------------------------------------------------------|
  15097. * | flow pool new size | flow pool ID |
  15098. * |-------------------------------------------------------------------|
  15099. *
  15100. * The message is interpreted as follows:
  15101. * b'0:7 - msg_type: This will be set to 0x21
  15102. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15103. *
  15104. * b'0:15 - flow pool ID: Existing flow pool ID
  15105. *
  15106. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15107. *
  15108. */
  15109. PREPACK struct htt_flow_pool_resize_t {
  15110. A_UINT32 msg_type:8,
  15111. reserved0:24;
  15112. A_UINT32 flow_pool_id:16,
  15113. flow_pool_new_size:16;
  15114. } POSTPACK;
  15115. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15116. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15117. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15118. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15119. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15120. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15121. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15122. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15123. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15124. do { \
  15125. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15126. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15127. } while (0)
  15128. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15129. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15130. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15131. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15132. do { \
  15133. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15134. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15135. } while (0)
  15136. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15137. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15138. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15139. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15140. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15141. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15142. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15143. /*
  15144. * The read and write indices point to the data within the host buffer.
  15145. * Because the first 4 bytes of the host buffer is used for the read index and
  15146. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15147. * The read index and write index are the byte offsets from the base of the
  15148. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15149. * Refer the ASCII text picture below.
  15150. */
  15151. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15152. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15153. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15154. /*
  15155. ***************************************************************************
  15156. *
  15157. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15158. *
  15159. ***************************************************************************
  15160. *
  15161. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15162. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15163. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15164. * written into the Host memory region mentioned below.
  15165. *
  15166. * Read index is updated by the Host. At any point of time, the read index will
  15167. * indicate the index that will next be read by the Host. The read index is
  15168. * in units of bytes offset from the base of the meta-data buffer.
  15169. *
  15170. * Write index is updated by the FW. At any point of time, the write index will
  15171. * indicate from where the FW can start writing any new data. The write index is
  15172. * in units of bytes offset from the base of the meta-data buffer.
  15173. *
  15174. * If the Host is not fast enough in reading the CFR data, any new capture data
  15175. * would be dropped if there is no space left to write the new captures.
  15176. *
  15177. * The last 4 bytes of the memory region will have the magic pattern
  15178. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15179. * not overrun the host buffer.
  15180. *
  15181. * ,--------------------. read and write indices store the
  15182. * | | byte offset from the base of the
  15183. * | ,--------+--------. meta-data buffer to the next
  15184. * | | | | location within the data buffer
  15185. * | | v v that will be read / written
  15186. * ************************************************************************
  15187. * * Read * Write * * Magic *
  15188. * * index * index * CFR data1 ...... CFR data N * pattern *
  15189. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15190. * ************************************************************************
  15191. * |<---------- data buffer ---------->|
  15192. *
  15193. * |<----------------- meta-data buffer allocated in Host ----------------|
  15194. *
  15195. * Note:
  15196. * - Considering the 4 bytes needed to store the Read index (R) and the
  15197. * Write index (W), the initial value is as follows:
  15198. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15199. * - Buffer empty condition:
  15200. * R = W
  15201. *
  15202. * Regarding CFR data format:
  15203. * --------------------------
  15204. *
  15205. * Each CFR tone is stored in HW as 16-bits with the following format:
  15206. * {bits[15:12], bits[11:6], bits[5:0]} =
  15207. * {unsigned exponent (4 bits),
  15208. * signed mantissa_real (6 bits),
  15209. * signed mantissa_imag (6 bits)}
  15210. *
  15211. * CFR_real = mantissa_real * 2^(exponent-5)
  15212. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15213. *
  15214. *
  15215. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15216. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15217. *
  15218. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15219. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15220. * .
  15221. * .
  15222. * .
  15223. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15224. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15225. */
  15226. /* Bandwidth of peer CFR captures */
  15227. typedef enum {
  15228. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15229. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15230. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15231. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15232. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15233. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15234. } HTT_PEER_CFR_CAPTURE_BW;
  15235. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15236. * was captured
  15237. */
  15238. typedef enum {
  15239. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15240. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15241. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15242. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15243. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15244. } HTT_PEER_CFR_CAPTURE_MODE;
  15245. typedef enum {
  15246. /* This message type is currently used for the below purpose:
  15247. *
  15248. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15249. * wmi_peer_cfr_capture_cmd.
  15250. * If payload_present bit is set to 0 then the associated memory region
  15251. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15252. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15253. * message; the CFR dump will be present at the end of the message,
  15254. * after the chan_phy_mode.
  15255. */
  15256. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15257. /* Always keep this last */
  15258. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15259. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15260. /**
  15261. * @brief target -> host CFR dump completion indication message definition
  15262. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15263. *
  15264. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15265. *
  15266. * @details
  15267. * The following diagram shows the format of the Channel Frequency Response
  15268. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15269. * the channel capture of a peer is copied by Firmware into the Host memory
  15270. *
  15271. * **************************************************************************
  15272. *
  15273. * Message format when the CFR capture message type is
  15274. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15275. *
  15276. * **************************************************************************
  15277. *
  15278. * |31 16|15 |8|7 0|
  15279. * |----------------------------------------------------------------|
  15280. * header: | reserved |P| msg_type |
  15281. * word 0 | | | |
  15282. * |----------------------------------------------------------------|
  15283. * payload: | cfr_capture_msg_type |
  15284. * word 1 | |
  15285. * |----------------------------------------------------------------|
  15286. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15287. * word 2 | | | | | | | | |
  15288. * |----------------------------------------------------------------|
  15289. * | mac_addr31to0 |
  15290. * word 3 | |
  15291. * |----------------------------------------------------------------|
  15292. * | unused / reserved | mac_addr47to32 |
  15293. * word 4 | | |
  15294. * |----------------------------------------------------------------|
  15295. * | index |
  15296. * word 5 | |
  15297. * |----------------------------------------------------------------|
  15298. * | length |
  15299. * word 6 | |
  15300. * |----------------------------------------------------------------|
  15301. * | timestamp |
  15302. * word 7 | |
  15303. * |----------------------------------------------------------------|
  15304. * | counter |
  15305. * word 8 | |
  15306. * |----------------------------------------------------------------|
  15307. * | chan_mhz |
  15308. * word 9 | |
  15309. * |----------------------------------------------------------------|
  15310. * | band_center_freq1 |
  15311. * word 10 | |
  15312. * |----------------------------------------------------------------|
  15313. * | band_center_freq2 |
  15314. * word 11 | |
  15315. * |----------------------------------------------------------------|
  15316. * | chan_phy_mode |
  15317. * word 12 | |
  15318. * |----------------------------------------------------------------|
  15319. * where,
  15320. * P - payload present bit (payload_present explained below)
  15321. * req_id - memory request id (mem_req_id explained below)
  15322. * S - status field (status explained below)
  15323. * capbw - capture bandwidth (capture_bw explained below)
  15324. * mode - mode of capture (mode explained below)
  15325. * sts - space time streams (sts_count explained below)
  15326. * chbw - channel bandwidth (channel_bw explained below)
  15327. * captype - capture type (cap_type explained below)
  15328. *
  15329. * The following field definitions describe the format of the CFR dump
  15330. * completion indication sent from the target to the host
  15331. *
  15332. * Header fields:
  15333. *
  15334. * Word 0
  15335. * - msg_type
  15336. * Bits 7:0
  15337. * Purpose: Identifies this as CFR TX completion indication
  15338. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15339. * - payload_present
  15340. * Bit 8
  15341. * Purpose: Identifies how CFR data is sent to host
  15342. * Value: 0 - If CFR Payload is written to host memory
  15343. * 1 - If CFR Payload is sent as part of HTT message
  15344. * (This is the requirement for SDIO/USB where it is
  15345. * not possible to write CFR data to host memory)
  15346. * - reserved
  15347. * Bits 31:9
  15348. * Purpose: Reserved
  15349. * Value: 0
  15350. *
  15351. * Payload fields:
  15352. *
  15353. * Word 1
  15354. * - cfr_capture_msg_type
  15355. * Bits 31:0
  15356. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15357. * to specify the format used for the remainder of the message
  15358. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15359. * (currently only MSG_TYPE_1 is defined)
  15360. *
  15361. * Word 2
  15362. * - mem_req_id
  15363. * Bits 6:0
  15364. * Purpose: Contain the mem request id of the region where the CFR capture
  15365. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15366. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15367. this value is invalid)
  15368. * - status
  15369. * Bit 7
  15370. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15371. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15372. * - capture_bw
  15373. * Bits 10:8
  15374. * Purpose: Carry the bandwidth of the CFR capture
  15375. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15376. * - mode
  15377. * Bits 13:11
  15378. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15379. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15380. * - sts_count
  15381. * Bits 16:14
  15382. * Purpose: Carry the number of space time streams
  15383. * Value: Number of space time streams
  15384. * - channel_bw
  15385. * Bits 19:17
  15386. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15387. * measurement
  15388. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15389. * - cap_type
  15390. * Bits 23:20
  15391. * Purpose: Carry the type of the capture
  15392. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15393. * - vdev_id
  15394. * Bits 31:24
  15395. * Purpose: Carry the virtual device id
  15396. * Value: vdev ID
  15397. *
  15398. * Word 3
  15399. * - mac_addr31to0
  15400. * Bits 31:0
  15401. * Purpose: Contain the bits 31:0 of the peer MAC address
  15402. * Value: Bits 31:0 of the peer MAC address
  15403. *
  15404. * Word 4
  15405. * - mac_addr47to32
  15406. * Bits 15:0
  15407. * Purpose: Contain the bits 47:32 of the peer MAC address
  15408. * Value: Bits 47:32 of the peer MAC address
  15409. *
  15410. * Word 5
  15411. * - index
  15412. * Bits 31:0
  15413. * Purpose: Contain the index at which this CFR dump was written in the Host
  15414. * allocated memory. This index is the number of bytes from the base address.
  15415. * Value: Index position
  15416. *
  15417. * Word 6
  15418. * - length
  15419. * Bits 31:0
  15420. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15421. * Value: Length of the CFR capture of the peer
  15422. *
  15423. * Word 7
  15424. * - timestamp
  15425. * Bits 31:0
  15426. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15427. * clock used for this timestamp is private to the target and not visible to
  15428. * the host i.e., Host can interpret only the relative timestamp deltas from
  15429. * one message to the next, but can't interpret the absolute timestamp from a
  15430. * single message.
  15431. * Value: Timestamp in microseconds
  15432. *
  15433. * Word 8
  15434. * - counter
  15435. * Bits 31:0
  15436. * Purpose: Carry the count of the current CFR capture from FW. This is
  15437. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15438. * in host memory)
  15439. * Value: Count of the current CFR capture
  15440. *
  15441. * Word 9
  15442. * - chan_mhz
  15443. * Bits 31:0
  15444. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15445. * Value: Primary 20 channel frequency
  15446. *
  15447. * Word 10
  15448. * - band_center_freq1
  15449. * Bits 31:0
  15450. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15451. * Value: Center frequency 1 in MHz
  15452. *
  15453. * Word 11
  15454. * - band_center_freq2
  15455. * Bits 31:0
  15456. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15457. * the VDEV
  15458. * 80plus80 mode
  15459. * Value: Center frequency 2 in MHz
  15460. *
  15461. * Word 12
  15462. * - chan_phy_mode
  15463. * Bits 31:0
  15464. * Purpose: Carry the phy mode of the channel, of the VDEV
  15465. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15466. */
  15467. PREPACK struct htt_cfr_dump_ind_type_1 {
  15468. A_UINT32 mem_req_id:7,
  15469. status:1,
  15470. capture_bw:3,
  15471. mode:3,
  15472. sts_count:3,
  15473. channel_bw:3,
  15474. cap_type:4,
  15475. vdev_id:8;
  15476. htt_mac_addr addr;
  15477. A_UINT32 index;
  15478. A_UINT32 length;
  15479. A_UINT32 timestamp;
  15480. A_UINT32 counter;
  15481. struct htt_chan_change_msg chan;
  15482. } POSTPACK;
  15483. PREPACK struct htt_cfr_dump_compl_ind {
  15484. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15485. union {
  15486. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15487. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15488. /* If there is a need to change the memory layout and its associated
  15489. * HTT indication format, a new CFR capture message type can be
  15490. * introduced and added into this union.
  15491. */
  15492. };
  15493. } POSTPACK;
  15494. /*
  15495. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15496. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15497. */
  15498. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15499. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15500. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15501. do { \
  15502. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15503. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15504. } while(0)
  15505. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15506. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15507. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15508. /*
  15509. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15510. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15511. */
  15512. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15513. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15514. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15515. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15516. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15517. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15518. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15519. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15520. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15521. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15522. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15523. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15524. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15525. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15526. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15527. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15528. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15529. do { \
  15530. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15531. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15532. } while (0)
  15533. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15534. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15535. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15536. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15537. do { \
  15538. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15539. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15540. } while (0)
  15541. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15542. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15543. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15544. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15545. do { \
  15546. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15547. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15548. } while (0)
  15549. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15550. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15551. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15552. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15553. do { \
  15554. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15555. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15556. } while (0)
  15557. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15558. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15559. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15560. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15561. do { \
  15562. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15563. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15564. } while (0)
  15565. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15566. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15567. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15568. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15569. do { \
  15570. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15571. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15572. } while (0)
  15573. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15574. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15575. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15576. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15577. do { \
  15578. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15579. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15580. } while (0)
  15581. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15582. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15583. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15584. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15585. do { \
  15586. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15587. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15588. } while (0)
  15589. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15590. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15591. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15592. /**
  15593. * @brief target -> host peer (PPDU) stats message
  15594. *
  15595. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15596. *
  15597. * @details
  15598. * This message is generated by FW when FW is sending stats to host
  15599. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15600. * This message is sent autonomously by the target rather than upon request
  15601. * by the host.
  15602. * The following field definitions describe the format of the HTT target
  15603. * to host peer stats indication message.
  15604. *
  15605. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15606. * or more PPDU stats records.
  15607. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15608. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15609. * then the message would start with the
  15610. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15611. * below.
  15612. *
  15613. * |31 16|15|14|13 11|10 9|8|7 0|
  15614. * |-------------------------------------------------------------|
  15615. * | reserved |MSG_TYPE |
  15616. * |-------------------------------------------------------------|
  15617. * rec 0 | TLV header |
  15618. * rec 0 |-------------------------------------------------------------|
  15619. * rec 0 | ppdu successful bytes |
  15620. * rec 0 |-------------------------------------------------------------|
  15621. * rec 0 | ppdu retry bytes |
  15622. * rec 0 |-------------------------------------------------------------|
  15623. * rec 0 | ppdu failed bytes |
  15624. * rec 0 |-------------------------------------------------------------|
  15625. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15626. * rec 0 |-------------------------------------------------------------|
  15627. * rec 0 | retried MSDUs | successful MSDUs |
  15628. * rec 0 |-------------------------------------------------------------|
  15629. * rec 0 | TX duration | failed MSDUs |
  15630. * rec 0 |-------------------------------------------------------------|
  15631. * ...
  15632. * |-------------------------------------------------------------|
  15633. * rec N | TLV header |
  15634. * rec N |-------------------------------------------------------------|
  15635. * rec N | ppdu successful bytes |
  15636. * rec N |-------------------------------------------------------------|
  15637. * rec N | ppdu retry bytes |
  15638. * rec N |-------------------------------------------------------------|
  15639. * rec N | ppdu failed bytes |
  15640. * rec N |-------------------------------------------------------------|
  15641. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15642. * rec N |-------------------------------------------------------------|
  15643. * rec N | retried MSDUs | successful MSDUs |
  15644. * rec N |-------------------------------------------------------------|
  15645. * rec N | TX duration | failed MSDUs |
  15646. * rec N |-------------------------------------------------------------|
  15647. *
  15648. * where:
  15649. * A = is A-MPDU flag
  15650. * BA = block-ack failure flags
  15651. * BW = bandwidth spec
  15652. * SG = SGI enabled spec
  15653. * S = skipped rate ctrl
  15654. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15655. *
  15656. * Header
  15657. * ------
  15658. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15659. * dword0 - b'8:31 - reserved : Reserved for future use
  15660. *
  15661. * payload include below peer_stats information
  15662. * --------------------------------------------
  15663. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15664. * @tx_success_bytes : total successful bytes in the PPDU.
  15665. * @tx_retry_bytes : total retried bytes in the PPDU.
  15666. * @tx_failed_bytes : total failed bytes in the PPDU.
  15667. * @tx_ratecode : rate code used for the PPDU.
  15668. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15669. * @ba_ack_failed : BA/ACK failed for this PPDU
  15670. * b00 -> BA received
  15671. * b01 -> BA failed once
  15672. * b10 -> BA failed twice, when HW retry is enabled.
  15673. * @bw : BW
  15674. * b00 -> 20 MHz
  15675. * b01 -> 40 MHz
  15676. * b10 -> 80 MHz
  15677. * b11 -> 160 MHz (or 80+80)
  15678. * @sg : SGI enabled
  15679. * @s : skipped ratectrl
  15680. * @peer_id : peer id
  15681. * @tx_success_msdus : successful MSDUs
  15682. * @tx_retry_msdus : retried MSDUs
  15683. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15684. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15685. */
  15686. /**
  15687. * @brief target -> host backpressure event
  15688. *
  15689. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15690. *
  15691. * @details
  15692. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15693. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15694. * This message will only be sent if the backpressure condition has existed
  15695. * continuously for an initial period (100 ms).
  15696. * Repeat messages with updated information will be sent after each
  15697. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15698. * This message indicates the ring id along with current head and tail index
  15699. * locations (i.e. write and read indices).
  15700. * The backpressure time indicates the time in ms for which continous
  15701. * backpressure has been observed in the ring.
  15702. *
  15703. * The message format is as follows:
  15704. *
  15705. * |31 24|23 16|15 8|7 0|
  15706. * |----------------+----------------+----------------+----------------|
  15707. * | ring_id | ring_type | pdev_id | msg_type |
  15708. * |-------------------------------------------------------------------|
  15709. * | tail_idx | head_idx |
  15710. * |-------------------------------------------------------------------|
  15711. * | backpressure_time_ms |
  15712. * |-------------------------------------------------------------------|
  15713. *
  15714. * The message is interpreted as follows:
  15715. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15716. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15717. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15718. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15719. the msg is for LMAC ring.
  15720. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15721. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15722. * htt_backpressure_lmac_ring_id. This represents
  15723. * the ring id for which continous backpressure is seen
  15724. *
  15725. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15726. * the ring indicated by the ring_id
  15727. *
  15728. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15729. * the ring indicated by the ring id
  15730. *
  15731. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15732. * backpressure has been seen in the ring
  15733. * indicated by the ring_id.
  15734. * Units = milliseconds
  15735. */
  15736. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15737. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15738. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15739. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15740. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15741. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15742. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15743. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15744. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15745. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15746. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15747. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15748. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15749. do { \
  15750. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15751. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15752. } while (0)
  15753. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15754. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15755. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15756. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15757. do { \
  15758. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15759. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15760. } while (0)
  15761. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15762. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15763. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15764. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15765. do { \
  15766. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15767. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15768. } while (0)
  15769. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15770. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15771. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15772. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15773. do { \
  15774. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15775. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15776. } while (0)
  15777. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15778. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15779. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15780. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15781. do { \
  15782. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15783. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15784. } while (0)
  15785. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15786. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15787. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15788. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15789. do { \
  15790. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15791. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15792. } while (0)
  15793. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15794. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15795. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15796. enum htt_backpressure_ring_type {
  15797. HTT_SW_RING_TYPE_UMAC,
  15798. HTT_SW_RING_TYPE_LMAC,
  15799. HTT_SW_RING_TYPE_MAX,
  15800. };
  15801. /* Ring id for which the message is sent to host */
  15802. enum htt_backpressure_umac_ringid {
  15803. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15804. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15805. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15806. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15807. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15808. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15809. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15810. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15811. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15812. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15813. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15814. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15815. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15816. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15817. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15818. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15819. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15820. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15821. HTT_SW_UMAC_RING_IDX_MAX,
  15822. };
  15823. enum htt_backpressure_lmac_ringid {
  15824. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15825. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15826. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15827. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15828. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15829. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15830. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15831. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15832. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15833. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15834. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15835. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15836. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15837. HTT_SW_LMAC_RING_IDX_MAX,
  15838. };
  15839. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15840. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15841. pdev_id: 8,
  15842. ring_type: 8, /* htt_backpressure_ring_type */
  15843. /*
  15844. * ring_id holds an enum value from either
  15845. * htt_backpressure_umac_ringid or
  15846. * htt_backpressure_lmac_ringid, based on
  15847. * the ring_type setting.
  15848. */
  15849. ring_id: 8;
  15850. A_UINT16 head_idx;
  15851. A_UINT16 tail_idx;
  15852. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15853. } POSTPACK;
  15854. /*
  15855. * Defines two 32 bit words that can be used by the target to indicate a per
  15856. * user RU allocation and rate information.
  15857. *
  15858. * This information is currently provided in the "sw_response_reference_ptr"
  15859. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15860. * "rx_ppdu_end_user_stats" TLV.
  15861. *
  15862. * VALID:
  15863. * The consumer of these words must explicitly check the valid bit,
  15864. * and only attempt interpretation of any of the remaining fields if
  15865. * the valid bit is set to 1.
  15866. *
  15867. * VERSION:
  15868. * The consumer of these words must also explicitly check the version bit,
  15869. * and only use the V0 definition if the VERSION field is set to 0.
  15870. *
  15871. * Version 1 is currently undefined, with the exception of the VALID and
  15872. * VERSION fields.
  15873. *
  15874. * Version 0:
  15875. *
  15876. * The fields below are duplicated per BW.
  15877. *
  15878. * The consumer must determine which BW field to use, based on the UL OFDMA
  15879. * PPDU BW indicated by HW.
  15880. *
  15881. * RU_START: RU26 start index for the user.
  15882. * Note that this is always using the RU26 index, regardless
  15883. * of the actual RU assigned to the user
  15884. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15885. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15886. *
  15887. * For example, 20MHz (the value in the top row is RU_START)
  15888. *
  15889. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15890. * RU Size 1 (52): | | | | | |
  15891. * RU Size 2 (106): | | | |
  15892. * RU Size 3 (242): | |
  15893. *
  15894. * RU_SIZE: Indicates the RU size, as defined by enum
  15895. * htt_ul_ofdma_user_info_ru_size.
  15896. *
  15897. * LDPC: LDPC enabled (if 0, BCC is used)
  15898. *
  15899. * DCM: DCM enabled
  15900. *
  15901. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15902. * |---------------------------------+--------------------------------|
  15903. * |Ver|Valid| FW internal |
  15904. * |---------------------------------+--------------------------------|
  15905. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15906. * |---------------------------------+--------------------------------|
  15907. */
  15908. enum htt_ul_ofdma_user_info_ru_size {
  15909. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15910. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15911. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15912. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15913. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15914. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15915. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15916. };
  15917. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15918. struct htt_ul_ofdma_user_info_v0 {
  15919. A_UINT32 word0;
  15920. A_UINT32 word1;
  15921. };
  15922. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15923. A_UINT32 w0_fw_rsvd:30; \
  15924. A_UINT32 w0_valid:1; \
  15925. A_UINT32 w0_version:1;
  15926. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15927. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15928. };
  15929. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15930. A_UINT32 w1_nss:3; \
  15931. A_UINT32 w1_mcs:4; \
  15932. A_UINT32 w1_ldpc:1; \
  15933. A_UINT32 w1_dcm:1; \
  15934. A_UINT32 w1_ru_start:7; \
  15935. A_UINT32 w1_ru_size:3; \
  15936. A_UINT32 w1_trig_type:4; \
  15937. A_UINT32 w1_unused:9;
  15938. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15939. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15940. };
  15941. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15942. A_UINT32 w0_fw_rsvd:27; \
  15943. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15944. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15945. 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) */
  15946. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15947. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15948. };
  15949. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15950. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15951. A_UINT32 w1_trig_type:4; \
  15952. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15953. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15954. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15955. };
  15956. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15957. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15958. union {
  15959. A_UINT32 word0;
  15960. struct {
  15961. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15962. };
  15963. };
  15964. union {
  15965. A_UINT32 word1;
  15966. struct {
  15967. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15968. };
  15969. };
  15970. } POSTPACK;
  15971. /*
  15972. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15973. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15974. * this should be picked.
  15975. */
  15976. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15977. union {
  15978. A_UINT32 word0;
  15979. struct {
  15980. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15981. };
  15982. };
  15983. union {
  15984. A_UINT32 word1;
  15985. struct {
  15986. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15987. };
  15988. };
  15989. } POSTPACK;
  15990. enum HTT_UL_OFDMA_TRIG_TYPE {
  15991. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15992. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15993. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15994. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15995. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15996. };
  15997. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15998. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15999. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16000. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16001. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16002. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16003. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16004. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16005. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16006. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16007. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16008. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16009. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16010. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16011. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16012. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16013. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16014. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16015. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16016. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16017. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16018. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16019. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16020. /*--- word 0 ---*/
  16021. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16022. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16023. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16024. do { \
  16025. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16026. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16027. } while (0)
  16028. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16029. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16030. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16031. do { \
  16032. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16033. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16034. } while (0)
  16035. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16036. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16037. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16038. do { \
  16039. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16040. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16041. } while (0)
  16042. /*--- word 1 ---*/
  16043. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16044. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16045. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16046. do { \
  16047. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16048. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16049. } while (0)
  16050. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16051. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16052. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16053. do { \
  16054. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16055. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16056. } while (0)
  16057. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16058. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16059. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16060. do { \
  16061. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16062. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16063. } while (0)
  16064. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16065. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16066. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16067. do { \
  16068. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16069. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16070. } while (0)
  16071. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16072. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16073. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16074. do { \
  16075. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16076. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16077. } while (0)
  16078. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16079. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16080. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16081. do { \
  16082. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16083. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16084. } while (0)
  16085. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16086. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16087. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16088. do { \
  16089. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16090. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16091. } while (0)
  16092. /**
  16093. * @brief target -> host channel calibration data message
  16094. *
  16095. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16096. *
  16097. * @brief host -> target channel calibration data message
  16098. *
  16099. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16100. *
  16101. * @details
  16102. * The following field definitions describe the format of the channel
  16103. * calibration data message sent from the target to the host when
  16104. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16105. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16106. * The message is defined as htt_chan_caldata_msg followed by a variable
  16107. * number of 32-bit character values.
  16108. *
  16109. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16110. * |------------------------------------------------------------------|
  16111. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16112. * |------------------------------------------------------------------|
  16113. * | payload size | mhz |
  16114. * |------------------------------------------------------------------|
  16115. * | center frequency 2 | center frequency 1 |
  16116. * |------------------------------------------------------------------|
  16117. * | check sum |
  16118. * |------------------------------------------------------------------|
  16119. * | payload |
  16120. * |------------------------------------------------------------------|
  16121. * message info field:
  16122. * - MSG_TYPE
  16123. * Bits 7:0
  16124. * Purpose: identifies this as a channel calibration data message
  16125. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16126. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16127. * - SUB_TYPE
  16128. * Bits 11:8
  16129. * Purpose: T2H: indicates whether target is providing chan cal data
  16130. * to the host to store, or requesting that the host
  16131. * download previously-stored data.
  16132. * H2T: indicates whether the host is providing the requested
  16133. * channel cal data, or if it is rejecting the data
  16134. * request because it does not have the requested data.
  16135. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16136. * - CHKSUM_VALID
  16137. * Bit 12
  16138. * Purpose: indicates if the checksum field is valid
  16139. * value:
  16140. * - FRAG
  16141. * Bit 19:16
  16142. * Purpose: indicates the fragment index for message
  16143. * value: 0 for first fragment, 1 for second fragment, ...
  16144. * - APPEND
  16145. * Bit 20
  16146. * Purpose: indicates if this is the last fragment
  16147. * value: 0 = final fragment, 1 = more fragments will be appended
  16148. *
  16149. * channel and payload size field
  16150. * - MHZ
  16151. * Bits 15:0
  16152. * Purpose: indicates the channel primary frequency
  16153. * Value:
  16154. * - PAYLOAD_SIZE
  16155. * Bits 31:16
  16156. * Purpose: indicates the bytes of calibration data in payload
  16157. * Value:
  16158. *
  16159. * center frequency field
  16160. * - CENTER FREQUENCY 1
  16161. * Bits 15:0
  16162. * Purpose: indicates the channel center frequency
  16163. * Value: channel center frequency, in MHz units
  16164. * - CENTER FREQUENCY 2
  16165. * Bits 31:16
  16166. * Purpose: indicates the secondary channel center frequency,
  16167. * only for 11acvht 80plus80 mode
  16168. * Value: secondary channel center frequeny, in MHz units, if applicable
  16169. *
  16170. * checksum field
  16171. * - CHECK_SUM
  16172. * Bits 31:0
  16173. * Purpose: check the payload data, it is just for this fragment.
  16174. * This is intended for the target to check that the channel
  16175. * calibration data returned by the host is the unmodified data
  16176. * that was previously provided to the host by the target.
  16177. * value: checksum of fragment payload
  16178. */
  16179. PREPACK struct htt_chan_caldata_msg {
  16180. /* DWORD 0: message info */
  16181. A_UINT32
  16182. msg_type: 8,
  16183. sub_type: 4 ,
  16184. chksum_valid: 1, /** 1:valid, 0:invalid */
  16185. reserved1: 3,
  16186. frag_idx: 4, /** fragment index for calibration data */
  16187. appending: 1, /** 0: no fragment appending,
  16188. * 1: extra fragment appending */
  16189. reserved2: 11;
  16190. /* DWORD 1: channel and payload size */
  16191. A_UINT32
  16192. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16193. payload_size: 16; /** unit: bytes */
  16194. /* DWORD 2: center frequency */
  16195. A_UINT32
  16196. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16197. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16198. * valid only for 11acvht 80plus80 mode */
  16199. /* DWORD 3: check sum */
  16200. A_UINT32 chksum;
  16201. /* variable length for calibration data */
  16202. A_UINT32 payload[1/* or more */];
  16203. } POSTPACK;
  16204. /* T2H SUBTYPE */
  16205. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16206. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16207. /* H2T SUBTYPE */
  16208. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16209. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16210. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16211. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16212. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16213. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16214. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16215. do { \
  16216. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16217. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16218. } while (0)
  16219. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16220. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16221. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16222. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16223. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16224. do { \
  16225. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16226. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16227. } while (0)
  16228. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16229. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16230. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16231. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16232. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16233. do { \
  16234. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16235. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16236. } while (0)
  16237. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16238. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16239. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16240. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16241. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16242. do { \
  16243. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16244. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16245. } while (0)
  16246. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16247. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16248. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16249. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16250. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16251. do { \
  16252. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16253. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16254. } while (0)
  16255. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16256. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16257. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16258. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16259. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16260. do { \
  16261. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16262. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16263. } while (0)
  16264. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16265. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16266. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16267. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16268. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16269. do { \
  16270. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16271. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16272. } while (0)
  16273. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16274. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16275. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16276. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16277. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16278. do { \
  16279. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16280. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16281. } while (0)
  16282. /**
  16283. * @brief target -> host FSE CMEM based send
  16284. *
  16285. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16286. *
  16287. * @details
  16288. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16289. * FSE placement in CMEM is enabled.
  16290. *
  16291. * This message sends the non-secure CMEM base address.
  16292. * It will be sent to host in response to message
  16293. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16294. * The message would appear as follows:
  16295. *
  16296. * |31 24|23 16|15 8|7 0|
  16297. * |----------------+----------------+----------------+----------------|
  16298. * | reserved | num_entries | msg_type |
  16299. * |----------------+----------------+----------------+----------------|
  16300. * | base_address_lo |
  16301. * |----------------+----------------+----------------+----------------|
  16302. * | base_address_hi |
  16303. * |-------------------------------------------------------------------|
  16304. *
  16305. * The message is interpreted as follows:
  16306. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16307. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16308. * b'8:15 - number_entries: Indicated the number of entries
  16309. * programmed.
  16310. * b'16:31 - reserved.
  16311. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16312. * CMEM base address
  16313. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16314. * CMEM base address
  16315. */
  16316. PREPACK struct htt_cmem_base_send_t {
  16317. A_UINT32 msg_type: 8,
  16318. num_entries: 8,
  16319. reserved: 16;
  16320. A_UINT32 base_address_lo;
  16321. A_UINT32 base_address_hi;
  16322. } POSTPACK;
  16323. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16324. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16325. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16326. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16327. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16328. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16329. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16330. do { \
  16331. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16332. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16333. } while (0)
  16334. /**
  16335. * @brief - HTT PPDU ID format
  16336. *
  16337. * @details
  16338. * The following field definitions describe the format of the PPDU ID.
  16339. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16340. *
  16341. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16342. * +--------------------------------------------------------------------------
  16343. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16344. * +--------------------------------------------------------------------------
  16345. *
  16346. * sch id :Schedule command id
  16347. * Bits [11 : 0] : monotonically increasing counter to track the
  16348. * PPDU posted to a specific transmit queue.
  16349. *
  16350. * hwq_id: Hardware Queue ID.
  16351. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16352. *
  16353. * mac_id: MAC ID
  16354. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16355. *
  16356. * seq_idx: Sequence index.
  16357. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16358. * a particular TXOP.
  16359. *
  16360. * tqm_cmd: HWSCH/TQM flag.
  16361. * Bit [23] : Always set to 0.
  16362. *
  16363. * seq_cmd_type: Sequence command type.
  16364. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16365. * Refer to enum HTT_STATS_FTYPE for values.
  16366. */
  16367. PREPACK struct htt_ppdu_id {
  16368. A_UINT32
  16369. sch_id: 12,
  16370. hwq_id: 5,
  16371. mac_id: 2,
  16372. seq_idx: 2,
  16373. reserved1: 2,
  16374. tqm_cmd: 1,
  16375. seq_cmd_type: 6,
  16376. reserved2: 2;
  16377. } POSTPACK;
  16378. #define HTT_PPDU_ID_SCH_ID_S 0
  16379. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16380. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16381. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16382. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16383. do { \
  16384. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16385. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16386. } while (0)
  16387. #define HTT_PPDU_ID_HWQ_ID_S 12
  16388. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16389. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16390. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16391. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16392. do { \
  16393. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16394. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16395. } while (0)
  16396. #define HTT_PPDU_ID_MAC_ID_S 17
  16397. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16398. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16399. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16400. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16401. do { \
  16402. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16403. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16404. } while (0)
  16405. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16406. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16407. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16408. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16409. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16410. do { \
  16411. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16412. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16413. } while (0)
  16414. #define HTT_PPDU_ID_TQM_CMD_S 23
  16415. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16416. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16417. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16418. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16419. do { \
  16420. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16421. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16422. } while (0)
  16423. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16424. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16425. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16426. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16427. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16428. do { \
  16429. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16430. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16431. } while (0)
  16432. /**
  16433. * @brief target -> RX PEER METADATA V0 format
  16434. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16435. * message from target, and will confirm to the target which peer metadata
  16436. * version to use in the wmi_init message.
  16437. *
  16438. * The following diagram shows the format of the RX PEER METADATA.
  16439. *
  16440. * |31 24|23 16|15 8|7 0|
  16441. * |-----------------------------------------------------------------------|
  16442. * | Reserved | VDEV ID | PEER ID |
  16443. * |-----------------------------------------------------------------------|
  16444. */
  16445. PREPACK struct htt_rx_peer_metadata_v0 {
  16446. A_UINT32
  16447. peer_id: 16,
  16448. vdev_id: 8,
  16449. reserved1: 8;
  16450. } POSTPACK;
  16451. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16452. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16453. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16454. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16455. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16456. do { \
  16457. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16458. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16459. } while (0)
  16460. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16461. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16462. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16463. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16464. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16465. do { \
  16466. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16467. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16468. } while (0)
  16469. /**
  16470. * @brief target -> RX PEER METADATA V1 format
  16471. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16472. * message from target, and will confirm to the target which peer metadata
  16473. * version to use in the wmi_init message.
  16474. *
  16475. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16476. *
  16477. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16478. * |-----------------------------------------------------------------------|
  16479. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16480. * |-----------------------------------------------------------------------|
  16481. */
  16482. PREPACK struct htt_rx_peer_metadata_v1 {
  16483. A_UINT32
  16484. peer_id: 13,
  16485. ml_peer_valid: 1,
  16486. reserved1: 2,
  16487. vdev_id: 8,
  16488. lmac_id: 2,
  16489. chip_id: 3,
  16490. reserved2: 3;
  16491. } POSTPACK;
  16492. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16493. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16494. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16495. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16496. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16497. do { \
  16498. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16499. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16500. } while (0)
  16501. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16502. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16503. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16504. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16505. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16506. do { \
  16507. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16508. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16509. } while (0)
  16510. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16511. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16512. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16513. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16514. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16515. do { \
  16516. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16517. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16518. } while (0)
  16519. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16520. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16521. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16522. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16523. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16524. do { \
  16525. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16526. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16527. } while (0)
  16528. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16529. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16530. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16531. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16532. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16533. do { \
  16534. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16535. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16536. } while (0)
  16537. /*
  16538. * In some systems, the host SW wants to specify priorities between
  16539. * different MSDU / flow queues within the same peer-TID.
  16540. * The below enums are used for the host to identify to the target
  16541. * which MSDU queue's priority it wants to adjust.
  16542. */
  16543. /*
  16544. * The MSDUQ index describe index of TCL HW, where each index is
  16545. * used for queuing particular types of MSDUs.
  16546. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16547. */
  16548. enum HTT_MSDUQ_INDEX {
  16549. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16550. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16551. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16552. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16553. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16554. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16555. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16556. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16557. HTT_MSDUQ_MAX_INDEX,
  16558. };
  16559. /* MSDU qtype definition */
  16560. enum HTT_MSDU_QTYPE {
  16561. /*
  16562. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16563. * relative priority. Instead, the relative priority of CRIT_0 versus
  16564. * CRIT_1 is controlled by the FW, through the configuration parameters
  16565. * it applies to the queues.
  16566. */
  16567. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16568. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16569. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16570. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16571. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16572. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16573. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16574. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16575. /* New MSDU_QTYPE should be added above this line */
  16576. /*
  16577. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16578. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16579. * any host/target message definitions. The QTYPE_MAX value can
  16580. * only be used internally within the host or within the target.
  16581. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16582. * it must regard the unexpected value as a default qtype value,
  16583. * or ignore it.
  16584. */
  16585. HTT_MSDU_QTYPE_MAX,
  16586. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16587. };
  16588. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16589. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16590. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16591. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16592. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16593. };
  16594. /**
  16595. * @brief target -> host mlo timestamp offset indication
  16596. *
  16597. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16598. *
  16599. * @details
  16600. * The following field definitions describe the format of the HTT target
  16601. * to host mlo timestamp offset indication message.
  16602. *
  16603. *
  16604. * |31 16|15 12|11 10|9 8|7 0 |
  16605. * |----------------------------------------------------------------------|
  16606. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16607. * |----------------------------------------------------------------------|
  16608. * | Sync time stamp lo in us |
  16609. * |----------------------------------------------------------------------|
  16610. * | Sync time stamp hi in us |
  16611. * |----------------------------------------------------------------------|
  16612. * | mlo time stamp offset lo in us |
  16613. * |----------------------------------------------------------------------|
  16614. * | mlo time stamp offset hi in us |
  16615. * |----------------------------------------------------------------------|
  16616. * | mlo time stamp offset clocks in clock ticks |
  16617. * |----------------------------------------------------------------------|
  16618. * |31 26|25 16|15 0 |
  16619. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16620. * | | compensation in clks | |
  16621. * |----------------------------------------------------------------------|
  16622. * |31 22|21 0 |
  16623. * | rsvd 3 | mlo time stamp comp timer period |
  16624. * |----------------------------------------------------------------------|
  16625. * The message is interpreted as follows:
  16626. *
  16627. * dword0 - b'0:7 - msg_type: This will be set to
  16628. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16629. * value: 0x28
  16630. *
  16631. * dword0 - b'9:8 - pdev_id
  16632. *
  16633. * dword0 - b'11:10 - chip_id
  16634. *
  16635. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16636. *
  16637. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16638. *
  16639. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16640. * which last sync interrupt was received
  16641. *
  16642. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16643. * which last sync interrupt was received
  16644. *
  16645. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16646. *
  16647. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16648. *
  16649. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16650. *
  16651. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16652. *
  16653. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16654. * for sub us resolution
  16655. *
  16656. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16657. *
  16658. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16659. * is applied, in us
  16660. *
  16661. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16662. */
  16663. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16664. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16665. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16666. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16667. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16668. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16669. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16670. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16671. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16672. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16673. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16674. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16675. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16676. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16677. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16678. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16679. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16680. do { \
  16681. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16682. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16683. } while (0)
  16684. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16685. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16686. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16687. do { \
  16688. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16689. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16690. } while (0)
  16691. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16692. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16693. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16694. do { \
  16695. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16696. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16697. } while (0)
  16698. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16699. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16700. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16701. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16702. do { \
  16703. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16704. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16705. } while (0)
  16706. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16707. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16708. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16709. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16710. do { \
  16711. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16712. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16713. } while (0)
  16714. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16715. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16716. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16717. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16718. do { \
  16719. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16720. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16721. } while (0)
  16722. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16723. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16724. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16725. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16726. do { \
  16727. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16728. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16729. } while (0)
  16730. typedef struct {
  16731. A_UINT32 msg_type: 8, /* bits 7:0 */
  16732. pdev_id: 2, /* bits 9:8 */
  16733. chip_id: 2, /* bits 11:10 */
  16734. reserved1: 4, /* bits 15:12 */
  16735. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16736. A_UINT32 sync_timestamp_lo_us;
  16737. A_UINT32 sync_timestamp_hi_us;
  16738. A_UINT32 mlo_timestamp_offset_lo_us;
  16739. A_UINT32 mlo_timestamp_offset_hi_us;
  16740. A_UINT32 mlo_timestamp_offset_clks;
  16741. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16742. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16743. reserved2: 6; /* bits 31:26 */
  16744. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16745. reserved3: 10; /* bits 31:22 */
  16746. } htt_t2h_mlo_offset_ind_t;
  16747. /*
  16748. * @brief target -> host VDEV TX RX STATS
  16749. *
  16750. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16751. *
  16752. * @details
  16753. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16754. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16755. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16756. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16757. * periodically by target even in the absence of any further HTT request
  16758. * messages from host.
  16759. *
  16760. * The message is formatted as follows:
  16761. *
  16762. * |31 16|15 8|7 0|
  16763. * |---------------------------------+----------------+----------------|
  16764. * | payload_size | pdev_id | msg_type |
  16765. * |---------------------------------+----------------+----------------|
  16766. * | reserved0 |
  16767. * |-------------------------------------------------------------------|
  16768. * | reserved1 |
  16769. * |-------------------------------------------------------------------|
  16770. * | reserved2 |
  16771. * |-------------------------------------------------------------------|
  16772. * | |
  16773. * | VDEV specific Tx Rx stats info |
  16774. * | |
  16775. * |-------------------------------------------------------------------|
  16776. *
  16777. * The message is interpreted as follows:
  16778. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16779. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16780. * b'8:15 - pdev_id
  16781. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16782. * message header fields (msg_type through reserved2)
  16783. * dword1 - b'0:31 - reserved0.
  16784. * dword2 - b'0:31 - reserved1.
  16785. * dword3 - b'0:31 - reserved2.
  16786. */
  16787. typedef struct {
  16788. A_UINT32 msg_type: 8,
  16789. pdev_id: 8,
  16790. payload_size: 16;
  16791. A_UINT32 reserved0;
  16792. A_UINT32 reserved1;
  16793. A_UINT32 reserved2;
  16794. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16795. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16796. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16797. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16798. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16799. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16800. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16801. do { \
  16802. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16803. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16804. } while (0)
  16805. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16806. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16807. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16808. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16809. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16810. do { \
  16811. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16812. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16813. } while (0)
  16814. /* SOC related stats */
  16815. typedef struct {
  16816. htt_tlv_hdr_t tlv_hdr;
  16817. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16818. * This can be due to either the peer is deleted or deletion is ongoing
  16819. * */
  16820. A_UINT32 inv_peers_msdu_drop_count_lo;
  16821. A_UINT32 inv_peers_msdu_drop_count_hi;
  16822. } htt_t2h_soc_txrx_stats_common_tlv;
  16823. /* VDEV HW Tx/Rx stats */
  16824. typedef struct {
  16825. htt_tlv_hdr_t tlv_hdr;
  16826. A_UINT32 vdev_id;
  16827. /* Rx msdu byte cnt */
  16828. A_UINT32 rx_msdu_byte_cnt_lo;
  16829. A_UINT32 rx_msdu_byte_cnt_hi;
  16830. /* Rx msdu cnt */
  16831. A_UINT32 rx_msdu_cnt_lo;
  16832. A_UINT32 rx_msdu_cnt_hi;
  16833. /* tx msdu byte cnt */
  16834. A_UINT32 tx_msdu_byte_cnt_lo;
  16835. A_UINT32 tx_msdu_byte_cnt_hi;
  16836. /* tx msdu cnt */
  16837. A_UINT32 tx_msdu_cnt_lo;
  16838. A_UINT32 tx_msdu_cnt_hi;
  16839. /* tx excessive retry discarded msdu cnt */
  16840. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16841. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16842. /* TX congestion ctrl msdu drop cnt */
  16843. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16844. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16845. /* discarded tx msdus cnt coz of time to live expiry */
  16846. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16847. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16848. /* tx excessive retry discarded msdu byte cnt */
  16849. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16850. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16851. /* TX congestion ctrl msdu drop byte cnt */
  16852. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16853. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16854. /* discarded tx msdus byte cnt coz of time to live expiry */
  16855. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16856. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16857. /* TQM bypass frame cnt */
  16858. A_UINT32 tqm_bypass_frame_cnt_lo;
  16859. A_UINT32 tqm_bypass_frame_cnt_hi;
  16860. /* TQM bypass byte cnt */
  16861. A_UINT32 tqm_bypass_byte_cnt_lo;
  16862. A_UINT32 tqm_bypass_byte_cnt_hi;
  16863. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16864. /*
  16865. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16866. *
  16867. * @details
  16868. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16869. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16870. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16871. * the default MSDU queues of each of the specified TIDs for the peer
  16872. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16873. * If the default MSDU queues of a given TID within the peer are not linked
  16874. * to a service class, the svc_class_id field for that TID will have a
  16875. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16876. * queues for that TID are not mapped to any service class.
  16877. *
  16878. * |31 16|15 8|7 0|
  16879. * |------------------------------+--------------+--------------|
  16880. * | peer ID | reserved | msg type |
  16881. * |------------------------------+--------------+------+-------|
  16882. * | reserved | svc class ID | TID |
  16883. * |------------------------------------------------------------|
  16884. * ...
  16885. * |------------------------------------------------------------|
  16886. * | reserved | svc class ID | TID |
  16887. * |------------------------------------------------------------|
  16888. * Header fields:
  16889. * dword0 - b'7:0 - msg_type: This will be set to
  16890. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16891. * b'31:16 - peer ID
  16892. * dword1 - b'7:0 - TID
  16893. * b'15:8 - svc class ID
  16894. * (dword2, etc. same format as dword1)
  16895. */
  16896. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16897. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16898. A_UINT32 msg_type :8,
  16899. reserved0 :8,
  16900. peer_id :16;
  16901. struct {
  16902. A_UINT32 tid :8,
  16903. svc_class_id :8,
  16904. reserved1 :16;
  16905. } tid_reports[1/*or more*/];
  16906. } POSTPACK;
  16907. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16908. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16909. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16910. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16911. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16912. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16913. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16914. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16915. do { \
  16916. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16917. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16918. } while (0)
  16919. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16920. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16921. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16922. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16923. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16924. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16925. do { \
  16926. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16927. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16928. } while (0)
  16929. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16930. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16931. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16932. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16933. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16934. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16935. do { \
  16936. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16937. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16938. } while (0)
  16939. /*
  16940. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16941. *
  16942. * @details
  16943. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16944. * flow if the flow is seen the associated service class is conveyed to the
  16945. * target via TCL Data Command. Target on the other hand internally creates the
  16946. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16947. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16948. * the newly created MSDUQ
  16949. *
  16950. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16951. * |------------------------------+------------------------+--------------|
  16952. * | peer ID | HTT qtype | msg type |
  16953. * |---------------------------------+--------------+--+---+-------+------|
  16954. * | reserved |AST list index|FO|WC | HLOS | remap|
  16955. * | | | | | TID | TID |
  16956. * |---------------------+------------------------------------------------|
  16957. * | reserved1 | tgt_opaque_id |
  16958. * |---------------------+------------------------------------------------|
  16959. *
  16960. * Header fields:
  16961. *
  16962. * dword0 - b'7:0 - msg_type: This will be set to
  16963. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16964. * b'15:8 - HTT qtype
  16965. * b'31:16 - peer ID
  16966. *
  16967. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16968. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16969. * hlos_tid : Common to Lithium and Beryllium
  16970. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16971. * TCL Data Command : Beryllium
  16972. * b10 - flow_override (FO), as sent by host in
  16973. * TCL Data Command: Beryllium
  16974. * b11:14 - ast_list_idx
  16975. * Array index into the list of extension AST entries
  16976. * (not the actual AST 16-bit index).
  16977. * The ast_list_idx is one-based, with the following
  16978. * range of values:
  16979. * - legacy targets supporting 16 user-defined
  16980. * MSDU queues: 1-2
  16981. * - legacy targets supporting 48 user-defined
  16982. * MSDU queues: 1-6
  16983. * - new targets: 0 (peer_id is used instead)
  16984. * Note that since ast_list_idx is one-based,
  16985. * the host will need to subtract 1 to use it as an
  16986. * index into a list of extension AST entries.
  16987. * b15:31 - reserved
  16988. *
  16989. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16990. * unique MSDUQ id in firmware
  16991. * b'24:31 - reserved1
  16992. */
  16993. PREPACK struct htt_t2h_sawf_msduq_event {
  16994. A_UINT32 msg_type : 8,
  16995. htt_qtype : 8,
  16996. peer_id :16;
  16997. A_UINT32 remap_tid : 4,
  16998. hlos_tid : 4,
  16999. who_classify_info_sel : 2,
  17000. flow_override : 1,
  17001. ast_list_idx : 4,
  17002. reserved :17;
  17003. A_UINT32 tgt_opaque_id :24,
  17004. reserved1 : 8;
  17005. } POSTPACK;
  17006. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17007. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17008. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17009. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17010. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17011. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17012. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17013. do { \
  17014. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17015. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17016. } while (0)
  17017. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17018. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17019. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17020. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17021. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17022. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17023. do { \
  17024. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17025. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17026. } while (0)
  17027. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17028. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17029. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17030. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17031. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17032. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17033. do { \
  17034. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17035. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17036. } while (0)
  17037. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17038. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17039. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17040. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17041. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17042. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17043. do { \
  17044. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17045. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17046. } while (0)
  17047. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17048. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17049. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17050. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17051. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17052. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17053. do { \
  17054. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17055. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17056. } while (0)
  17057. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17058. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17059. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17060. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17061. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17062. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17063. do { \
  17064. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17065. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17066. } while (0)
  17067. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17068. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17069. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17070. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17071. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17072. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17073. do { \
  17074. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17075. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17076. } while (0)
  17077. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17078. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17079. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17080. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17081. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17082. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17083. do { \
  17084. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17085. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17086. } while (0)
  17087. /**
  17088. * @brief target -> PPDU id format indication
  17089. *
  17090. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17091. *
  17092. * @details
  17093. * The following field definitions describe the format of the HTT target
  17094. * to host PPDU ID format indication message.
  17095. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17096. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17097. * seq_idx :- Sequence control index of this PPDU.
  17098. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17099. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17100. * tqm_cmd:-
  17101. *
  17102. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17103. * |--------------------------------------------------+------------------------|
  17104. * | rsvd0 | msg type |
  17105. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17106. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17107. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17108. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17109. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17110. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17111. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17112. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17113. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17114. * Where: OF = bit offset, NB = number of bits, V = valid
  17115. * The message is interpreted as follows:
  17116. *
  17117. * dword0 - b'7:0 - msg_type: This will be set to
  17118. * HTT_T2H_PPDU_ID_FMT_IND
  17119. * value: 0x30
  17120. *
  17121. * dword0 - b'31:8 - reserved
  17122. *
  17123. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17124. *
  17125. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17126. *
  17127. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17128. *
  17129. * dword1 - b'15:11 - reserved for future use
  17130. *
  17131. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17132. *
  17133. * dword1 - b'21:17 - number of bits in ring_id
  17134. *
  17135. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17136. *
  17137. * dword1 - b'31:27 - reserved for future use
  17138. *
  17139. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17140. *
  17141. * dword2 - b'5:1 - number of bits in sequence index
  17142. *
  17143. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17144. *
  17145. * dword2 - b'15:11 - reserved for future use
  17146. *
  17147. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17148. *
  17149. * dword2 - b'21:17 - number of bits in link_id
  17150. *
  17151. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17152. *
  17153. * dword2 - b'31:27 - reserved for future use
  17154. *
  17155. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17156. *
  17157. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17158. *
  17159. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17160. *
  17161. * dword3 - b'15:11 - reserved for future use
  17162. *
  17163. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17164. *
  17165. * dword3 - b'21:17 - number of bits in tqm_cmd
  17166. *
  17167. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17168. *
  17169. * dword3 - b'31:27 - reserved for future use
  17170. *
  17171. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17172. *
  17173. * dword4 - b'5:1 - number of bits in mac_id
  17174. *
  17175. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17176. *
  17177. * dword4 - b'15:11 - reserved for future use
  17178. *
  17179. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17180. *
  17181. * dword4 - b'21:17 - number of bits in crc
  17182. *
  17183. * dword4 - b'26:22 - offset of crc (in number of bits)
  17184. *
  17185. * dword4 - b'31:27 - reserved for future use
  17186. *
  17187. */
  17188. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17189. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17190. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17191. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17192. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17193. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17194. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17195. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17196. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17197. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17198. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17199. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17200. /* macros for accessing lower 16 bits in dword */
  17201. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17202. do { \
  17203. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17204. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17205. } while (0)
  17206. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17207. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17208. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17209. do { \
  17210. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17211. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17212. } while (0)
  17213. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17214. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17215. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17216. do { \
  17217. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17218. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17219. } while (0)
  17220. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17221. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17222. /* macros for accessing upper 16 bits in dword */
  17223. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17224. do { \
  17225. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17226. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17227. } while (0)
  17228. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17229. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17230. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17231. do { \
  17232. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17233. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17234. } while (0)
  17235. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17236. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17237. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17238. do { \
  17239. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17240. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17241. } while (0)
  17242. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17243. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17244. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17245. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17246. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17247. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17248. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17249. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17250. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17251. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17252. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17253. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17254. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17255. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17256. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17257. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17258. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17259. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17260. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17261. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17262. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17263. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17264. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17265. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17266. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17267. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17268. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17269. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17270. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17271. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17272. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17273. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17274. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17275. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17276. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17277. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17278. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17279. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17280. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17281. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17282. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17283. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17284. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17285. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17286. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17287. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17288. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17289. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17290. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17291. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17292. /* offsets in number dwords */
  17293. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17294. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17295. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17296. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17297. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17298. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17299. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17300. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17301. typedef struct {
  17302. A_UINT32 msg_type: 8, /* bits 7:0 */
  17303. rsvd0: 24;/* bits 31:8 */
  17304. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17305. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17306. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17307. rsvd1: 5, /* bits 15:11 */
  17308. ring_id_valid: 1, /* bits 16:16 */
  17309. ring_id_bits: 5, /* bits 21:17 */
  17310. ring_id_offset: 5, /* bits 26:22 */
  17311. rsvd2: 5; /* bits 31:27 */
  17312. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17313. seq_idx_bits: 5, /* bits 5:1 */
  17314. seq_idx_offset: 5, /* bits 10:6 */
  17315. rsvd3: 5, /* bits 15:11 */
  17316. link_id_valid: 1, /* bits 16:16 */
  17317. link_id_bits: 5, /* bits 21:17 */
  17318. link_id_offset: 5, /* bits 26:22 */
  17319. rsvd4: 5; /* bits 31:27 */
  17320. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17321. seq_cmd_type_bits: 5, /* bits 5:1 */
  17322. seq_cmd_type_offset: 5, /* bits 10:6 */
  17323. rsvd5: 5, /* bits 15:11 */
  17324. tqm_cmd_valid: 1, /* bits 16:16 */
  17325. tqm_cmd_bits: 5, /* bits 21:17 */
  17326. tqm_cmd_offset: 5, /* bits 26:12 */
  17327. rsvd6: 5; /* bits 31:27 */
  17328. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17329. mac_id_bits: 5, /* bits 5:1 */
  17330. mac_id_offset: 5, /* bits 10:6 */
  17331. rsvd8: 5, /* bits 15:11 */
  17332. crc_valid: 1, /* bits 16:16 */
  17333. crc_bits: 5, /* bits 21:17 */
  17334. crc_offset: 5, /* bits 26:12 */
  17335. rsvd9: 5; /* bits 31:27 */
  17336. } htt_t2h_ppdu_id_fmt_ind_t;
  17337. #endif