htt.h 778 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. */
  216. #define HTT_CURRENT_VERSION_MAJOR 3
  217. #define HTT_CURRENT_VERSION_MINOR 96
  218. #define HTT_NUM_TX_FRAG_DESC 1024
  219. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  220. #define HTT_CHECK_SET_VAL(field, val) \
  221. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  222. /* macros to assist in sign-extending fields from HTT messages */
  223. #define HTT_SIGN_BIT_MASK(field) \
  224. ((field ## _M + (1 << field ## _S)) >> 1)
  225. #define HTT_SIGN_BIT(_val, field) \
  226. (_val & HTT_SIGN_BIT_MASK(field))
  227. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  228. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  229. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  230. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  231. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  232. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  233. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  234. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  235. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  236. /*
  237. * TEMPORARY:
  238. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  239. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  240. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  241. * updated.
  242. */
  243. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  244. /*
  245. * TEMPORARY:
  246. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  247. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  248. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  249. * updated.
  250. */
  251. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  252. /*
  253. * htt_dbg_stats_type -
  254. * bit positions for each stats type within a stats type bitmask
  255. * The bitmask contains 24 bits.
  256. */
  257. enum htt_dbg_stats_type {
  258. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  259. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  260. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  261. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  262. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  263. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  264. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  265. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  266. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  267. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  268. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  269. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  270. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  271. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  272. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  273. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  274. /* bits 16-23 currently reserved */
  275. /* keep this last */
  276. HTT_DBG_NUM_STATS
  277. };
  278. /*=== HTT option selection TLVs ===
  279. * Certain HTT messages have alternatives or options.
  280. * For such cases, the host and target need to agree on which option to use.
  281. * Option specification TLVs can be appended to the VERSION_REQ and
  282. * VERSION_CONF messages to select options other than the default.
  283. * These TLVs are entirely optional - if they are not provided, there is a
  284. * well-defined default for each option. If they are provided, they can be
  285. * provided in any order. Each TLV can be present or absent independent of
  286. * the presence / absence of other TLVs.
  287. *
  288. * The HTT option selection TLVs use the following format:
  289. * |31 16|15 8|7 0|
  290. * |---------------------------------+----------------+----------------|
  291. * | value (payload) | length | tag |
  292. * |-------------------------------------------------------------------|
  293. * The value portion need not be only 2 bytes; it can be extended by any
  294. * integer number of 4-byte units. The total length of the TLV, including
  295. * the tag and length fields, must be a multiple of 4 bytes. The length
  296. * field specifies the total TLV size in 4-byte units. Thus, the typical
  297. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  298. * field, would store 0x1 in its length field, to show that the TLV occupies
  299. * a single 4-byte unit.
  300. */
  301. /*--- TLV header format - applies to all HTT option TLVs ---*/
  302. enum HTT_OPTION_TLV_TAGS {
  303. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  304. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  305. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  306. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  307. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  308. };
  309. PREPACK struct htt_option_tlv_header_t {
  310. A_UINT8 tag;
  311. A_UINT8 length;
  312. } POSTPACK;
  313. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  314. #define HTT_OPTION_TLV_TAG_S 0
  315. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  316. #define HTT_OPTION_TLV_LENGTH_S 8
  317. /*
  318. * value0 - 16 bit value field stored in word0
  319. * The TLV's value field may be longer than 2 bytes, in which case
  320. * the remainder of the value is stored in word1, word2, etc.
  321. */
  322. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  323. #define HTT_OPTION_TLV_VALUE0_S 16
  324. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  325. do { \
  326. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  327. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  328. } while (0)
  329. #define HTT_OPTION_TLV_TAG_GET(word) \
  330. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  331. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  332. do { \
  333. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  334. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  335. } while (0)
  336. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  337. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  338. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  339. do { \
  340. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  341. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  342. } while (0)
  343. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  344. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  345. /*--- format of specific HTT option TLVs ---*/
  346. /*
  347. * HTT option TLV for specifying LL bus address size
  348. * Some chips require bus addresses used by the target to access buffers
  349. * within the host's memory to be 32 bits; others require bus addresses
  350. * used by the target to access buffers within the host's memory to be
  351. * 64 bits.
  352. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  353. * a suffix to the VERSION_CONF message to specify which bus address format
  354. * the target requires.
  355. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  356. * default to providing bus addresses to the target in 32-bit format.
  357. */
  358. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  359. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  360. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  361. };
  362. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  363. struct htt_option_tlv_header_t hdr;
  364. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  365. } POSTPACK;
  366. /*
  367. * HTT option TLV for specifying whether HL systems should indicate
  368. * over-the-air tx completion for individual frames, or should instead
  369. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  370. * requests an OTA tx completion for a particular tx frame.
  371. * This option does not apply to LL systems, where the TX_COMPL_IND
  372. * is mandatory.
  373. * This option is primarily intended for HL systems in which the tx frame
  374. * downloads over the host --> target bus are as slow as or slower than
  375. * the transmissions over the WLAN PHY. For cases where the bus is faster
  376. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  377. * and consquently will send one TX_COMPL_IND message that covers several
  378. * tx frames. For cases where the WLAN PHY is faster than the bus,
  379. * the target will end up transmitting very short A-MPDUs, and consequently
  380. * sending many TX_COMPL_IND messages, which each cover a very small number
  381. * of tx frames.
  382. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  383. * a suffix to the VERSION_REQ message to request whether the host desires to
  384. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  385. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  386. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  387. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  388. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  389. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  390. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  391. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  392. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  393. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  394. * TLV.
  395. */
  396. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  397. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  398. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  399. };
  400. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  401. struct htt_option_tlv_header_t hdr;
  402. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  403. } POSTPACK;
  404. /*
  405. * HTT option TLV for specifying how many tx queue groups the target
  406. * may establish.
  407. * This TLV specifies the maximum value the target may send in the
  408. * txq_group_id field of any TXQ_GROUP information elements sent by
  409. * the target to the host. This allows the host to pre-allocate an
  410. * appropriate number of tx queue group structs.
  411. *
  412. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  413. * a suffix to the VERSION_REQ message to specify whether the host supports
  414. * tx queue groups at all, and if so if there is any limit on the number of
  415. * tx queue groups that the host supports.
  416. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  417. * a suffix to the VERSION_CONF message. If the host has specified in the
  418. * VER_REQ message a limit on the number of tx queue groups the host can
  419. * supprt, the target shall limit its specification of the maximum tx groups
  420. * to be no larger than this host-specified limit.
  421. *
  422. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  423. * shall preallocate 4 tx queue group structs, and the target shall not
  424. * specify a txq_group_id larger than 3.
  425. */
  426. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  427. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  428. /*
  429. * values 1 through N specify the max number of tx queue groups
  430. * the sender supports
  431. */
  432. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  433. };
  434. /* TEMPORARY backwards-compatibility alias for a typo fix -
  435. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  436. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  437. * to support the old name (with the typo) until all references to the
  438. * old name are replaced with the new name.
  439. */
  440. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  441. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  442. struct htt_option_tlv_header_t hdr;
  443. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  444. } POSTPACK;
  445. /*
  446. * HTT option TLV for specifying whether the target supports an extended
  447. * version of the HTT tx descriptor. If the target provides this TLV
  448. * and specifies in the TLV that the target supports an extended version
  449. * of the HTT tx descriptor, the target must check the "extension" bit in
  450. * the HTT tx descriptor, and if the extension bit is set, to expect a
  451. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  452. * descriptor. Furthermore, the target must provide room for the HTT
  453. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  454. * This option is intended for systems where the host needs to explicitly
  455. * control the transmission parameters such as tx power for individual
  456. * tx frames.
  457. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  458. * as a suffix to the VERSION_CONF message to explicitly specify whether
  459. * the target supports the HTT tx MSDU extension descriptor.
  460. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  461. * by the host as lack of target support for the HTT tx MSDU extension
  462. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  463. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  464. * the HTT tx MSDU extension descriptor.
  465. * The host is not required to provide the HTT tx MSDU extension descriptor
  466. * just because the target supports it; the target must check the
  467. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  468. * extension descriptor is present.
  469. */
  470. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  471. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  472. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  473. };
  474. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  475. struct htt_option_tlv_header_t hdr;
  476. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  477. } POSTPACK;
  478. typedef struct {
  479. union {
  480. /* BIT [11 : 0] :- tag
  481. * BIT [23 : 12] :- length
  482. * BIT [31 : 24] :- reserved
  483. */
  484. A_UINT32 tag__length;
  485. /*
  486. * The following struct is not endian-portable.
  487. * It is suitable for use within the target, which is known to be
  488. * little-endian.
  489. * The host should use the above endian-portable macros to access
  490. * the tag and length bitfields in an endian-neutral manner.
  491. */
  492. struct {
  493. A_UINT32 tag : 12, /* BIT [11 : 0] */
  494. length : 12, /* BIT [23 : 12] */
  495. reserved : 8; /* BIT [31 : 24] */
  496. };
  497. };
  498. } htt_tlv_hdr_t;
  499. typedef enum {
  500. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  501. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  502. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  503. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  504. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  505. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  506. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  507. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  508. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  509. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  510. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  511. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  512. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  513. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  514. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  515. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  516. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  517. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  518. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  519. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  520. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  521. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  522. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  523. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  524. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  525. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  526. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  527. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  528. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  529. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  530. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  531. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  532. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  533. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  534. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  535. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  536. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  537. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  538. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  539. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  540. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  541. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  542. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  543. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  544. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  545. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  546. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  547. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  549. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  550. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  551. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  552. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  553. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  554. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  555. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  556. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  557. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  558. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  559. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  560. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  561. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  562. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  563. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  564. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  565. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  566. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  567. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  568. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  569. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  570. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  571. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  572. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  573. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  574. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  575. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  576. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  577. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  578. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  579. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  580. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  581. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  582. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  583. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  584. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  585. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  586. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  587. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  588. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  589. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  590. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  591. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  592. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  593. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  594. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  595. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  596. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  597. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  598. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  599. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  600. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  601. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  602. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  603. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  604. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  605. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  606. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  607. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  608. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  609. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  610. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  611. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  612. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  613. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  615. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  616. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  617. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  618. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  619. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  620. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  621. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  622. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  623. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  624. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  625. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  626. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  627. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  628. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  629. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  630. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  631. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  632. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  633. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  634. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  635. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  636. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  637. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  638. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  639. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  640. HTT_STATS_MAX_TAG,
  641. } htt_tlv_tag_t;
  642. #define HTT_STATS_TLV_TAG_M 0x00000fff
  643. #define HTT_STATS_TLV_TAG_S 0
  644. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  645. #define HTT_STATS_TLV_LENGTH_S 12
  646. #define HTT_STATS_TLV_TAG_GET(_var) \
  647. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  648. HTT_STATS_TLV_TAG_S)
  649. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  650. do { \
  651. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  652. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  653. } while (0)
  654. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  655. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  656. HTT_STATS_TLV_LENGTH_S)
  657. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  658. do { \
  659. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  660. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  661. } while (0)
  662. /*=== host -> target messages ===============================================*/
  663. enum htt_h2t_msg_type {
  664. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  665. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  666. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  667. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  668. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  669. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  670. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  671. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  672. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  673. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  674. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  675. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  676. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  677. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  678. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  679. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  680. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  681. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  682. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  683. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  684. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  685. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  686. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  687. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  688. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  689. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  690. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  691. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  692. /* keep this last */
  693. HTT_H2T_NUM_MSGS
  694. };
  695. /*
  696. * HTT host to target message type -
  697. * stored in bits 7:0 of the first word of the message
  698. */
  699. #define HTT_H2T_MSG_TYPE_M 0xff
  700. #define HTT_H2T_MSG_TYPE_S 0
  701. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  702. do { \
  703. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  704. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  705. } while (0)
  706. #define HTT_H2T_MSG_TYPE_GET(word) \
  707. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  708. /**
  709. * @brief host -> target version number request message definition
  710. *
  711. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  712. *
  713. *
  714. * |31 24|23 16|15 8|7 0|
  715. * |----------------+----------------+----------------+----------------|
  716. * | reserved | msg type |
  717. * |-------------------------------------------------------------------|
  718. * : option request TLV (optional) |
  719. * :...................................................................:
  720. *
  721. * The VER_REQ message may consist of a single 4-byte word, or may be
  722. * extended with TLVs that specify which HTT options the host is requesting
  723. * from the target.
  724. * The following option TLVs may be appended to the VER_REQ message:
  725. * - HL_SUPPRESS_TX_COMPL_IND
  726. * - HL_MAX_TX_QUEUE_GROUPS
  727. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  728. * may be appended to the VER_REQ message (but only one TLV of each type).
  729. *
  730. * Header fields:
  731. * - MSG_TYPE
  732. * Bits 7:0
  733. * Purpose: identifies this as a version number request message
  734. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  735. */
  736. #define HTT_VER_REQ_BYTES 4
  737. /* TBDXXX: figure out a reasonable number */
  738. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  739. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  740. /**
  741. * @brief HTT tx MSDU descriptor
  742. *
  743. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  744. *
  745. * @details
  746. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  747. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  748. * the target firmware needs for the FW's tx processing, particularly
  749. * for creating the HW msdu descriptor.
  750. * The same HTT tx descriptor is used for HL and LL systems, though
  751. * a few fields within the tx descriptor are used only by LL or
  752. * only by HL.
  753. * The HTT tx descriptor is defined in two manners: by a struct with
  754. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  755. * definitions.
  756. * The target should use the struct def, for simplicitly and clarity,
  757. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  758. * neutral. Specifically, the host shall use the get/set macros built
  759. * around the mask + shift defs.
  760. */
  761. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  764. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  765. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  766. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  767. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  768. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  769. #define HTT_TX_VDEV_ID_WORD 0
  770. #define HTT_TX_VDEV_ID_MASK 0x3f
  771. #define HTT_TX_VDEV_ID_SHIFT 16
  772. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  773. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  774. #define HTT_TX_MSDU_LEN_DWORD 1
  775. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  776. /*
  777. * HTT_VAR_PADDR macros
  778. * Allow physical / bus addresses to be either a single 32-bit value,
  779. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  780. */
  781. #define HTT_VAR_PADDR32(var_name) \
  782. A_UINT32 var_name
  783. #define HTT_VAR_PADDR64_LE(var_name) \
  784. struct { \
  785. /* little-endian: lo precedes hi */ \
  786. A_UINT32 lo; \
  787. A_UINT32 hi; \
  788. } var_name
  789. /*
  790. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  791. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  792. * addresses are stored in a XXX-bit field.
  793. * This macro is used to define both htt_tx_msdu_desc32_t and
  794. * htt_tx_msdu_desc64_t structs.
  795. */
  796. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  797. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  798. { \
  799. /* DWORD 0: flags and meta-data */ \
  800. A_UINT32 \
  801. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  802. \
  803. /* pkt_subtype - \
  804. * Detailed specification of the tx frame contents, extending the \
  805. * general specification provided by pkt_type. \
  806. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  807. * pkt_type | pkt_subtype \
  808. * ============================================================== \
  809. * 802.3 | bit 0:3 - Reserved \
  810. * | bit 4: 0x0 - Copy-Engine Classification Results \
  811. * | not appended to the HTT message \
  812. * | 0x1 - Copy-Engine Classification Results \
  813. * | appended to the HTT message in the \
  814. * | format: \
  815. * | [HTT tx desc, frame header, \
  816. * | CE classification results] \
  817. * | The CE classification results begin \
  818. * | at the next 4-byte boundary after \
  819. * | the frame header. \
  820. * ------------+------------------------------------------------- \
  821. * Eth2 | bit 0:3 - Reserved \
  822. * | bit 4: 0x0 - Copy-Engine Classification Results \
  823. * | not appended to the HTT message \
  824. * | 0x1 - Copy-Engine Classification Results \
  825. * | appended to the HTT message. \
  826. * | See the above specification of the \
  827. * | CE classification results location. \
  828. * ------------+------------------------------------------------- \
  829. * native WiFi | bit 0:3 - Reserved \
  830. * | bit 4: 0x0 - Copy-Engine Classification Results \
  831. * | not appended to the HTT message \
  832. * | 0x1 - Copy-Engine Classification Results \
  833. * | appended to the HTT message. \
  834. * | See the above specification of the \
  835. * | CE classification results location. \
  836. * ------------+------------------------------------------------- \
  837. * mgmt | 0x0 - 802.11 MAC header absent \
  838. * | 0x1 - 802.11 MAC header present \
  839. * ------------+------------------------------------------------- \
  840. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  841. * | 0x1 - 802.11 MAC header present \
  842. * | bit 1: 0x0 - allow aggregation \
  843. * | 0x1 - don't allow aggregation \
  844. * | bit 2: 0x0 - perform encryption \
  845. * | 0x1 - don't perform encryption \
  846. * | bit 3: 0x0 - perform tx classification / queuing \
  847. * | 0x1 - don't perform tx classification; \
  848. * | insert the frame into the "misc" \
  849. * | tx queue \
  850. * | bit 4: 0x0 - Copy-Engine Classification Results \
  851. * | not appended to the HTT message \
  852. * | 0x1 - Copy-Engine Classification Results \
  853. * | appended to the HTT message. \
  854. * | See the above specification of the \
  855. * | CE classification results location. \
  856. */ \
  857. pkt_subtype: 5, \
  858. \
  859. /* pkt_type - \
  860. * General specification of the tx frame contents. \
  861. * The htt_pkt_type enum should be used to specify and check the \
  862. * value of this field. \
  863. */ \
  864. pkt_type: 3, \
  865. \
  866. /* vdev_id - \
  867. * ID for the vdev that is sending this tx frame. \
  868. * For certain non-standard packet types, e.g. pkt_type == raw \
  869. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  870. * This field is used primarily for determining where to queue \
  871. * broadcast and multicast frames. \
  872. */ \
  873. vdev_id: 6, \
  874. /* ext_tid - \
  875. * The extended traffic ID. \
  876. * If the TID is unknown, the extended TID is set to \
  877. * HTT_TX_EXT_TID_INVALID. \
  878. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  879. * value of the QoS TID. \
  880. * If the tx frame is non-QoS data, then the extended TID is set to \
  881. * HTT_TX_EXT_TID_NON_QOS. \
  882. * If the tx frame is multicast or broadcast, then the extended TID \
  883. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  884. */ \
  885. ext_tid: 5, \
  886. \
  887. /* postponed - \
  888. * This flag indicates whether the tx frame has been downloaded to \
  889. * the target before but discarded by the target, and now is being \
  890. * downloaded again; or if this is a new frame that is being \
  891. * downloaded for the first time. \
  892. * This flag allows the target to determine the correct order for \
  893. * transmitting new vs. old frames. \
  894. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  895. * This flag only applies to HL systems, since in LL systems, \
  896. * the tx flow control is handled entirely within the target. \
  897. */ \
  898. postponed: 1, \
  899. \
  900. /* extension - \
  901. * This flag indicates whether a HTT tx MSDU extension descriptor \
  902. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  903. * \
  904. * 0x0 - no extension MSDU descriptor is present \
  905. * 0x1 - an extension MSDU descriptor immediately follows the \
  906. * regular MSDU descriptor \
  907. */ \
  908. extension: 1, \
  909. \
  910. /* cksum_offload - \
  911. * This flag indicates whether checksum offload is enabled or not \
  912. * for this frame. Target FW use this flag to turn on HW checksumming \
  913. * 0x0 - No checksum offload \
  914. * 0x1 - L3 header checksum only \
  915. * 0x2 - L4 checksum only \
  916. * 0x3 - L3 header checksum + L4 checksum \
  917. */ \
  918. cksum_offload: 2, \
  919. \
  920. /* tx_comp_req - \
  921. * This flag indicates whether Tx Completion \
  922. * from fw is required or not. \
  923. * This flag is only relevant if tx completion is not \
  924. * universally enabled. \
  925. * For all LL systems, tx completion is mandatory, \
  926. * so this flag will be irrelevant. \
  927. * For HL systems tx completion is optional, but HL systems in which \
  928. * the bus throughput exceeds the WLAN throughput will \
  929. * probably want to always use tx completion, and thus \
  930. * would not check this flag. \
  931. * This flag is required when tx completions are not used universally, \
  932. * but are still required for certain tx frames for which \
  933. * an OTA delivery acknowledgment is needed by the host. \
  934. * In practice, this would be for HL systems in which the \
  935. * bus throughput is less than the WLAN throughput. \
  936. * \
  937. * 0x0 - Tx Completion Indication from Fw not required \
  938. * 0x1 - Tx Completion Indication from Fw is required \
  939. */ \
  940. tx_compl_req: 1; \
  941. \
  942. \
  943. /* DWORD 1: MSDU length and ID */ \
  944. A_UINT32 \
  945. len: 16, /* MSDU length, in bytes */ \
  946. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  947. * and this id is used to calculate fragmentation \
  948. * descriptor pointer inside the target based on \
  949. * the base address, configured inside the target. \
  950. */ \
  951. \
  952. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  953. /* frags_desc_ptr - \
  954. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  955. * where the tx frame's fragments reside in memory. \
  956. * This field only applies to LL systems, since in HL systems the \
  957. * (degenerate single-fragment) fragmentation descriptor is created \
  958. * within the target. \
  959. */ \
  960. _paddr__frags_desc_ptr_; \
  961. \
  962. /* DWORD 3 (or 4): peerid, chanfreq */ \
  963. /* \
  964. * Peer ID : Target can use this value to know which peer-id packet \
  965. * destined to. \
  966. * It's intended to be specified by host in case of NAWDS. \
  967. */ \
  968. A_UINT16 peerid; \
  969. \
  970. /* \
  971. * Channel frequency: This identifies the desired channel \
  972. * frequency (in mhz) for tx frames. This is used by FW to help \
  973. * determine when it is safe to transmit or drop frames for \
  974. * off-channel operation. \
  975. * The default value of zero indicates to FW that the corresponding \
  976. * VDEV's home channel (if there is one) is the desired channel \
  977. * frequency. \
  978. */ \
  979. A_UINT16 chanfreq; \
  980. \
  981. /* Reason reserved is commented is increasing the htt structure size \
  982. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  983. * A_UINT32 reserved_dword3_bits0_31; \
  984. */ \
  985. } POSTPACK
  986. /* define a htt_tx_msdu_desc32_t type */
  987. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  988. /* define a htt_tx_msdu_desc64_t type */
  989. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  990. /*
  991. * Make htt_tx_msdu_desc_t be an alias for either
  992. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  993. */
  994. #if HTT_PADDR64
  995. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  996. #else
  997. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  998. #endif
  999. /* decriptor information for Management frame*/
  1000. /*
  1001. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1002. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1003. */
  1004. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1005. extern A_UINT32 mgmt_hdr_len;
  1006. PREPACK struct htt_mgmt_tx_desc_t {
  1007. A_UINT32 msg_type;
  1008. #if HTT_PADDR64
  1009. A_UINT64 frag_paddr; /* DMAble address of the data */
  1010. #else
  1011. A_UINT32 frag_paddr; /* DMAble address of the data */
  1012. #endif
  1013. A_UINT32 desc_id; /* returned to host during completion
  1014. * to free the meory*/
  1015. A_UINT32 len; /* Fragment length */
  1016. A_UINT32 vdev_id; /* virtual device ID*/
  1017. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1018. } POSTPACK;
  1019. PREPACK struct htt_mgmt_tx_compl_ind {
  1020. A_UINT32 desc_id;
  1021. A_UINT32 status;
  1022. } POSTPACK;
  1023. /*
  1024. * This SDU header size comes from the summation of the following:
  1025. * 1. Max of:
  1026. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1027. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1028. * b. 802.11 header, for raw frames: 36 bytes
  1029. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1030. * QoS header, HT header)
  1031. * c. 802.3 header, for ethernet frames: 14 bytes
  1032. * (destination address, source address, ethertype / length)
  1033. * 2. Max of:
  1034. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1035. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1036. * 3. 802.1Q VLAN header: 4 bytes
  1037. * 4. LLC/SNAP header: 8 bytes
  1038. */
  1039. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1040. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1041. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1042. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1043. A_COMPILE_TIME_ASSERT(
  1044. htt_encap_hdr_size_max_check_nwifi,
  1045. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1046. A_COMPILE_TIME_ASSERT(
  1047. htt_encap_hdr_size_max_check_enet,
  1048. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1049. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1050. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1051. #define HTT_TX_HDR_SIZE_802_1Q 4
  1052. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1053. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1054. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1055. HTT_TX_HDR_SIZE_802_1Q + \
  1056. HTT_TX_HDR_SIZE_LLC_SNAP)
  1057. #define HTT_HL_TX_FRM_HDR_LEN \
  1058. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1059. #define HTT_LL_TX_FRM_HDR_LEN \
  1060. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1061. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1062. /* dword 0 */
  1063. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1064. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1065. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1066. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1067. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1068. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1069. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1070. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1071. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1072. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1073. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1074. #define HTT_TX_DESC_PKT_TYPE_S 13
  1075. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1076. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1077. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1078. #define HTT_TX_DESC_VDEV_ID_S 16
  1079. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1080. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1081. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1082. #define HTT_TX_DESC_EXT_TID_S 22
  1083. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1084. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1085. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1086. #define HTT_TX_DESC_POSTPONED_S 27
  1087. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1088. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1089. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1090. #define HTT_TX_DESC_EXTENSION_S 28
  1091. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1092. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1093. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1094. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1095. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1096. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1097. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1098. #define HTT_TX_DESC_TX_COMP_S 31
  1099. /* dword 1 */
  1100. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1101. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1102. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1103. #define HTT_TX_DESC_FRM_LEN_S 0
  1104. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1105. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1106. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1107. #define HTT_TX_DESC_FRM_ID_S 16
  1108. /* dword 2 */
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1110. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1111. /* for systems using 64-bit format for bus addresses */
  1112. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1114. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1115. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1116. /* for systems using 32-bit format for bus addresses */
  1117. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1118. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1119. /* dword 3 */
  1120. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1121. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1122. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1123. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1124. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1125. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1126. #if HTT_PADDR64
  1127. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1128. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1129. #else
  1130. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1131. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1132. #endif
  1133. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1134. #define HTT_TX_DESC_PEER_ID_S 0
  1135. /*
  1136. * TEMPORARY:
  1137. * The original definitions for the PEER_ID fields contained typos
  1138. * (with _DESC_PADDR appended to this PEER_ID field name).
  1139. * Retain deprecated original names for PEER_ID fields until all code that
  1140. * refers to them has been updated.
  1141. */
  1142. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1143. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1144. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1145. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1146. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1147. HTT_TX_DESC_PEER_ID_M
  1148. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1149. HTT_TX_DESC_PEER_ID_S
  1150. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1151. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1152. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1153. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1154. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1155. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1156. #if HTT_PADDR64
  1157. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1158. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1159. #else
  1160. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1161. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1162. #endif
  1163. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1164. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1165. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1166. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1167. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1168. do { \
  1169. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1170. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1171. } while (0)
  1172. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1173. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1174. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1175. do { \
  1176. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1177. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1178. } while (0)
  1179. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1180. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1181. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1182. do { \
  1183. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1184. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1185. } while (0)
  1186. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1187. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1188. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1189. do { \
  1190. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1191. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1192. } while (0)
  1193. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1194. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1195. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1196. do { \
  1197. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1198. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1199. } while (0)
  1200. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1201. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1202. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1203. do { \
  1204. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1205. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1206. } while (0)
  1207. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1208. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1209. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1210. do { \
  1211. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1212. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1213. } while (0)
  1214. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1215. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1216. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1217. do { \
  1218. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1219. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1220. } while (0)
  1221. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1222. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1223. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1224. do { \
  1225. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1226. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1227. } while (0)
  1228. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1229. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1230. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1231. do { \
  1232. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1233. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1234. } while (0)
  1235. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1236. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1237. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1238. do { \
  1239. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1240. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1241. } while (0)
  1242. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1243. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1244. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1248. } while (0)
  1249. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1250. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1251. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1255. } while (0)
  1256. /* enums used in the HTT tx MSDU extension descriptor */
  1257. enum {
  1258. htt_tx_guard_interval_regular = 0,
  1259. htt_tx_guard_interval_short = 1,
  1260. };
  1261. enum {
  1262. htt_tx_preamble_type_ofdm = 0,
  1263. htt_tx_preamble_type_cck = 1,
  1264. htt_tx_preamble_type_ht = 2,
  1265. htt_tx_preamble_type_vht = 3,
  1266. };
  1267. enum {
  1268. htt_tx_bandwidth_5MHz = 0,
  1269. htt_tx_bandwidth_10MHz = 1,
  1270. htt_tx_bandwidth_20MHz = 2,
  1271. htt_tx_bandwidth_40MHz = 3,
  1272. htt_tx_bandwidth_80MHz = 4,
  1273. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1274. };
  1275. /**
  1276. * @brief HTT tx MSDU extension descriptor
  1277. * @details
  1278. * If the target supports HTT tx MSDU extension descriptors, the host has
  1279. * the option of appending the following struct following the regular
  1280. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1281. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1282. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1283. * tx specs for each frame.
  1284. */
  1285. PREPACK struct htt_tx_msdu_desc_ext_t {
  1286. /* DWORD 0: flags */
  1287. A_UINT32
  1288. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1289. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1290. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1291. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1292. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1293. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1294. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1295. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1296. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1297. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1298. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1299. /* DWORD 1: tx power, tx rate, tx BW */
  1300. A_UINT32
  1301. /* pwr -
  1302. * Specify what power the tx frame needs to be transmitted at.
  1303. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1304. * The value needs to be appropriately sign-extended when extracting
  1305. * the value from the message and storing it in a variable that is
  1306. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1307. * automatically handles this sign-extension.)
  1308. * If the transmission uses multiple tx chains, this power spec is
  1309. * the total transmit power, assuming incoherent combination of
  1310. * per-chain power to produce the total power.
  1311. */
  1312. pwr: 8,
  1313. /* mcs_mask -
  1314. * Specify the allowable values for MCS index (modulation and coding)
  1315. * to use for transmitting the frame.
  1316. *
  1317. * For HT / VHT preamble types, this mask directly corresponds to
  1318. * the HT or VHT MCS indices that are allowed. For each bit N set
  1319. * within the mask, MCS index N is allowed for transmitting the frame.
  1320. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1321. * rates versus OFDM rates, so the host has the option of specifying
  1322. * that the target must transmit the frame with CCK or OFDM rates
  1323. * (not HT or VHT), but leaving the decision to the target whether
  1324. * to use CCK or OFDM.
  1325. *
  1326. * For CCK and OFDM, the bits within this mask are interpreted as
  1327. * follows:
  1328. * bit 0 -> CCK 1 Mbps rate is allowed
  1329. * bit 1 -> CCK 2 Mbps rate is allowed
  1330. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1331. * bit 3 -> CCK 11 Mbps rate is allowed
  1332. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1333. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1334. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1335. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1336. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1337. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1338. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1339. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1340. *
  1341. * The MCS index specification needs to be compatible with the
  1342. * bandwidth mask specification. For example, a MCS index == 9
  1343. * specification is inconsistent with a preamble type == VHT,
  1344. * Nss == 1, and channel bandwidth == 20 MHz.
  1345. *
  1346. * Furthermore, the host has only a limited ability to specify to
  1347. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1348. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1349. */
  1350. mcs_mask: 12,
  1351. /* nss_mask -
  1352. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1353. * Each bit in this mask corresponds to a Nss value:
  1354. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1355. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1356. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1357. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1358. * The values in the Nss mask must be suitable for the recipient, e.g.
  1359. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1360. * recipient which only supports 2x2 MIMO.
  1361. */
  1362. nss_mask: 4,
  1363. /* guard_interval -
  1364. * Specify a htt_tx_guard_interval enum value to indicate whether
  1365. * the transmission should use a regular guard interval or a
  1366. * short guard interval.
  1367. */
  1368. guard_interval: 1,
  1369. /* preamble_type_mask -
  1370. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1371. * may choose from for transmitting this frame.
  1372. * The bits in this mask correspond to the values in the
  1373. * htt_tx_preamble_type enum. For example, to allow the target
  1374. * to transmit the frame as either CCK or OFDM, this field would
  1375. * be set to
  1376. * (1 << htt_tx_preamble_type_ofdm) |
  1377. * (1 << htt_tx_preamble_type_cck)
  1378. */
  1379. preamble_type_mask: 4,
  1380. reserved1_31_29: 3; /* unused, set to 0x0 */
  1381. /* DWORD 2: tx chain mask, tx retries */
  1382. A_UINT32
  1383. /* chain_mask - specify which chains to transmit from */
  1384. chain_mask: 4,
  1385. /* retry_limit -
  1386. * Specify the maximum number of transmissions, including the
  1387. * initial transmission, to attempt before giving up if no ack
  1388. * is received.
  1389. * If the tx rate is specified, then all retries shall use the
  1390. * same rate as the initial transmission.
  1391. * If no tx rate is specified, the target can choose whether to
  1392. * retain the original rate during the retransmissions, or to
  1393. * fall back to a more robust rate.
  1394. */
  1395. retry_limit: 4,
  1396. /* bandwidth_mask -
  1397. * Specify what channel widths may be used for the transmission.
  1398. * A value of zero indicates "don't care" - the target may choose
  1399. * the transmission bandwidth.
  1400. * The bits within this mask correspond to the htt_tx_bandwidth
  1401. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1402. * The bandwidth_mask must be consistent with the preamble_type_mask
  1403. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1404. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1405. */
  1406. bandwidth_mask: 6,
  1407. reserved2_31_14: 18; /* unused, set to 0x0 */
  1408. /* DWORD 3: tx expiry time (TSF) LSBs */
  1409. A_UINT32 expire_tsf_lo;
  1410. /* DWORD 4: tx expiry time (TSF) MSBs */
  1411. A_UINT32 expire_tsf_hi;
  1412. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1413. } POSTPACK;
  1414. /* DWORD 0 */
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1430. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1431. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1432. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1433. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1434. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1435. /* DWORD 1 */
  1436. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1437. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1438. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1439. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1440. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1441. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1442. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1443. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1444. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1445. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1446. /* DWORD 2 */
  1447. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1448. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1449. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1450. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1451. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1452. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1453. /* DWORD 0 */
  1454. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1455. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1456. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1457. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1458. do { \
  1459. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1460. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1461. } while (0)
  1462. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1463. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1464. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1465. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1466. do { \
  1467. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1468. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1469. } while (0)
  1470. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1471. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1472. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1474. do { \
  1475. HTT_CHECK_SET_VAL( \
  1476. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1477. ((_var) |= ((_val) \
  1478. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1479. } while (0)
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1481. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1482. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1484. do { \
  1485. HTT_CHECK_SET_VAL( \
  1486. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1487. ((_var) |= ((_val) \
  1488. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1489. } while (0)
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1491. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1492. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1494. do { \
  1495. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1496. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1497. } while (0)
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1499. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1500. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1502. do { \
  1503. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1504. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1505. } while (0)
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1507. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1508. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1510. do { \
  1511. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1512. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1513. } while (0)
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1515. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1516. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1518. do { \
  1519. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1520. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1521. } while (0)
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1523. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1524. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1526. do { \
  1527. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1528. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1529. } while (0)
  1530. /* DWORD 1 */
  1531. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1532. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1533. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1534. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1535. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1536. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1537. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1538. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1539. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1540. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1541. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1542. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1543. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1544. do { \
  1545. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1546. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1547. } while (0)
  1548. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1549. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1550. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1551. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1552. do { \
  1553. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1554. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1555. } while (0)
  1556. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1557. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1558. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1559. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1560. do { \
  1561. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1562. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1563. } while (0)
  1564. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1565. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1566. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1567. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1568. do { \
  1569. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1570. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1571. } while (0)
  1572. /* DWORD 2 */
  1573. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1574. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1575. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1576. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1577. do { \
  1578. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1579. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1580. } while (0)
  1581. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1582. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1583. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1584. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1585. do { \
  1586. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1587. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1588. } while (0)
  1589. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1590. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1591. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1592. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1593. do { \
  1594. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1595. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1596. } while (0)
  1597. typedef enum {
  1598. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1599. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1600. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1601. } htt_11ax_ltf_subtype_t;
  1602. typedef enum {
  1603. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1604. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1605. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1606. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1607. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1608. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1609. } htt_tx_ext2_preamble_type_t;
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1617. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1618. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1619. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1620. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1621. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1622. /**
  1623. * @brief HTT tx MSDU extension descriptor v2
  1624. * @details
  1625. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1626. * is received as tcl_exit_base->host_meta_info in firmware.
  1627. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1628. * are already part of tcl_exit_base.
  1629. */
  1630. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1631. /* DWORD 0: flags */
  1632. A_UINT32
  1633. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1634. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1635. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1636. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1637. valid_retries : 1, /* if set, tx retries spec is valid */
  1638. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1639. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1640. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1641. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1642. valid_key_flags : 1, /* if set, key flags is valid */
  1643. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1644. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1645. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1646. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1647. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1648. 1 = ENCRYPT,
  1649. 2 ~ 3 - Reserved */
  1650. /* retry_limit -
  1651. * Specify the maximum number of transmissions, including the
  1652. * initial transmission, to attempt before giving up if no ack
  1653. * is received.
  1654. * If the tx rate is specified, then all retries shall use the
  1655. * same rate as the initial transmission.
  1656. * If no tx rate is specified, the target can choose whether to
  1657. * retain the original rate during the retransmissions, or to
  1658. * fall back to a more robust rate.
  1659. */
  1660. retry_limit : 4,
  1661. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1662. * Valid only for 11ax preamble types HE_SU
  1663. * and HE_EXT_SU
  1664. */
  1665. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1666. * Valid only for 11ax preamble types HE_SU
  1667. * and HE_EXT_SU
  1668. */
  1669. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1670. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1671. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1672. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1673. */
  1674. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1675. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1676. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1677. * Use cases:
  1678. * Any time firmware uses TQM-BYPASS for Data
  1679. * TID, firmware expect host to set this bit.
  1680. */
  1681. /* DWORD 1: tx power, tx rate */
  1682. A_UINT32
  1683. power : 8, /* unit of the power field is 0.5 dbm
  1684. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1685. * signed value ranging from -64dbm to 63.5 dbm
  1686. */
  1687. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1688. * Setting more than one MCS isn't currently
  1689. * supported by the target (but is supported
  1690. * in the interface in case in the future
  1691. * the target supports specifications of
  1692. * a limited set of MCS values.
  1693. */
  1694. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1695. * Setting more than one Nss isn't currently
  1696. * supported by the target (but is supported
  1697. * in the interface in case in the future
  1698. * the target supports specifications of
  1699. * a limited set of Nss values.
  1700. */
  1701. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1702. update_peer_cache : 1; /* When set these custom values will be
  1703. * used for all packets, until the next
  1704. * update via this ext header.
  1705. * This is to make sure not all packets
  1706. * need to include this header.
  1707. */
  1708. /* DWORD 2: tx chain mask, tx retries */
  1709. A_UINT32
  1710. /* chain_mask - specify which chains to transmit from */
  1711. chain_mask : 8,
  1712. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1713. * TODO: Update Enum values for key_flags
  1714. */
  1715. /*
  1716. * Channel frequency: This identifies the desired channel
  1717. * frequency (in MHz) for tx frames. This is used by FW to help
  1718. * determine when it is safe to transmit or drop frames for
  1719. * off-channel operation.
  1720. * The default value of zero indicates to FW that the corresponding
  1721. * VDEV's home channel (if there is one) is the desired channel
  1722. * frequency.
  1723. */
  1724. chanfreq : 16;
  1725. /* DWORD 3: tx expiry time (TSF) LSBs */
  1726. A_UINT32 expire_tsf_lo;
  1727. /* DWORD 4: tx expiry time (TSF) MSBs */
  1728. A_UINT32 expire_tsf_hi;
  1729. /* DWORD 5: flags to control routing / processing of the MSDU */
  1730. A_UINT32
  1731. /* learning_frame
  1732. * When this flag is set, this frame will be dropped by FW
  1733. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1734. */
  1735. learning_frame : 1,
  1736. /* send_as_standalone
  1737. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1738. * i.e. with no A-MSDU or A-MPDU aggregation.
  1739. * The scope is extended to other use-cases.
  1740. */
  1741. send_as_standalone : 1,
  1742. /* is_host_opaque_valid
  1743. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1744. * with valid information.
  1745. */
  1746. is_host_opaque_valid : 1,
  1747. rsvd0 : 29;
  1748. /* DWORD 6 : Host opaque cookie for special frames */
  1749. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1750. rsvd1 : 16;
  1751. /*
  1752. * This structure can be expanded further up to 40 bytes
  1753. * by adding further DWORDs as needed.
  1754. */
  1755. } POSTPACK;
  1756. /* DWORD 0 */
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1778. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1779. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1780. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1781. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1782. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1783. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1784. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1785. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1786. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1787. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1788. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1789. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1790. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1791. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1792. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1793. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1794. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1795. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1796. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1797. /* DWORD 1 */
  1798. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1799. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1801. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1802. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1803. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1804. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1805. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1806. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1807. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1808. /* DWORD 2 */
  1809. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1810. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1811. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1812. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1813. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1814. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1815. /* DWORD 5 */
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1822. /* DWORD 6 */
  1823. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1824. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1825. /* DWORD 0 */
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1827. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1828. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1830. do { \
  1831. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1832. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1833. } while (0)
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1835. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1836. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1838. do { \
  1839. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1840. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1841. } while (0)
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1843. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1844. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1846. do { \
  1847. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1848. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1849. } while (0)
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1851. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1852. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1854. do { \
  1855. HTT_CHECK_SET_VAL( \
  1856. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1857. ((_var) |= ((_val) \
  1858. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1859. } while (0)
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1861. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1862. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1864. do { \
  1865. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1866. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1867. } while (0)
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1869. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1870. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1874. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1875. } while (0)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1877. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1878. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL( \
  1882. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1883. ((_var) |= ((_val) \
  1884. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1885. } while (0)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1887. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1888. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1890. do { \
  1891. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1892. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1893. } while (0)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1895. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1896. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1898. do { \
  1899. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1900. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1901. } while (0)
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1903. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1904. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1906. do { \
  1907. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1908. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1909. } while (0)
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1911. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1912. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1914. do { \
  1915. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1916. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1917. } while (0)
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1919. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1920. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1922. do { \
  1923. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1924. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1925. } while (0)
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1927. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1928. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1929. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1930. do { \
  1931. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1932. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1933. } while (0)
  1934. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1935. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1936. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1937. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1938. do { \
  1939. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1940. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1941. } while (0)
  1942. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1943. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1944. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1945. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1946. do { \
  1947. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1948. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1949. } while (0)
  1950. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1951. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1952. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1953. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1965. } while (0)
  1966. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1967. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1968. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1969. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1973. } while (0)
  1974. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1975. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1976. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1977. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1981. } while (0)
  1982. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1983. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1984. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1985. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1989. } while (0)
  1990. /* DWORD 1 */
  1991. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1995. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1996. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1997. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1998. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1999. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2000. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2001. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2002. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2003. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2007. } while (0)
  2008. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2009. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2010. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2011. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2015. } while (0)
  2016. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2017. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2018. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2019. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2022. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2023. } while (0)
  2024. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2025. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2026. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2027. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2028. do { \
  2029. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2030. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2031. } while (0)
  2032. /* DWORD 2 */
  2033. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2034. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2035. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2036. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2040. } while (0)
  2041. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2042. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2043. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2044. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2045. do { \
  2046. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2047. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2048. } while (0)
  2049. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2050. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2051. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2052. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2053. do { \
  2054. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2055. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2056. } while (0)
  2057. /* DWORD 5 */
  2058. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2059. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2060. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2061. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2062. do { \
  2063. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2064. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2065. } while (0)
  2066. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2067. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2068. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2069. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2070. do { \
  2071. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2072. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2073. } while (0)
  2074. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2075. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2076. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2077. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2081. } while (0)
  2082. /* DWORD 6 */
  2083. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2084. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2085. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2086. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2090. } while (0)
  2091. typedef enum {
  2092. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2093. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2094. } htt_tcl_metadata_type;
  2095. /**
  2096. * @brief HTT TCL command number format
  2097. * @details
  2098. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2099. * available to firmware as tcl_exit_base->tcl_status_number.
  2100. * For regular / multicast packets host will send vdev and mac id and for
  2101. * NAWDS packets, host will send peer id.
  2102. * A_UINT32 is used to avoid endianness conversion problems.
  2103. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2104. */
  2105. typedef struct {
  2106. A_UINT32
  2107. type: 1, /* vdev_id based or peer_id based */
  2108. rsvd: 31;
  2109. } htt_tx_tcl_vdev_or_peer_t;
  2110. typedef struct {
  2111. A_UINT32
  2112. type: 1, /* vdev_id based or peer_id based */
  2113. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2114. vdev_id: 8,
  2115. pdev_id: 2,
  2116. host_inspected:1,
  2117. rsvd: 19;
  2118. } htt_tx_tcl_vdev_metadata;
  2119. typedef struct {
  2120. A_UINT32
  2121. type: 1, /* vdev_id based or peer_id based */
  2122. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2123. peer_id: 14,
  2124. rsvd: 16;
  2125. } htt_tx_tcl_peer_metadata;
  2126. PREPACK struct htt_tx_tcl_metadata {
  2127. union {
  2128. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2129. htt_tx_tcl_vdev_metadata vdev_meta;
  2130. htt_tx_tcl_peer_metadata peer_meta;
  2131. };
  2132. } POSTPACK;
  2133. /* DWORD 0 */
  2134. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2135. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2136. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2137. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2138. /* VDEV metadata */
  2139. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2140. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2141. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2142. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2143. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2144. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2145. /* PEER metadata */
  2146. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2147. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2148. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2149. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2150. HTT_TX_TCL_METADATA_TYPE_S)
  2151. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2154. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2155. } while (0)
  2156. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2157. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2158. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2159. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2160. do { \
  2161. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2162. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2163. } while (0)
  2164. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2165. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2166. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2167. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2171. } while (0)
  2172. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2173. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2174. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2175. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2179. } while (0)
  2180. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2181. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2182. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2183. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2186. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2187. } while (0)
  2188. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2189. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2190. HTT_TX_TCL_METADATA_PEER_ID_S)
  2191. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2192. do { \
  2193. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2194. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2195. } while (0)
  2196. typedef enum {
  2197. HTT_TX_FW2WBM_TX_STATUS_OK,
  2198. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2199. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2200. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2201. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2202. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2203. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2204. HTT_TX_FW2WBM_TX_STATUS_MAX
  2205. } htt_tx_fw2wbm_tx_status_t;
  2206. typedef enum {
  2207. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2208. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2209. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2210. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2211. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2212. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2213. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2214. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2215. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2216. } htt_tx_fw2wbm_reinject_reason_t;
  2217. /**
  2218. * @brief HTT TX WBM Completion from firmware to host
  2219. * @details
  2220. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2221. * DWORD 3 and 4 for software based completions (Exception frames and
  2222. * TQM bypass frames)
  2223. * For software based completions, wbm_release_ring->release_source_module will
  2224. * be set to release_source_fw
  2225. */
  2226. PREPACK struct htt_tx_wbm_completion {
  2227. A_UINT32
  2228. sch_cmd_id: 24,
  2229. exception_frame: 1, /* If set, this packet was queued via exception path */
  2230. rsvd0_31_25: 7;
  2231. A_UINT32
  2232. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2233. * reception of an ACK or BA, this field indicates
  2234. * the RSSI of the received ACK or BA frame.
  2235. * When the frame is removed as result of a direct
  2236. * remove command from the SW, this field is set
  2237. * to 0x0 (which is never a valid value when real
  2238. * RSSI is available).
  2239. * Units: dB w.r.t noise floor
  2240. */
  2241. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2242. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2243. rsvd1_31_16: 16;
  2244. } POSTPACK;
  2245. /* DWORD 0 */
  2246. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2247. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2248. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2249. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2250. /* DWORD 1 */
  2251. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2252. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2253. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2254. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2255. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2256. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2257. /* DWORD 0 */
  2258. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2259. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2260. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2261. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2265. } while (0)
  2266. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2267. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2268. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2269. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2273. } while (0)
  2274. /* DWORD 1 */
  2275. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2276. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2277. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2278. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2281. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2282. } while (0)
  2283. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2284. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2285. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2286. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2289. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2290. } while (0)
  2291. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2292. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2293. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2294. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2295. do { \
  2296. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2297. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2298. } while (0)
  2299. /**
  2300. * @brief HTT TX WBM Completion from firmware to host
  2301. * @details
  2302. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2303. * (WBM) offload HW.
  2304. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2305. * For software based completions, release_source_module will
  2306. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2307. * struct wbm_release_ring and then switch to this after looking at
  2308. * release_source_module.
  2309. */
  2310. PREPACK struct htt_tx_wbm_completion_v2 {
  2311. A_UINT32
  2312. used_by_hw0; /* Refer to struct wbm_release_ring */
  2313. A_UINT32
  2314. used_by_hw1; /* Refer to struct wbm_release_ring */
  2315. A_UINT32
  2316. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2317. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2318. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2319. exception_frame: 1,
  2320. rsvd0: 12, /* For future use */
  2321. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2322. rsvd1: 1; /* For future use */
  2323. A_UINT32
  2324. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2325. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2326. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2327. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2328. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2329. */
  2330. A_UINT32
  2331. data1: 32;
  2332. A_UINT32
  2333. data2: 32;
  2334. A_UINT32
  2335. used_by_hw3; /* Refer to struct wbm_release_ring */
  2336. } POSTPACK;
  2337. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2338. /* DWORD 3 */
  2339. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2340. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2341. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2342. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2343. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2344. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2345. /* DWORD 3 */
  2346. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2347. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2348. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2349. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2350. do { \
  2351. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2352. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2353. } while (0)
  2354. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2355. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2356. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2357. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2358. do { \
  2359. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2360. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2361. } while (0)
  2362. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2363. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2364. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2365. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2366. do { \
  2367. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2368. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2369. } while (0)
  2370. typedef enum {
  2371. TX_FRAME_TYPE_UNDEFINED = 0,
  2372. TX_FRAME_TYPE_EAPOL = 1,
  2373. } htt_tx_wbm_status_frame_type;
  2374. /**
  2375. * @brief HTT TX WBM transmit status from firmware to host
  2376. * @details
  2377. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2378. * (WBM) offload HW.
  2379. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2380. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2381. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2382. */
  2383. PREPACK struct htt_tx_wbm_transmit_status {
  2384. A_UINT32
  2385. sch_cmd_id: 24,
  2386. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2387. * reception of an ACK or BA, this field indicates
  2388. * the RSSI of the received ACK or BA frame.
  2389. * When the frame is removed as result of a direct
  2390. * remove command from the SW, this field is set
  2391. * to 0x0 (which is never a valid value when real
  2392. * RSSI is available).
  2393. * Units: dB w.r.t noise floor
  2394. */
  2395. A_UINT32
  2396. sw_peer_id: 16,
  2397. tid_num: 5,
  2398. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2399. * and tid_num fields contain valid data.
  2400. * If this "valid" flag is not set, the
  2401. * sw_peer_id and tid_num fields must be ignored.
  2402. */
  2403. mcast: 1,
  2404. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2405. * contains valid data.
  2406. */
  2407. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2408. reserved: 4;
  2409. A_UINT32
  2410. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2411. * packets in the wbm completion path
  2412. */
  2413. } POSTPACK;
  2414. /* DWORD 4 */
  2415. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2416. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2417. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2418. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2419. /* DWORD 5 */
  2420. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2421. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2422. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2423. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2424. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2425. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2426. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2427. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2428. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2429. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2430. /* DWORD 4 */
  2431. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2432. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2433. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2434. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2438. } while (0)
  2439. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2440. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2441. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2442. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2446. } while (0)
  2447. /* DWORD 5 */
  2448. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2449. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2450. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2451. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2455. } while (0)
  2456. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2457. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2458. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2459. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2460. do { \
  2461. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2462. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2463. } while (0)
  2464. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2465. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2466. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2467. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2470. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2471. } while (0)
  2472. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2473. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2474. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2475. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2476. do { \
  2477. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2478. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2479. } while (0)
  2480. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2481. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2482. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2483. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2484. do { \
  2485. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2486. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2487. } while (0)
  2488. /**
  2489. * @brief HTT TX WBM reinject status from firmware to host
  2490. * @details
  2491. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2492. * (WBM) offload HW.
  2493. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2494. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2495. */
  2496. PREPACK struct htt_tx_wbm_reinject_status {
  2497. A_UINT32
  2498. reserved0: 32;
  2499. A_UINT32
  2500. reserved1: 32;
  2501. A_UINT32
  2502. reserved2: 32;
  2503. } POSTPACK;
  2504. /**
  2505. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2506. * @details
  2507. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2508. * (WBM) offload HW.
  2509. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2510. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2511. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2512. * STA side.
  2513. */
  2514. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2515. A_UINT32
  2516. mec_sa_addr_31_0;
  2517. A_UINT32
  2518. mec_sa_addr_47_32: 16,
  2519. sa_ast_index: 16;
  2520. A_UINT32
  2521. vdev_id: 8,
  2522. reserved0: 24;
  2523. } POSTPACK;
  2524. /* DWORD 4 - mec_sa_addr_31_0 */
  2525. /* DWORD 5 */
  2526. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2527. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2528. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2529. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2530. /* DWORD 6 */
  2531. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2532. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2533. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2534. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2535. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2536. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2537. do { \
  2538. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2539. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2540. } while (0)
  2541. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2542. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2543. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2544. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2545. do { \
  2546. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2547. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2548. } while (0)
  2549. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2550. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2551. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2552. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2553. do { \
  2554. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2555. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2556. } while (0)
  2557. typedef enum {
  2558. TX_FLOW_PRIORITY_BE,
  2559. TX_FLOW_PRIORITY_HIGH,
  2560. TX_FLOW_PRIORITY_LOW,
  2561. } htt_tx_flow_priority_t;
  2562. typedef enum {
  2563. TX_FLOW_LATENCY_SENSITIVE,
  2564. TX_FLOW_LATENCY_INSENSITIVE,
  2565. } htt_tx_flow_latency_t;
  2566. typedef enum {
  2567. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2568. TX_FLOW_INTERACTIVE_TRAFFIC,
  2569. TX_FLOW_PERIODIC_TRAFFIC,
  2570. TX_FLOW_BURSTY_TRAFFIC,
  2571. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2572. } htt_tx_flow_traffic_pattern_t;
  2573. /**
  2574. * @brief HTT TX Flow search metadata format
  2575. * @details
  2576. * Host will set this metadata in flow table's flow search entry along with
  2577. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2578. * firmware and TQM ring if the flow search entry wins.
  2579. * This metadata is available to firmware in that first MSDU's
  2580. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2581. * to one of the available flows for specific tid and returns the tqm flow
  2582. * pointer as part of htt_tx_map_flow_info message.
  2583. */
  2584. PREPACK struct htt_tx_flow_metadata {
  2585. A_UINT32
  2586. rsvd0_1_0: 2,
  2587. tid: 4,
  2588. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2589. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2590. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2591. * Else choose final tid based on latency, priority.
  2592. */
  2593. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2594. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2595. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2596. } POSTPACK;
  2597. /* DWORD 0 */
  2598. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2599. #define HTT_TX_FLOW_METADATA_TID_S 2
  2600. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2601. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2602. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2603. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2604. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2605. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2606. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2607. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2608. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2609. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2610. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2611. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2612. /* DWORD 0 */
  2613. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2614. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2615. HTT_TX_FLOW_METADATA_TID_S)
  2616. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2617. do { \
  2618. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2619. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2620. } while (0)
  2621. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2622. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2623. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2624. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2625. do { \
  2626. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2627. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2628. } while (0)
  2629. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2630. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2631. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2632. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2633. do { \
  2634. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2635. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2636. } while (0)
  2637. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2638. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2639. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2640. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2641. do { \
  2642. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2643. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2644. } while (0)
  2645. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2646. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2647. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2648. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2652. } while (0)
  2653. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2654. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2655. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2656. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2657. do { \
  2658. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2659. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2660. } while (0)
  2661. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2662. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2663. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2664. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2665. do { \
  2666. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2667. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2668. } while (0)
  2669. /**
  2670. * @brief host -> target ADD WDS Entry
  2671. *
  2672. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2673. *
  2674. * @brief host -> target DELETE WDS Entry
  2675. *
  2676. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2677. *
  2678. * @details
  2679. * HTT wds entry from source port learning
  2680. * Host will learn wds entries from rx and send this message to firmware
  2681. * to enable firmware to configure/delete AST entries for wds clients.
  2682. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2683. * and when SA's entry is deleted, firmware removes this AST entry
  2684. *
  2685. * The message would appear as follows:
  2686. *
  2687. * |31 30|29 |17 16|15 8|7 0|
  2688. * |----------------+----------------+----------------+----------------|
  2689. * | rsvd0 |PDVID| vdev_id | msg_type |
  2690. * |-------------------------------------------------------------------|
  2691. * | sa_addr_31_0 |
  2692. * |-------------------------------------------------------------------|
  2693. * | | ta_peer_id | sa_addr_47_32 |
  2694. * |-------------------------------------------------------------------|
  2695. * Where PDVID = pdev_id
  2696. *
  2697. * The message is interpreted as follows:
  2698. *
  2699. * dword0 - b'0:7 - msg_type: This will be set to
  2700. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2701. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2702. *
  2703. * dword0 - b'8:15 - vdev_id
  2704. *
  2705. * dword0 - b'16:17 - pdev_id
  2706. *
  2707. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2708. *
  2709. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2710. *
  2711. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2712. *
  2713. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2714. */
  2715. PREPACK struct htt_wds_entry {
  2716. A_UINT32
  2717. msg_type: 8,
  2718. vdev_id: 8,
  2719. pdev_id: 2,
  2720. rsvd0: 14;
  2721. A_UINT32 sa_addr_31_0;
  2722. A_UINT32
  2723. sa_addr_47_32: 16,
  2724. ta_peer_id: 14,
  2725. rsvd2: 2;
  2726. } POSTPACK;
  2727. /* DWORD 0 */
  2728. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2729. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2730. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2731. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2732. /* DWORD 2 */
  2733. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2734. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2735. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2736. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2737. /* DWORD 0 */
  2738. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2739. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2740. HTT_WDS_ENTRY_VDEV_ID_S)
  2741. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2742. do { \
  2743. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2744. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2745. } while (0)
  2746. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2747. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2748. HTT_WDS_ENTRY_PDEV_ID_S)
  2749. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2752. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2753. } while (0)
  2754. /* DWORD 2 */
  2755. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2756. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2757. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2758. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2761. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2762. } while (0)
  2763. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2764. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2765. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2766. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2769. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2770. } while (0)
  2771. /**
  2772. * @brief MAC DMA rx ring setup specification
  2773. *
  2774. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2775. *
  2776. * @details
  2777. * To allow for dynamic rx ring reconfiguration and to avoid race
  2778. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2779. * it uses. Instead, it sends this message to the target, indicating how
  2780. * the rx ring used by the host should be set up and maintained.
  2781. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2782. * specifications.
  2783. *
  2784. * |31 16|15 8|7 0|
  2785. * |---------------------------------------------------------------|
  2786. * header: | reserved | num rings | msg type |
  2787. * |---------------------------------------------------------------|
  2788. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2789. #if HTT_PADDR64
  2790. * | FW_IDX shadow register physical address (bits 63:32) |
  2791. #endif
  2792. * |---------------------------------------------------------------|
  2793. * | rx ring base physical address (bits 31:0) |
  2794. #if HTT_PADDR64
  2795. * | rx ring base physical address (bits 63:32) |
  2796. #endif
  2797. * |---------------------------------------------------------------|
  2798. * | rx ring buffer size | rx ring length |
  2799. * |---------------------------------------------------------------|
  2800. * | FW_IDX initial value | enabled flags |
  2801. * |---------------------------------------------------------------|
  2802. * | MSDU payload offset | 802.11 header offset |
  2803. * |---------------------------------------------------------------|
  2804. * | PPDU end offset | PPDU start offset |
  2805. * |---------------------------------------------------------------|
  2806. * | MPDU end offset | MPDU start offset |
  2807. * |---------------------------------------------------------------|
  2808. * | MSDU end offset | MSDU start offset |
  2809. * |---------------------------------------------------------------|
  2810. * | frag info offset | rx attention offset |
  2811. * |---------------------------------------------------------------|
  2812. * payload 2, if present, has the same format as payload 1
  2813. * Header fields:
  2814. * - MSG_TYPE
  2815. * Bits 7:0
  2816. * Purpose: identifies this as an rx ring configuration message
  2817. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2818. * - NUM_RINGS
  2819. * Bits 15:8
  2820. * Purpose: indicates whether the host is setting up one rx ring or two
  2821. * Value: 1 or 2
  2822. * Payload:
  2823. * for systems using 64-bit format for bus addresses:
  2824. * - IDX_SHADOW_REG_PADDR_LO
  2825. * Bits 31:0
  2826. * Value: lower 4 bytes of physical address of the host's
  2827. * FW_IDX shadow register
  2828. * - IDX_SHADOW_REG_PADDR_HI
  2829. * Bits 31:0
  2830. * Value: upper 4 bytes of physical address of the host's
  2831. * FW_IDX shadow register
  2832. * - RING_BASE_PADDR_LO
  2833. * Bits 31:0
  2834. * Value: lower 4 bytes of physical address of the host's rx ring
  2835. * - RING_BASE_PADDR_HI
  2836. * Bits 31:0
  2837. * Value: uppper 4 bytes of physical address of the host's rx ring
  2838. * for systems using 32-bit format for bus addresses:
  2839. * - IDX_SHADOW_REG_PADDR
  2840. * Bits 31:0
  2841. * Value: physical address of the host's FW_IDX shadow register
  2842. * - RING_BASE_PADDR
  2843. * Bits 31:0
  2844. * Value: physical address of the host's rx ring
  2845. * - RING_LEN
  2846. * Bits 15:0
  2847. * Value: number of elements in the rx ring
  2848. * - RING_BUF_SZ
  2849. * Bits 31:16
  2850. * Value: size of the buffers referenced by the rx ring, in byte units
  2851. * - ENABLED_FLAGS
  2852. * Bits 15:0
  2853. * Value: 1-bit flags to show whether different rx fields are enabled
  2854. * bit 0: 802.11 header enabled (1) or disabled (0)
  2855. * bit 1: MSDU payload enabled (1) or disabled (0)
  2856. * bit 2: PPDU start enabled (1) or disabled (0)
  2857. * bit 3: PPDU end enabled (1) or disabled (0)
  2858. * bit 4: MPDU start enabled (1) or disabled (0)
  2859. * bit 5: MPDU end enabled (1) or disabled (0)
  2860. * bit 6: MSDU start enabled (1) or disabled (0)
  2861. * bit 7: MSDU end enabled (1) or disabled (0)
  2862. * bit 8: rx attention enabled (1) or disabled (0)
  2863. * bit 9: frag info enabled (1) or disabled (0)
  2864. * bit 10: unicast rx enabled (1) or disabled (0)
  2865. * bit 11: multicast rx enabled (1) or disabled (0)
  2866. * bit 12: ctrl rx enabled (1) or disabled (0)
  2867. * bit 13: mgmt rx enabled (1) or disabled (0)
  2868. * bit 14: null rx enabled (1) or disabled (0)
  2869. * bit 15: phy data rx enabled (1) or disabled (0)
  2870. * - IDX_INIT_VAL
  2871. * Bits 31:16
  2872. * Purpose: Specify the initial value for the FW_IDX.
  2873. * Value: the number of buffers initially present in the host's rx ring
  2874. * - OFFSET_802_11_HDR
  2875. * Bits 15:0
  2876. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2877. * - OFFSET_MSDU_PAYLOAD
  2878. * Bits 31:16
  2879. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2880. * - OFFSET_PPDU_START
  2881. * Bits 15:0
  2882. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2883. * - OFFSET_PPDU_END
  2884. * Bits 31:16
  2885. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2886. * - OFFSET_MPDU_START
  2887. * Bits 15:0
  2888. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2889. * - OFFSET_MPDU_END
  2890. * Bits 31:16
  2891. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2892. * - OFFSET_MSDU_START
  2893. * Bits 15:0
  2894. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2895. * - OFFSET_MSDU_END
  2896. * Bits 31:16
  2897. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2898. * - OFFSET_RX_ATTN
  2899. * Bits 15:0
  2900. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2901. * - OFFSET_FRAG_INFO
  2902. * Bits 31:16
  2903. * Value: offset in QUAD-bytes of frag info table
  2904. */
  2905. /* header fields */
  2906. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2907. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2908. /* payload fields */
  2909. /* for systems using a 64-bit format for bus addresses */
  2910. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2911. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2912. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2913. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2914. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2915. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2916. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2917. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2918. /* for systems using a 32-bit format for bus addresses */
  2919. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2920. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2921. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2922. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2923. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2924. #define HTT_RX_RING_CFG_LEN_S 0
  2925. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2926. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2927. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2928. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2929. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2930. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2931. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2932. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2933. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2934. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2935. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2936. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2937. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2938. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2939. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2940. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2941. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2942. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2943. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2944. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2945. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2946. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2947. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2948. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2949. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2950. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2951. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2952. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2953. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2954. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2955. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2956. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2957. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2958. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2959. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2960. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2961. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2962. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2963. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2965. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2966. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2967. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2968. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2969. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2970. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2971. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2972. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2973. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2974. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2975. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2976. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2977. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2978. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2979. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2980. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2981. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2982. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2983. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2984. #if HTT_PADDR64
  2985. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2986. #else
  2987. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2988. #endif
  2989. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2990. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2991. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2992. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2993. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2996. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2997. } while (0)
  2998. /* degenerate case for 32-bit fields */
  2999. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3000. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3001. ((_var) = (_val))
  3002. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3003. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3004. ((_var) = (_val))
  3005. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3006. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3007. ((_var) = (_val))
  3008. /* degenerate case for 32-bit fields */
  3009. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3010. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3011. ((_var) = (_val))
  3012. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3013. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3014. ((_var) = (_val))
  3015. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3016. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3017. ((_var) = (_val))
  3018. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3019. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3020. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3021. do { \
  3022. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3023. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3024. } while (0)
  3025. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3026. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3027. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3030. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3031. } while (0)
  3032. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3033. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3034. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3035. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3038. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3039. } while (0)
  3040. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3041. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3042. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3043. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3044. do { \
  3045. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3046. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3047. } while (0)
  3048. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3049. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3050. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3051. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3052. do { \
  3053. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3054. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3055. } while (0)
  3056. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3057. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3058. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3059. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3060. do { \
  3061. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3062. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3063. } while (0)
  3064. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3065. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3066. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3067. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3068. do { \
  3069. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3070. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3071. } while (0)
  3072. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3073. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3074. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3075. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3076. do { \
  3077. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3078. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3079. } while (0)
  3080. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3081. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3082. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3083. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3084. do { \
  3085. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3086. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3087. } while (0)
  3088. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3089. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3090. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3091. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3092. do { \
  3093. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3094. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3095. } while (0)
  3096. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3097. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3098. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3099. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3100. do { \
  3101. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3102. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3103. } while (0)
  3104. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3105. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3106. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3107. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3108. do { \
  3109. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3110. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3111. } while (0)
  3112. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3113. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3114. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3115. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3116. do { \
  3117. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3118. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3119. } while (0)
  3120. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3121. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3122. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3123. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3126. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3127. } while (0)
  3128. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3129. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3130. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3131. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3134. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3135. } while (0)
  3136. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3137. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3138. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3139. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3142. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3143. } while (0)
  3144. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3145. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3146. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3147. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3148. do { \
  3149. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3150. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3151. } while (0)
  3152. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3153. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3154. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3155. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3156. do { \
  3157. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3158. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3159. } while (0)
  3160. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3161. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3162. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3163. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3164. do { \
  3165. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3166. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3167. } while (0)
  3168. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3169. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3170. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3171. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3172. do { \
  3173. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3174. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3175. } while (0)
  3176. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3177. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3178. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3179. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3180. do { \
  3181. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3182. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3183. } while (0)
  3184. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3185. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3186. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3187. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3188. do { \
  3189. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3190. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3191. } while (0)
  3192. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3193. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3194. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3195. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3196. do { \
  3197. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3198. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3199. } while (0)
  3200. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3201. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3202. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3203. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3204. do { \
  3205. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3206. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3207. } while (0)
  3208. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3209. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3210. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3211. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3212. do { \
  3213. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3214. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3215. } while (0)
  3216. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3217. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3218. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3219. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3220. do { \
  3221. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3222. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3223. } while (0)
  3224. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3225. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3226. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3227. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3228. do { \
  3229. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3230. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3231. } while (0)
  3232. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3233. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3234. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3235. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3236. do { \
  3237. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3238. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3239. } while (0)
  3240. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3241. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3242. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3243. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3244. do { \
  3245. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3246. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3247. } while (0)
  3248. /**
  3249. * @brief host -> target FW statistics retrieve
  3250. *
  3251. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3252. *
  3253. * @details
  3254. * The following field definitions describe the format of the HTT host
  3255. * to target FW stats retrieve message. The message specifies the type of
  3256. * stats host wants to retrieve.
  3257. *
  3258. * |31 24|23 16|15 8|7 0|
  3259. * |-----------------------------------------------------------|
  3260. * | stats types request bitmask | msg type |
  3261. * |-----------------------------------------------------------|
  3262. * | stats types reset bitmask | reserved |
  3263. * |-----------------------------------------------------------|
  3264. * | stats type | config value |
  3265. * |-----------------------------------------------------------|
  3266. * | cookie LSBs |
  3267. * |-----------------------------------------------------------|
  3268. * | cookie MSBs |
  3269. * |-----------------------------------------------------------|
  3270. * Header fields:
  3271. * - MSG_TYPE
  3272. * Bits 7:0
  3273. * Purpose: identifies this is a stats upload request message
  3274. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3275. * - UPLOAD_TYPES
  3276. * Bits 31:8
  3277. * Purpose: identifies which types of FW statistics to upload
  3278. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3279. * - RESET_TYPES
  3280. * Bits 31:8
  3281. * Purpose: identifies which types of FW statistics to reset
  3282. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3283. * - CFG_VAL
  3284. * Bits 23:0
  3285. * Purpose: give an opaque configuration value to the specified stats type
  3286. * Value: stats-type specific configuration value
  3287. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3288. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3289. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3290. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3291. * - CFG_STAT_TYPE
  3292. * Bits 31:24
  3293. * Purpose: specify which stats type (if any) the config value applies to
  3294. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3295. * a valid configuration specification
  3296. * - COOKIE_LSBS
  3297. * Bits 31:0
  3298. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3299. * message with its preceding host->target stats request message.
  3300. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3301. * - COOKIE_MSBS
  3302. * Bits 31:0
  3303. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3304. * message with its preceding host->target stats request message.
  3305. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3306. */
  3307. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3308. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3309. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3310. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3311. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3312. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3313. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3314. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3315. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3316. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3317. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3318. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3319. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3320. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3321. do { \
  3322. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3323. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3324. } while (0)
  3325. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3326. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3327. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3328. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3329. do { \
  3330. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3331. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3332. } while (0)
  3333. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3334. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3335. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3336. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3337. do { \
  3338. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3339. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3340. } while (0)
  3341. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3342. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3343. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3344. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3345. do { \
  3346. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3347. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3348. } while (0)
  3349. /**
  3350. * @brief host -> target HTT out-of-band sync request
  3351. *
  3352. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3353. *
  3354. * @details
  3355. * The HTT SYNC tells the target to suspend processing of subsequent
  3356. * HTT host-to-target messages until some other target agent locally
  3357. * informs the target HTT FW that the current sync counter is equal to
  3358. * or greater than (in a modulo sense) the sync counter specified in
  3359. * the SYNC message.
  3360. * This allows other host-target components to synchronize their operation
  3361. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3362. * security key has been downloaded to and activated by the target.
  3363. * In the absence of any explicit synchronization counter value
  3364. * specification, the target HTT FW will use zero as the default current
  3365. * sync value.
  3366. *
  3367. * |31 24|23 16|15 8|7 0|
  3368. * |-----------------------------------------------------------|
  3369. * | reserved | sync count | msg type |
  3370. * |-----------------------------------------------------------|
  3371. * Header fields:
  3372. * - MSG_TYPE
  3373. * Bits 7:0
  3374. * Purpose: identifies this as a sync message
  3375. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3376. * - SYNC_COUNT
  3377. * Bits 15:8
  3378. * Purpose: specifies what sync value the HTT FW will wait for from
  3379. * an out-of-band specification to resume its operation
  3380. * Value: in-band sync counter value to compare against the out-of-band
  3381. * counter spec.
  3382. * The HTT target FW will suspend its host->target message processing
  3383. * as long as
  3384. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3385. */
  3386. #define HTT_H2T_SYNC_MSG_SZ 4
  3387. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3388. #define HTT_H2T_SYNC_COUNT_S 8
  3389. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3390. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3391. HTT_H2T_SYNC_COUNT_S)
  3392. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3395. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3396. } while (0)
  3397. /**
  3398. * @brief host -> target HTT aggregation configuration
  3399. *
  3400. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3401. */
  3402. #define HTT_AGGR_CFG_MSG_SZ 4
  3403. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3404. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3405. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3406. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3407. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3408. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3409. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3410. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3411. do { \
  3412. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3413. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3414. } while (0)
  3415. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3416. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3417. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3418. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3419. do { \
  3420. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3421. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3422. } while (0)
  3423. /**
  3424. * @brief host -> target HTT configure max amsdu info per vdev
  3425. *
  3426. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3427. *
  3428. * @details
  3429. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3430. *
  3431. * |31 21|20 16|15 8|7 0|
  3432. * |-----------------------------------------------------------|
  3433. * | reserved | vdev id | max amsdu | msg type |
  3434. * |-----------------------------------------------------------|
  3435. * Header fields:
  3436. * - MSG_TYPE
  3437. * Bits 7:0
  3438. * Purpose: identifies this as a aggr cfg ex message
  3439. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3440. * - MAX_NUM_AMSDU_SUBFRM
  3441. * Bits 15:8
  3442. * Purpose: max MSDUs per A-MSDU
  3443. * - VDEV_ID
  3444. * Bits 20:16
  3445. * Purpose: ID of the vdev to which this limit is applied
  3446. */
  3447. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3448. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3449. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3450. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3451. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3452. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3453. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3454. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3455. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3456. do { \
  3457. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3458. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3459. } while (0)
  3460. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3461. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3462. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3463. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3464. do { \
  3465. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3466. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3467. } while (0)
  3468. /**
  3469. * @brief HTT WDI_IPA Config Message
  3470. *
  3471. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3472. *
  3473. * @details
  3474. * The HTT WDI_IPA config message is created/sent by host at driver
  3475. * init time. It contains information about data structures used on
  3476. * WDI_IPA TX and RX path.
  3477. * TX CE ring is used for pushing packet metadata from IPA uC
  3478. * to WLAN FW
  3479. * TX Completion ring is used for generating TX completions from
  3480. * WLAN FW to IPA uC
  3481. * RX Indication ring is used for indicating RX packets from FW
  3482. * to IPA uC
  3483. * RX Ring2 is used as either completion ring or as second
  3484. * indication ring. when Ring2 is used as completion ring, IPA uC
  3485. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3486. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3487. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3488. * indicated in RX Indication ring. Please see WDI_IPA specification
  3489. * for more details.
  3490. * |31 24|23 16|15 8|7 0|
  3491. * |----------------+----------------+----------------+----------------|
  3492. * | tx pkt pool size | Rsvd | msg_type |
  3493. * |-------------------------------------------------------------------|
  3494. * | tx comp ring base (bits 31:0) |
  3495. #if HTT_PADDR64
  3496. * | tx comp ring base (bits 63:32) |
  3497. #endif
  3498. * |-------------------------------------------------------------------|
  3499. * | tx comp ring size |
  3500. * |-------------------------------------------------------------------|
  3501. * | tx comp WR_IDX physical address (bits 31:0) |
  3502. #if HTT_PADDR64
  3503. * | tx comp WR_IDX physical address (bits 63:32) |
  3504. #endif
  3505. * |-------------------------------------------------------------------|
  3506. * | tx CE WR_IDX physical address (bits 31:0) |
  3507. #if HTT_PADDR64
  3508. * | tx CE WR_IDX physical address (bits 63:32) |
  3509. #endif
  3510. * |-------------------------------------------------------------------|
  3511. * | rx indication ring base (bits 31:0) |
  3512. #if HTT_PADDR64
  3513. * | rx indication ring base (bits 63:32) |
  3514. #endif
  3515. * |-------------------------------------------------------------------|
  3516. * | rx indication ring size |
  3517. * |-------------------------------------------------------------------|
  3518. * | rx ind RD_IDX physical address (bits 31:0) |
  3519. #if HTT_PADDR64
  3520. * | rx ind RD_IDX physical address (bits 63:32) |
  3521. #endif
  3522. * |-------------------------------------------------------------------|
  3523. * | rx ind WR_IDX physical address (bits 31:0) |
  3524. #if HTT_PADDR64
  3525. * | rx ind WR_IDX physical address (bits 63:32) |
  3526. #endif
  3527. * |-------------------------------------------------------------------|
  3528. * |-------------------------------------------------------------------|
  3529. * | rx ring2 base (bits 31:0) |
  3530. #if HTT_PADDR64
  3531. * | rx ring2 base (bits 63:32) |
  3532. #endif
  3533. * |-------------------------------------------------------------------|
  3534. * | rx ring2 size |
  3535. * |-------------------------------------------------------------------|
  3536. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3537. #if HTT_PADDR64
  3538. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3539. #endif
  3540. * |-------------------------------------------------------------------|
  3541. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3542. #if HTT_PADDR64
  3543. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3544. #endif
  3545. * |-------------------------------------------------------------------|
  3546. *
  3547. * Header fields:
  3548. * Header fields:
  3549. * - MSG_TYPE
  3550. * Bits 7:0
  3551. * Purpose: Identifies this as WDI_IPA config message
  3552. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3553. * - TX_PKT_POOL_SIZE
  3554. * Bits 15:0
  3555. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3556. * WDI_IPA TX path
  3557. * For systems using 32-bit format for bus addresses:
  3558. * - TX_COMP_RING_BASE_ADDR
  3559. * Bits 31:0
  3560. * Purpose: TX Completion Ring base address in DDR
  3561. * - TX_COMP_RING_SIZE
  3562. * Bits 31:0
  3563. * Purpose: TX Completion Ring size (must be power of 2)
  3564. * - TX_COMP_WR_IDX_ADDR
  3565. * Bits 31:0
  3566. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3567. * updates the Write Index for WDI_IPA TX completion ring
  3568. * - TX_CE_WR_IDX_ADDR
  3569. * Bits 31:0
  3570. * Purpose: DDR address where IPA uC
  3571. * updates the WR Index for TX CE ring
  3572. * (needed for fusion platforms)
  3573. * - RX_IND_RING_BASE_ADDR
  3574. * Bits 31:0
  3575. * Purpose: RX Indication Ring base address in DDR
  3576. * - RX_IND_RING_SIZE
  3577. * Bits 31:0
  3578. * Purpose: RX Indication Ring size
  3579. * - RX_IND_RD_IDX_ADDR
  3580. * Bits 31:0
  3581. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3582. * RX indication ring
  3583. * - RX_IND_WR_IDX_ADDR
  3584. * Bits 31:0
  3585. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3586. * updates the Write Index for WDI_IPA RX indication ring
  3587. * - RX_RING2_BASE_ADDR
  3588. * Bits 31:0
  3589. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3590. * - RX_RING2_SIZE
  3591. * Bits 31:0
  3592. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3593. * - RX_RING2_RD_IDX_ADDR
  3594. * Bits 31:0
  3595. * Purpose: If Second RX ring is Indication ring, DDR address where
  3596. * IPA uC updates the Read Index for Ring2.
  3597. * If Second RX ring is completion ring, this is NOT used
  3598. * - RX_RING2_WR_IDX_ADDR
  3599. * Bits 31:0
  3600. * Purpose: If Second RX ring is Indication ring, DDR address where
  3601. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3602. * If second RX ring is completion ring, DDR address where
  3603. * IPA uC updates the Write Index for Ring 2.
  3604. * For systems using 64-bit format for bus addresses:
  3605. * - TX_COMP_RING_BASE_ADDR_LO
  3606. * Bits 31:0
  3607. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3608. * - TX_COMP_RING_BASE_ADDR_HI
  3609. * Bits 31:0
  3610. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3611. * - TX_COMP_RING_SIZE
  3612. * Bits 31:0
  3613. * Purpose: TX Completion Ring size (must be power of 2)
  3614. * - TX_COMP_WR_IDX_ADDR_LO
  3615. * Bits 31:0
  3616. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3617. * Lower 4 bytes of DDR address where WIFI FW
  3618. * updates the Write Index for WDI_IPA TX completion ring
  3619. * - TX_COMP_WR_IDX_ADDR_HI
  3620. * Bits 31:0
  3621. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3622. * Higher 4 bytes of DDR address where WIFI FW
  3623. * updates the Write Index for WDI_IPA TX completion ring
  3624. * - TX_CE_WR_IDX_ADDR_LO
  3625. * Bits 31:0
  3626. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3627. * updates the WR Index for TX CE ring
  3628. * (needed for fusion platforms)
  3629. * - TX_CE_WR_IDX_ADDR_HI
  3630. * Bits 31:0
  3631. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3632. * updates the WR Index for TX CE ring
  3633. * (needed for fusion platforms)
  3634. * - RX_IND_RING_BASE_ADDR_LO
  3635. * Bits 31:0
  3636. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3637. * - RX_IND_RING_BASE_ADDR_HI
  3638. * Bits 31:0
  3639. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3640. * - RX_IND_RING_SIZE
  3641. * Bits 31:0
  3642. * Purpose: RX Indication Ring size
  3643. * - RX_IND_RD_IDX_ADDR_LO
  3644. * Bits 31:0
  3645. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3646. * for WDI_IPA RX indication ring
  3647. * - RX_IND_RD_IDX_ADDR_HI
  3648. * Bits 31:0
  3649. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3650. * for WDI_IPA RX indication ring
  3651. * - RX_IND_WR_IDX_ADDR_LO
  3652. * Bits 31:0
  3653. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3654. * Lower 4 bytes of DDR address where WIFI FW
  3655. * updates the Write Index for WDI_IPA RX indication ring
  3656. * - RX_IND_WR_IDX_ADDR_HI
  3657. * Bits 31:0
  3658. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3659. * Higher 4 bytes of DDR address where WIFI FW
  3660. * updates the Write Index for WDI_IPA RX indication ring
  3661. * - RX_RING2_BASE_ADDR_LO
  3662. * Bits 31:0
  3663. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3664. * - RX_RING2_BASE_ADDR_HI
  3665. * Bits 31:0
  3666. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3667. * - RX_RING2_SIZE
  3668. * Bits 31:0
  3669. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3670. * - RX_RING2_RD_IDX_ADDR_LO
  3671. * Bits 31:0
  3672. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3673. * DDR address where IPA uC updates the Read Index for Ring2.
  3674. * If Second RX ring is completion ring, this is NOT used
  3675. * - RX_RING2_RD_IDX_ADDR_HI
  3676. * Bits 31:0
  3677. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3678. * DDR address where IPA uC updates the Read Index for Ring2.
  3679. * If Second RX ring is completion ring, this is NOT used
  3680. * - RX_RING2_WR_IDX_ADDR_LO
  3681. * Bits 31:0
  3682. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3683. * DDR address where WIFI FW updates the Write Index
  3684. * for WDI_IPA RX ring2
  3685. * If second RX ring is completion ring, lower 4 bytes of
  3686. * DDR address where IPA uC updates the Write Index for Ring 2.
  3687. * - RX_RING2_WR_IDX_ADDR_HI
  3688. * Bits 31:0
  3689. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3690. * DDR address where WIFI FW updates the Write Index
  3691. * for WDI_IPA RX ring2
  3692. * If second RX ring is completion ring, higher 4 bytes of
  3693. * DDR address where IPA uC updates the Write Index for Ring 2.
  3694. */
  3695. #if HTT_PADDR64
  3696. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3697. #else
  3698. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3699. #endif
  3700. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3701. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3702. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3705. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3706. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3707. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3708. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3709. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3710. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3711. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3712. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3713. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3714. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3715. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3716. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3717. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3718. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3719. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3720. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3721. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3722. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3725. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3726. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3727. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3728. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3729. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3730. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3731. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3732. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3733. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3734. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3735. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3736. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3737. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3738. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3739. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3740. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3741. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3758. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3761. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3762. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3763. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3764. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3767. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3768. } while (0)
  3769. /* for systems using 32-bit format for bus addr */
  3770. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3771. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3772. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3775. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3776. } while (0)
  3777. /* for systems using 64-bit format for bus addr */
  3778. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3779. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3780. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3783. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3784. } while (0)
  3785. /* for systems using 64-bit format for bus addr */
  3786. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3787. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3788. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3789. do { \
  3790. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3791. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3792. } while (0)
  3793. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3794. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3795. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3796. do { \
  3797. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3798. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3799. } while (0)
  3800. /* for systems using 32-bit format for bus addr */
  3801. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3802. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3803. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3804. do { \
  3805. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3806. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3807. } while (0)
  3808. /* for systems using 64-bit format for bus addr */
  3809. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3810. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3811. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3812. do { \
  3813. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3814. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3815. } while (0)
  3816. /* for systems using 64-bit format for bus addr */
  3817. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3818. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3819. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3820. do { \
  3821. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3822. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3823. } while (0)
  3824. /* for systems using 32-bit format for bus addr */
  3825. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3826. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3827. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3828. do { \
  3829. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3830. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3831. } while (0)
  3832. /* for systems using 64-bit format for bus addr */
  3833. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3834. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3835. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3836. do { \
  3837. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3838. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3839. } while (0)
  3840. /* for systems using 64-bit format for bus addr */
  3841. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3842. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3843. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3844. do { \
  3845. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3846. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3847. } while (0)
  3848. /* for systems using 32-bit format for bus addr */
  3849. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3850. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3851. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3852. do { \
  3853. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3854. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3855. } while (0)
  3856. /* for systems using 64-bit format for bus addr */
  3857. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3858. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3859. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3860. do { \
  3861. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3862. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3863. } while (0)
  3864. /* for systems using 64-bit format for bus addr */
  3865. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3866. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3867. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3868. do { \
  3869. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3870. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3871. } while (0)
  3872. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3873. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3874. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3875. do { \
  3876. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3877. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3878. } while (0)
  3879. /* for systems using 32-bit format for bus addr */
  3880. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3881. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3882. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3885. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3886. } while (0)
  3887. /* for systems using 64-bit format for bus addr */
  3888. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3889. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3890. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3891. do { \
  3892. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3893. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3894. } while (0)
  3895. /* for systems using 64-bit format for bus addr */
  3896. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3897. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3898. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3899. do { \
  3900. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3901. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3902. } while (0)
  3903. /* for systems using 32-bit format for bus addr */
  3904. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3905. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3906. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3907. do { \
  3908. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3909. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3910. } while (0)
  3911. /* for systems using 64-bit format for bus addr */
  3912. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3913. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3914. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3915. do { \
  3916. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3917. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3918. } while (0)
  3919. /* for systems using 64-bit format for bus addr */
  3920. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3921. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3922. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3923. do { \
  3924. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3925. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3926. } while (0)
  3927. /* for systems using 32-bit format for bus addr */
  3928. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3929. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3930. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3931. do { \
  3932. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3933. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3934. } while (0)
  3935. /* for systems using 64-bit format for bus addr */
  3936. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3937. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3938. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3939. do { \
  3940. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3941. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3942. } while (0)
  3943. /* for systems using 64-bit format for bus addr */
  3944. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3945. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3946. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3947. do { \
  3948. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3949. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3950. } while (0)
  3951. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3952. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3953. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3954. do { \
  3955. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3956. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3957. } while (0)
  3958. /* for systems using 32-bit format for bus addr */
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3960. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3962. do { \
  3963. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3964. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3965. } while (0)
  3966. /* for systems using 64-bit format for bus addr */
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3968. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3970. do { \
  3971. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3972. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3973. } while (0)
  3974. /* for systems using 64-bit format for bus addr */
  3975. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3976. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3977. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3978. do { \
  3979. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3980. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3981. } while (0)
  3982. /* for systems using 32-bit format for bus addr */
  3983. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3984. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3985. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3986. do { \
  3987. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3988. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3989. } while (0)
  3990. /* for systems using 64-bit format for bus addr */
  3991. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3992. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3993. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3994. do { \
  3995. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3996. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3997. } while (0)
  3998. /* for systems using 64-bit format for bus addr */
  3999. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4000. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4001. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4002. do { \
  4003. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4004. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4005. } while (0)
  4006. /*
  4007. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4008. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4009. * addresses are stored in a XXX-bit field.
  4010. * This macro is used to define both htt_wdi_ipa_config32_t and
  4011. * htt_wdi_ipa_config64_t structs.
  4012. */
  4013. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4014. _paddr__tx_comp_ring_base_addr_, \
  4015. _paddr__tx_comp_wr_idx_addr_, \
  4016. _paddr__tx_ce_wr_idx_addr_, \
  4017. _paddr__rx_ind_ring_base_addr_, \
  4018. _paddr__rx_ind_rd_idx_addr_, \
  4019. _paddr__rx_ind_wr_idx_addr_, \
  4020. _paddr__rx_ring2_base_addr_,\
  4021. _paddr__rx_ring2_rd_idx_addr_,\
  4022. _paddr__rx_ring2_wr_idx_addr_) \
  4023. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4024. { \
  4025. /* DWORD 0: flags and meta-data */ \
  4026. A_UINT32 \
  4027. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4028. reserved: 8, \
  4029. tx_pkt_pool_size: 16;\
  4030. /* DWORD 1 */\
  4031. _paddr__tx_comp_ring_base_addr_;\
  4032. /* DWORD 2 (or 3)*/\
  4033. A_UINT32 tx_comp_ring_size;\
  4034. /* DWORD 3 (or 4)*/\
  4035. _paddr__tx_comp_wr_idx_addr_;\
  4036. /* DWORD 4 (or 6)*/\
  4037. _paddr__tx_ce_wr_idx_addr_;\
  4038. /* DWORD 5 (or 8)*/\
  4039. _paddr__rx_ind_ring_base_addr_;\
  4040. /* DWORD 6 (or 10)*/\
  4041. A_UINT32 rx_ind_ring_size;\
  4042. /* DWORD 7 (or 11)*/\
  4043. _paddr__rx_ind_rd_idx_addr_;\
  4044. /* DWORD 8 (or 13)*/\
  4045. _paddr__rx_ind_wr_idx_addr_;\
  4046. /* DWORD 9 (or 15)*/\
  4047. _paddr__rx_ring2_base_addr_;\
  4048. /* DWORD 10 (or 17) */\
  4049. A_UINT32 rx_ring2_size;\
  4050. /* DWORD 11 (or 18) */\
  4051. _paddr__rx_ring2_rd_idx_addr_;\
  4052. /* DWORD 12 (or 20) */\
  4053. _paddr__rx_ring2_wr_idx_addr_;\
  4054. } POSTPACK
  4055. /* define a htt_wdi_ipa_config32_t type */
  4056. 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));
  4057. /* define a htt_wdi_ipa_config64_t type */
  4058. 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));
  4059. #if HTT_PADDR64
  4060. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4061. #else
  4062. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4063. #endif
  4064. enum htt_wdi_ipa_op_code {
  4065. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4066. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4067. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4068. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4069. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4070. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4071. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4072. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4073. /* keep this last */
  4074. HTT_WDI_IPA_OPCODE_MAX
  4075. };
  4076. /**
  4077. * @brief HTT WDI_IPA Operation Request Message
  4078. *
  4079. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4080. *
  4081. * @details
  4082. * HTT WDI_IPA Operation Request message is sent by host
  4083. * to either suspend or resume WDI_IPA TX or RX path.
  4084. * |31 24|23 16|15 8|7 0|
  4085. * |----------------+----------------+----------------+----------------|
  4086. * | op_code | Rsvd | msg_type |
  4087. * |-------------------------------------------------------------------|
  4088. *
  4089. * Header fields:
  4090. * - MSG_TYPE
  4091. * Bits 7:0
  4092. * Purpose: Identifies this as WDI_IPA Operation Request message
  4093. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4094. * - OP_CODE
  4095. * Bits 31:16
  4096. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4097. * value: = enum htt_wdi_ipa_op_code
  4098. */
  4099. PREPACK struct htt_wdi_ipa_op_request_t
  4100. {
  4101. /* DWORD 0: flags and meta-data */
  4102. A_UINT32
  4103. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4104. reserved: 8,
  4105. op_code: 16;
  4106. } POSTPACK;
  4107. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4108. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4109. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4110. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4111. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4112. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4115. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4116. } while (0)
  4117. /*
  4118. * @brief host -> target HTT_SRING_SETUP message
  4119. *
  4120. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4121. *
  4122. * @details
  4123. * After target is booted up, Host can send SRING setup message for
  4124. * each host facing LMAC SRING. Target setups up HW registers based
  4125. * on setup message and confirms back to Host if response_required is set.
  4126. * Host should wait for confirmation message before sending new SRING
  4127. * setup message
  4128. *
  4129. * The message would appear as follows:
  4130. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4131. * |--------------- +-----------------+-----------------+-----------------|
  4132. * | ring_type | ring_id | pdev_id | msg_type |
  4133. * |----------------------------------------------------------------------|
  4134. * | ring_base_addr_lo |
  4135. * |----------------------------------------------------------------------|
  4136. * | ring_base_addr_hi |
  4137. * |----------------------------------------------------------------------|
  4138. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4139. * |----------------------------------------------------------------------|
  4140. * | ring_head_offset32_remote_addr_lo |
  4141. * |----------------------------------------------------------------------|
  4142. * | ring_head_offset32_remote_addr_hi |
  4143. * |----------------------------------------------------------------------|
  4144. * | ring_tail_offset32_remote_addr_lo |
  4145. * |----------------------------------------------------------------------|
  4146. * | ring_tail_offset32_remote_addr_hi |
  4147. * |----------------------------------------------------------------------|
  4148. * | ring_msi_addr_lo |
  4149. * |----------------------------------------------------------------------|
  4150. * | ring_msi_addr_hi |
  4151. * |----------------------------------------------------------------------|
  4152. * | ring_msi_data |
  4153. * |----------------------------------------------------------------------|
  4154. * | intr_timer_th |IM| intr_batch_counter_th |
  4155. * |----------------------------------------------------------------------|
  4156. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4157. * |----------------------------------------------------------------------|
  4158. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4159. * |----------------------------------------------------------------------|
  4160. * Where
  4161. * IM = sw_intr_mode
  4162. * RR = response_required
  4163. * PTCF = prefetch_timer_cfg
  4164. * IP = IPA drop flag
  4165. *
  4166. * The message is interpreted as follows:
  4167. * dword0 - b'0:7 - msg_type: This will be set to
  4168. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4169. * b'8:15 - pdev_id:
  4170. * 0 (for rings at SOC/UMAC level),
  4171. * 1/2/3 mac id (for rings at LMAC level)
  4172. * b'16:23 - ring_id: identify which ring is to setup,
  4173. * more details can be got from enum htt_srng_ring_id
  4174. * b'24:31 - ring_type: identify type of host rings,
  4175. * more details can be got from enum htt_srng_ring_type
  4176. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4177. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4178. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4179. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4180. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4181. * SW_TO_HW_RING.
  4182. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4183. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4184. * Lower 32 bits of memory address of the remote variable
  4185. * storing the 4-byte word offset that identifies the head
  4186. * element within the ring.
  4187. * (The head offset variable has type A_UINT32.)
  4188. * Valid for HW_TO_SW and SW_TO_SW rings.
  4189. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4190. * Upper 32 bits of memory address of the remote variable
  4191. * storing the 4-byte word offset that identifies the head
  4192. * element within the ring.
  4193. * (The head offset variable has type A_UINT32.)
  4194. * Valid for HW_TO_SW and SW_TO_SW rings.
  4195. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4196. * Lower 32 bits of memory address of the remote variable
  4197. * storing the 4-byte word offset that identifies the tail
  4198. * element within the ring.
  4199. * (The tail offset variable has type A_UINT32.)
  4200. * Valid for HW_TO_SW and SW_TO_SW rings.
  4201. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4202. * Upper 32 bits of memory address of the remote variable
  4203. * storing the 4-byte word offset that identifies the tail
  4204. * element within the ring.
  4205. * (The tail offset variable has type A_UINT32.)
  4206. * Valid for HW_TO_SW and SW_TO_SW rings.
  4207. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4208. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4209. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4210. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4211. * dword10 - b'0:31 - ring_msi_data: MSI data
  4212. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4213. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4214. * dword11 - b'0:14 - intr_batch_counter_th:
  4215. * batch counter threshold is in units of 4-byte words.
  4216. * HW internally maintains and increments batch count.
  4217. * (see SRING spec for detail description).
  4218. * When batch count reaches threshold value, an interrupt
  4219. * is generated by HW.
  4220. * b'15 - sw_intr_mode:
  4221. * This configuration shall be static.
  4222. * Only programmed at power up.
  4223. * 0: generate pulse style sw interrupts
  4224. * 1: generate level style sw interrupts
  4225. * b'16:31 - intr_timer_th:
  4226. * The timer init value when timer is idle or is
  4227. * initialized to start downcounting.
  4228. * In 8us units (to cover a range of 0 to 524 ms)
  4229. * dword12 - b'0:15 - intr_low_threshold:
  4230. * Used only by Consumer ring to generate ring_sw_int_p.
  4231. * Ring entries low threshold water mark, that is used
  4232. * in combination with the interrupt timer as well as
  4233. * the the clearing of the level interrupt.
  4234. * b'16:18 - prefetch_timer_cfg:
  4235. * Used only by Consumer ring to set timer mode to
  4236. * support Application prefetch handling.
  4237. * The external tail offset/pointer will be updated
  4238. * at following intervals:
  4239. * 3'b000: (Prefetch feature disabled; used only for debug)
  4240. * 3'b001: 1 usec
  4241. * 3'b010: 4 usec
  4242. * 3'b011: 8 usec (default)
  4243. * 3'b100: 16 usec
  4244. * Others: Reserverd
  4245. * b'19 - response_required:
  4246. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4247. * b'20 - ipa_drop_flag:
  4248. Indicates that host will config ipa drop threshold percentage
  4249. * b'21:31 - reserved: reserved for future use
  4250. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4251. * b'8:15 - ipa drop high threshold percentage:
  4252. * b'16:31 - Reserved
  4253. */
  4254. PREPACK struct htt_sring_setup_t {
  4255. A_UINT32 msg_type: 8,
  4256. pdev_id: 8,
  4257. ring_id: 8,
  4258. ring_type: 8;
  4259. A_UINT32 ring_base_addr_lo;
  4260. A_UINT32 ring_base_addr_hi;
  4261. A_UINT32 ring_size: 16,
  4262. ring_entry_size: 8,
  4263. ring_misc_cfg_flag: 8;
  4264. A_UINT32 ring_head_offset32_remote_addr_lo;
  4265. A_UINT32 ring_head_offset32_remote_addr_hi;
  4266. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4267. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4268. A_UINT32 ring_msi_addr_lo;
  4269. A_UINT32 ring_msi_addr_hi;
  4270. A_UINT32 ring_msi_data;
  4271. A_UINT32 intr_batch_counter_th: 15,
  4272. sw_intr_mode: 1,
  4273. intr_timer_th: 16;
  4274. A_UINT32 intr_low_threshold: 16,
  4275. prefetch_timer_cfg: 3,
  4276. response_required: 1,
  4277. ipa_drop_flag: 1,
  4278. reserved1: 11;
  4279. A_UINT32 ipa_drop_low_threshold: 8,
  4280. ipa_drop_high_threshold: 8,
  4281. reserved: 16;
  4282. } POSTPACK;
  4283. enum htt_srng_ring_type {
  4284. HTT_HW_TO_SW_RING = 0,
  4285. HTT_SW_TO_HW_RING,
  4286. HTT_SW_TO_SW_RING,
  4287. /* Insert new ring types above this line */
  4288. };
  4289. enum htt_srng_ring_id {
  4290. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4291. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4292. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4293. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4294. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4295. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4296. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4297. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4298. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4299. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4300. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4301. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4302. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4303. /* Add Other SRING which can't be directly configured by host software above this line */
  4304. };
  4305. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4306. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4307. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4308. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4309. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4310. HTT_SRING_SETUP_PDEV_ID_S)
  4311. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4314. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4315. } while (0)
  4316. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4317. #define HTT_SRING_SETUP_RING_ID_S 16
  4318. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4319. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4320. HTT_SRING_SETUP_RING_ID_S)
  4321. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4324. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4325. } while (0)
  4326. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4327. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4328. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4329. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4330. HTT_SRING_SETUP_RING_TYPE_S)
  4331. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4334. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4335. } while (0)
  4336. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4337. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4338. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4339. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4340. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4341. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4342. do { \
  4343. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4344. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4345. } while (0)
  4346. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4347. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4348. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4349. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4350. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4351. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4352. do { \
  4353. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4354. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4355. } while (0)
  4356. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4357. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4358. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4359. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4360. HTT_SRING_SETUP_RING_SIZE_S)
  4361. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4362. do { \
  4363. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4364. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4365. } while (0)
  4366. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4367. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4368. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4369. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4370. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4371. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4372. do { \
  4373. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4374. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4375. } while (0)
  4376. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4377. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4378. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4379. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4380. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4381. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4382. do { \
  4383. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4384. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4385. } while (0)
  4386. /* This control bit is applicable to only Producer, which updates Ring ID field
  4387. * of each descriptor before pushing into the ring.
  4388. * 0: updates ring_id(default)
  4389. * 1: ring_id updating disabled */
  4390. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4392. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4393. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4394. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4395. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4396. do { \
  4397. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4398. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4399. } while (0)
  4400. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4401. * of each descriptor before pushing into the ring.
  4402. * 0: updates Loopcnt(default)
  4403. * 1: Loopcnt updating disabled */
  4404. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4405. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4406. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4407. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4408. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4409. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4410. do { \
  4411. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4412. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4413. } while (0)
  4414. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4415. * into security_id port of GXI/AXI. */
  4416. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4417. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4418. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4419. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4420. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4421. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4422. do { \
  4423. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4424. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4425. } while (0)
  4426. /* During MSI write operation, SRNG drives value of this register bit into
  4427. * swap bit of GXI/AXI. */
  4428. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4429. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4430. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4431. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4432. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4433. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4434. do { \
  4435. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4436. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4437. } while (0)
  4438. /* During Pointer write operation, SRNG drives value of this register bit into
  4439. * swap bit of GXI/AXI. */
  4440. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4441. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4442. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4443. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4444. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4445. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4446. do { \
  4447. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4448. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4449. } while (0)
  4450. /* During any data or TLV write operation, SRNG drives value of this register
  4451. * bit into swap bit of GXI/AXI. */
  4452. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4453. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4454. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4455. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4456. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4457. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4458. do { \
  4459. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4460. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4461. } while (0)
  4462. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4463. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4464. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4465. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4466. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4467. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4468. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4469. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4470. do { \
  4471. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4472. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4473. } while (0)
  4474. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4475. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4476. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4477. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4478. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4479. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4480. do { \
  4481. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4482. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4483. } while (0)
  4484. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4485. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4486. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4487. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4488. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4489. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4490. do { \
  4491. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4492. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4493. } while (0)
  4494. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4495. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4496. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4497. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4498. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4499. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4500. do { \
  4501. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4502. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4503. } while (0)
  4504. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4505. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4506. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4507. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4508. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4509. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4510. do { \
  4511. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4512. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4513. } while (0)
  4514. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4515. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4516. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4517. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4518. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4519. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4520. do { \
  4521. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4522. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4523. } while (0)
  4524. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4525. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4526. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4527. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4528. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4529. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4530. do { \
  4531. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4532. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4533. } while (0)
  4534. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4535. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4536. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4537. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4538. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4539. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4540. do { \
  4541. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4542. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4543. } while (0)
  4544. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4545. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4546. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4547. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4548. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4549. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4550. do { \
  4551. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4552. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4553. } while (0)
  4554. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4555. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4556. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4557. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4558. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4559. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4560. do { \
  4561. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4562. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4563. } while (0)
  4564. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4565. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4566. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4567. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4568. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4569. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4570. do { \
  4571. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4572. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4573. } while (0)
  4574. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4575. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4576. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4577. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4578. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4579. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4580. do { \
  4581. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4582. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4583. } while (0)
  4584. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4585. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4586. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4587. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4588. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4589. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4590. do { \
  4591. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4592. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4593. } while (0)
  4594. /**
  4595. * @brief host -> target RX ring selection config message
  4596. *
  4597. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4598. *
  4599. * @details
  4600. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4601. * configure RXDMA rings.
  4602. * The configuration is per ring based and includes both packet subtypes
  4603. * and PPDU/MPDU TLVs.
  4604. *
  4605. * The message would appear as follows:
  4606. *
  4607. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4608. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4609. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4610. * |-------------------------------------------------------------------|
  4611. * | rsvd2 | ring_buffer_size |
  4612. * |-------------------------------------------------------------------|
  4613. * | packet_type_enable_flags_0 |
  4614. * |-------------------------------------------------------------------|
  4615. * | packet_type_enable_flags_1 |
  4616. * |-------------------------------------------------------------------|
  4617. * | packet_type_enable_flags_2 |
  4618. * |-------------------------------------------------------------------|
  4619. * | packet_type_enable_flags_3 |
  4620. * |-------------------------------------------------------------------|
  4621. * | tlv_filter_in_flags |
  4622. * |-------------------------------------------------------------------|
  4623. * | rx_header_offset | rx_packet_offset |
  4624. * |-------------------------------------------------------------------|
  4625. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4626. * |-------------------------------------------------------------------|
  4627. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4628. * |-------------------------------------------------------------------|
  4629. * | rsvd3 | rx_attention_offset |
  4630. * |-------------------------------------------------------------------|
  4631. * | rsvd4 | mo| fp| rx_drop_threshold |
  4632. * | |ndp|ndp| |
  4633. * |-------------------------------------------------------------------|
  4634. * Where:
  4635. * PS = pkt_swap
  4636. * SS = status_swap
  4637. * OV = rx_offsets_valid
  4638. * DT = drop_thresh_valid
  4639. * The message is interpreted as follows:
  4640. * dword0 - b'0:7 - msg_type: This will be set to
  4641. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4642. * b'8:15 - pdev_id:
  4643. * 0 (for rings at SOC/UMAC level),
  4644. * 1/2/3 mac id (for rings at LMAC level)
  4645. * b'16:23 - ring_id : Identify the ring to configure.
  4646. * More details can be got from enum htt_srng_ring_id
  4647. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4648. * BUF_RING_CFG_0 defs within HW .h files,
  4649. * e.g. wmac_top_reg_seq_hwioreg.h
  4650. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4651. * BUF_RING_CFG_0 defs within HW .h files,
  4652. * e.g. wmac_top_reg_seq_hwioreg.h
  4653. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4654. * configuration fields are valid
  4655. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4656. * rx_drop_threshold field is valid
  4657. * b'28:31 - rsvd1: reserved for future use
  4658. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4659. * in byte units.
  4660. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4661. * - b'16:31 - rsvd2: Reserved for future use
  4662. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4663. * Enable MGMT packet from 0b0000 to 0b1001
  4664. * bits from low to high: FP, MD, MO - 3 bits
  4665. * FP: Filter_Pass
  4666. * MD: Monitor_Direct
  4667. * MO: Monitor_Other
  4668. * 10 mgmt subtypes * 3 bits -> 30 bits
  4669. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4670. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4671. * Enable MGMT packet from 0b1010 to 0b1111
  4672. * bits from low to high: FP, MD, MO - 3 bits
  4673. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4674. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4675. * Enable CTRL packet from 0b0000 to 0b1001
  4676. * bits from low to high: FP, MD, MO - 3 bits
  4677. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4678. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4679. * Enable CTRL packet from 0b1010 to 0b1111,
  4680. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4681. * bits from low to high: FP, MD, MO - 3 bits
  4682. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4683. * dword6 - b'0:31 - tlv_filter_in_flags:
  4684. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4685. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4686. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4687. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4688. * A value of 0 will be considered as ignore this config.
  4689. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4690. * e.g. wmac_top_reg_seq_hwioreg.h
  4691. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4692. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4693. * A value of 0 will be considered as ignore this config.
  4694. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4695. * e.g. wmac_top_reg_seq_hwioreg.h
  4696. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4697. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4698. * A value of 0 will be considered as ignore this config.
  4699. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4700. * e.g. wmac_top_reg_seq_hwioreg.h
  4701. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4702. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4703. * A value of 0 will be considered as ignore this config.
  4704. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4705. * e.g. wmac_top_reg_seq_hwioreg.h
  4706. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4707. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4708. * A value of 0 will be considered as ignore this config.
  4709. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4710. * e.g. wmac_top_reg_seq_hwioreg.h
  4711. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4712. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4713. * A value of 0 will be considered as ignore this config.
  4714. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4715. * e.g. wmac_top_reg_seq_hwioreg.h
  4716. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4717. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4718. * A value of 0 will be considered as ignore this config.
  4719. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4720. * e.g. wmac_top_reg_seq_hwioreg.h
  4721. * - b'16:31 - rsvd3 for future use
  4722. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4723. * to source rings. Consumer drops packets if the available
  4724. * words in the ring falls below the configured threshold
  4725. * value.
  4726. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4727. * by host. 1 -> subscribed
  4728. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4729. * by host. 1 -> subscribed
  4730. */
  4731. PREPACK struct htt_rx_ring_selection_cfg_t {
  4732. A_UINT32 msg_type: 8,
  4733. pdev_id: 8,
  4734. ring_id: 8,
  4735. status_swap: 1,
  4736. pkt_swap: 1,
  4737. rx_offsets_valid: 1,
  4738. drop_thresh_valid: 1,
  4739. rsvd1: 4;
  4740. A_UINT32 ring_buffer_size: 16,
  4741. rsvd2: 16;
  4742. A_UINT32 packet_type_enable_flags_0;
  4743. A_UINT32 packet_type_enable_flags_1;
  4744. A_UINT32 packet_type_enable_flags_2;
  4745. A_UINT32 packet_type_enable_flags_3;
  4746. A_UINT32 tlv_filter_in_flags;
  4747. A_UINT32 rx_packet_offset: 16,
  4748. rx_header_offset: 16;
  4749. A_UINT32 rx_mpdu_end_offset: 16,
  4750. rx_mpdu_start_offset: 16;
  4751. A_UINT32 rx_msdu_end_offset: 16,
  4752. rx_msdu_start_offset: 16;
  4753. A_UINT32 rx_attn_offset: 16,
  4754. rsvd3: 16;
  4755. A_UINT32 rx_drop_threshold: 10,
  4756. fp_ndp: 1,
  4757. mo_ndp: 1,
  4758. rsvd4: 20;
  4759. } POSTPACK;
  4760. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4761. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4762. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4763. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4764. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4765. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4766. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4769. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4770. } while (0)
  4771. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4772. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4773. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4774. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4775. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4776. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4777. do { \
  4778. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4779. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4780. } while (0)
  4781. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4782. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4783. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4784. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4785. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4786. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4787. do { \
  4788. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4789. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4790. } while (0)
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4794. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4795. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4797. do { \
  4798. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4799. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4800. } while (0)
  4801. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4802. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4803. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4804. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4805. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4806. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4807. do { \
  4808. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4809. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4810. } while (0)
  4811. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4812. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4813. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4814. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4815. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4816. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4817. do { \
  4818. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4819. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4820. } while (0)
  4821. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4822. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4823. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4824. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4825. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4826. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4827. do { \
  4828. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4829. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4830. } while (0)
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4834. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4835. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4837. do { \
  4838. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4839. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4840. } while (0)
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4844. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4845. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4847. do { \
  4848. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4849. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4850. } while (0)
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4854. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4855. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4857. do { \
  4858. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4859. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4860. } while (0)
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4864. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4865. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4867. do { \
  4868. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4869. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4870. } while (0)
  4871. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4872. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4873. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4874. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4875. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4876. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4877. do { \
  4878. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4879. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4880. } while (0)
  4881. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4882. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4883. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4884. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4885. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4886. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4887. do { \
  4888. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4889. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4890. } while (0)
  4891. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4892. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4893. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4894. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4895. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4896. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4897. do { \
  4898. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4899. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4900. } while (0)
  4901. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4902. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4903. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4904. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4905. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4906. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4907. do { \
  4908. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4909. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4910. } while (0)
  4911. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4912. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4913. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4914. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4915. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4916. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4917. do { \
  4918. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4919. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4920. } while (0)
  4921. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4922. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4923. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4924. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4925. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4926. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4927. do { \
  4928. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4929. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4930. } while (0)
  4931. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4932. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4933. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4934. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4935. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4936. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4937. do { \
  4938. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4939. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4940. } while (0)
  4941. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4942. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4943. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4944. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4945. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4946. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4947. do { \
  4948. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4949. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4950. } while (0)
  4951. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4952. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4953. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4954. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4955. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4956. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4957. do { \
  4958. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4959. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4960. } while (0)
  4961. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4962. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4963. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4964. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4965. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4966. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4969. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4970. } while (0)
  4971. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4972. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4973. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4974. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4975. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4976. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4977. do { \
  4978. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4979. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4980. } while (0)
  4981. /*
  4982. * Subtype based MGMT frames enable bits.
  4983. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4984. */
  4985. /* association request */
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4992. /* association response */
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4999. /* Reassociation request */
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5006. /* Reassociation response */
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5013. /* Probe request */
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5020. /* Probe response */
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5027. /* Timing Advertisement */
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5034. /* Reserved */
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5041. /* Beacon */
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5048. /* ATIM */
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5055. /* Disassociation */
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5062. /* Authentication */
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5069. /* Deauthentication */
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5076. /* Action */
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5083. /* Action No Ack */
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5090. /* Reserved */
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5097. /*
  5098. * Subtype based CTRL frames enable bits.
  5099. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5100. */
  5101. /* Reserved */
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5108. /* Reserved */
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5115. /* Reserved */
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5122. /* Reserved */
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5129. /* Reserved */
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5136. /* Reserved */
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5143. /* Reserved */
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5150. /* Control Wrapper */
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5157. /* Block Ack Request */
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5164. /* Block Ack*/
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5171. /* PS-POLL */
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5178. /* RTS */
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5185. /* CTS */
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5192. /* ACK */
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5199. /* CF-END */
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5206. /* CF-END + CF-ACK */
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5213. /* Multicast data */
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5220. /* Unicast data */
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5227. /* NULL data */
  5228. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5233. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5234. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5235. do { \
  5236. HTT_CHECK_SET_VAL(httsym, value); \
  5237. (word) |= (value) << httsym##_S; \
  5238. } while (0)
  5239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5240. (((word) & httsym##_M) >> httsym##_S)
  5241. #define htt_rx_ring_pkt_enable_subtype_set( \
  5242. word, flag, mode, type, subtype, val) \
  5243. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5244. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5245. #define htt_rx_ring_pkt_enable_subtype_get( \
  5246. word, flag, mode, type, subtype) \
  5247. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5248. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5249. /* Definition to filter in TLVs */
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5263. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5264. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5266. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5267. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5268. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5269. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5270. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5271. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5272. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5273. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5274. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5275. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5276. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5277. do { \
  5278. HTT_CHECK_SET_VAL(httsym, enable); \
  5279. (word) |= (enable) << httsym##_S; \
  5280. } while (0)
  5281. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5282. (((word) & httsym##_M) >> httsym##_S)
  5283. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5284. HTT_RX_RING_TLV_ENABLE_SET( \
  5285. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5286. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5287. HTT_RX_RING_TLV_ENABLE_GET( \
  5288. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5289. /**
  5290. * @brief host -> target TX monitor config message
  5291. *
  5292. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5293. *
  5294. * @details
  5295. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5296. * configure RXDMA rings.
  5297. * The configuration is per ring based and includes both packet types
  5298. * and PPDU/MPDU TLVs.
  5299. *
  5300. * The message would appear as follows:
  5301. *
  5302. * |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|
  5303. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5304. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5305. * |-----------+--------+--------+-----+------------------------------------|
  5306. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5307. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5308. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5309. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5310. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5311. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5312. * |------------------------------------------------------------------------|
  5313. * | tlv_filter_mask_in0 |
  5314. * |------------------------------------------------------------------------|
  5315. * | tlv_filter_mask_in1 |
  5316. * |------------------------------------------------------------------------|
  5317. * | tlv_filter_mask_in2 |
  5318. * |------------------------------------------------------------------------|
  5319. * | tlv_filter_mask_in3 |
  5320. * |-----------------+-----------------+---------------------+--------------|
  5321. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5322. * |------------------------------------------------------------------------|
  5323. * | pcu_ppdu_setup_word_mask |
  5324. * |--------------------+--+--+--+-----+---------------------+--------------|
  5325. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5326. * |------------------------------------------------------------------------|
  5327. *
  5328. * Where:
  5329. * PS = pkt_swap
  5330. * SS = status_swap
  5331. * The message is interpreted as follows:
  5332. * dword0 - b'0:7 - msg_type: This will be set to
  5333. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5334. * b'8:15 - pdev_id:
  5335. * 0 (for rings at SOC level),
  5336. * 1/2/3 mac id (for rings at LMAC level)
  5337. * b'16:23 - ring_id : Identify the ring to configure.
  5338. * More details can be got from enum htt_srng_ring_id
  5339. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5340. * BUF_RING_CFG_0 defs within HW .h files,
  5341. * e.g. wmac_top_reg_seq_hwioreg.h
  5342. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5343. * BUF_RING_CFG_0 defs within HW .h files,
  5344. * e.g. wmac_top_reg_seq_hwioreg.h
  5345. * b'26:31 - rsvd1: reserved for future use
  5346. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5347. * in byte units.
  5348. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5349. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5350. * 64, 128, 256.
  5351. * If all 3 bits are set config length is > 256.
  5352. * if val is '0', then ignore this field.
  5353. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5354. * 64, 128, 256.
  5355. * If all 3 bits are set config length is > 256.
  5356. * if val is '0', then ignore this field.
  5357. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5358. * 64, 128, 256.
  5359. * If all 3 bits are set config length is > 256.
  5360. * If val is '0', then ignore this field.
  5361. * - b'25:31 - rsvd2: Reserved for future use
  5362. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5363. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5364. * If packet_type_enable_flags is '1' for MGMT type,
  5365. * monitor will ignore this bit and allow this TLV.
  5366. * If packet_type_enable_flags is '0' for MGMT type,
  5367. * monitor will use this bit to enable/disable logging
  5368. * of this TLV.
  5369. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5370. * If packet_type_enable_flags is '1' for CTRL type,
  5371. * monitor will ignore this bit and allow this TLV.
  5372. * If packet_type_enable_flags is '0' for CTRL type,
  5373. * monitor will use this bit to enable/disable logging
  5374. * of this TLV.
  5375. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5376. * If packet_type_enable_flags is '1' for DATA type,
  5377. * monitor will ignore this bit and allow this TLV.
  5378. * If packet_type_enable_flags is '0' for DATA type,
  5379. * monitor will use this bit to enable/disable logging
  5380. * of this TLV.
  5381. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5382. * If packet_type_enable_flags is '1' for MGMT type,
  5383. * monitor will ignore this bit and allow this TLV.
  5384. * If packet_type_enable_flags is '0' for MGMT type,
  5385. * monitor will use this bit to enable/disable logging
  5386. * of this TLV.
  5387. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5388. * If packet_type_enable_flags is '1' for CTRL type,
  5389. * monitor will ignore this bit and allow this TLV.
  5390. * If packet_type_enable_flags is '0' for CTRL type,
  5391. * monitor will use this bit to enable/disable logging
  5392. * of this TLV.
  5393. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5394. * If packet_type_enable_flags is '1' for DATA type,
  5395. * monitor will ignore this bit and allow this TLV.
  5396. * If packet_type_enable_flags is '0' for DATA type,
  5397. * monitor will use this bit to enable/disable logging
  5398. * of this TLV.
  5399. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5400. * If packet_type_enable_flags is '1' for MGMT type,
  5401. * monitor will ignore this bit and allow this TLV.
  5402. * If packet_type_enable_flags is '0' for MGMT type,
  5403. * monitor will use this bit to enable/disable logging
  5404. * of this TLV.
  5405. * If filter_in_TX_MPDU_START = 1 it is recommended
  5406. * to set this bit.
  5407. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5408. * If packet_type_enable_flags is '1' for CTRL type,
  5409. * monitor will ignore this bit and allow this TLV.
  5410. * If packet_type_enable_flags is '0' for CTRL type,
  5411. * monitor will use this bit to enable/disable logging
  5412. * of this TLV.
  5413. * If filter_in_TX_MPDU_START = 1 it is recommended
  5414. * to set this bit.
  5415. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5416. * If packet_type_enable_flags is '1' for DATA type,
  5417. * monitor will ignore this bit and allow this TLV.
  5418. * If packet_type_enable_flags is '0' for DATA type,
  5419. * monitor will use this bit to enable/disable logging
  5420. * of this TLV.
  5421. * If filter_in_TX_MPDU_START = 1 it is recommended
  5422. * to set this bit.
  5423. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5424. * If packet_type_enable_flags is '1' for MGMT type,
  5425. * monitor will ignore this bit and allow this TLV.
  5426. * If packet_type_enable_flags is '0' for MGMT type,
  5427. * monitor will use this bit to enable/disable logging
  5428. * of this TLV.
  5429. * If filter_in_TX_MSDU_START = 1 it is recommended
  5430. * to set this bit.
  5431. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5432. * If packet_type_enable_flags is '1' for CTRL type,
  5433. * monitor will ignore this bit and allow this TLV.
  5434. * If packet_type_enable_flags is '0' for CTRL type,
  5435. * monitor will use this bit to enable/disable logging
  5436. * of this TLV.
  5437. * If filter_in_TX_MSDU_START = 1 it is recommended
  5438. * to set this bit.
  5439. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5440. * If packet_type_enable_flags is '1' for DATA type,
  5441. * monitor will ignore this bit and allow this TLV.
  5442. * If packet_type_enable_flags is '0' for DATA type,
  5443. * monitor will use this bit to enable/disable logging
  5444. * of this TLV.
  5445. * If filter_in_TX_MSDU_START = 1 it is recommended
  5446. * to set this bit.
  5447. * b'15:31 - rsvd3: Reserved for future use
  5448. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5449. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5450. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5451. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5452. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5453. * - b'8:15 - tx_peer_entry_word_mask:
  5454. * - b'16:23 - tx_queue_ext_word_mask:
  5455. * - b'24:31 - tx_msdu_start_word_mask:
  5456. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5457. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5458. * - b'8:15 - rxpcu_user_setup_word_mask:
  5459. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5460. * MGMT, CTRL, DATA
  5461. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5462. * 0 -> MSDU level logging is enabled
  5463. * (valid only if bit is set in
  5464. * pkt_type_enable_msdu_or_mpdu_logging)
  5465. * 1 -> MPDU level logging is enabled
  5466. * (valid only if bit is set in
  5467. * pkt_type_enable_msdu_or_mpdu_logging)
  5468. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5469. * 0 -> MSDU level logging is enabled
  5470. * (valid only if bit is set in
  5471. * pkt_type_enable_msdu_or_mpdu_logging)
  5472. * 1 -> MPDU level logging is enabled
  5473. * (valid only if bit is set in
  5474. * pkt_type_enable_msdu_or_mpdu_logging)
  5475. * - b'21 - dma_mpdu_data(D) : For DATA
  5476. * 0 -> MSDU level logging is enabled
  5477. * (valid only if bit is set in
  5478. * pkt_type_enable_msdu_or_mpdu_logging)
  5479. * 1 -> MPDU level logging is enabled
  5480. * (valid only if bit is set in
  5481. * pkt_type_enable_msdu_or_mpdu_logging)
  5482. * - b'22:31 - rsvd4 for future use
  5483. */
  5484. PREPACK struct htt_tx_monitor_cfg_t {
  5485. A_UINT32 msg_type: 8,
  5486. pdev_id: 8,
  5487. ring_id: 8,
  5488. status_swap: 1,
  5489. pkt_swap: 1,
  5490. rsvd1: 6;
  5491. A_UINT32 ring_buffer_size: 16,
  5492. config_length_mgmt: 3,
  5493. config_length_ctrl: 3,
  5494. config_length_data: 3,
  5495. rsvd2: 7;
  5496. A_UINT32 pkt_type_enable_flags: 3,
  5497. filter_in_tx_mpdu_start_mgmt: 1,
  5498. filter_in_tx_mpdu_start_ctrl: 1,
  5499. filter_in_tx_mpdu_start_data: 1,
  5500. filter_in_tx_msdu_start_mgmt: 1,
  5501. filter_in_tx_msdu_start_ctrl: 1,
  5502. filter_in_tx_msdu_start_data: 1,
  5503. filter_in_tx_mpdu_end_mgmt: 1,
  5504. filter_in_tx_mpdu_end_ctrl: 1,
  5505. filter_in_tx_mpdu_end_data: 1,
  5506. filter_in_tx_msdu_end_mgmt: 1,
  5507. filter_in_tx_msdu_end_ctrl: 1,
  5508. filter_in_tx_msdu_end_data: 1,
  5509. rsvd3: 17;
  5510. A_UINT32 tlv_filter_mask_in0;
  5511. A_UINT32 tlv_filter_mask_in1;
  5512. A_UINT32 tlv_filter_mask_in2;
  5513. A_UINT32 tlv_filter_mask_in3;
  5514. A_UINT32 tx_fes_setup_word_mask: 8,
  5515. tx_peer_entry_word_mask: 8,
  5516. tx_queue_ext_word_mask: 8,
  5517. tx_msdu_start_word_mask: 8;
  5518. A_UINT32 pcu_ppdu_setup_word_mask;
  5519. A_UINT32 tx_mpdu_start_word_mask: 8,
  5520. rxpcu_user_setup_word_mask: 8,
  5521. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5522. dma_mpdu_mgmt: 1,
  5523. dma_mpdu_ctrl: 1,
  5524. dma_mpdu_data: 1,
  5525. rsvd4: 10;
  5526. } POSTPACK;
  5527. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5528. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5529. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5530. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5531. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5532. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5533. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5534. do { \
  5535. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5536. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5537. } while (0)
  5538. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5539. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5540. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5541. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5542. HTT_TX_MONITOR_CFG_RING_ID_S)
  5543. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5544. do { \
  5545. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5546. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5547. } while (0)
  5548. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5549. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5550. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5551. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5552. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5553. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5556. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5557. } while (0)
  5558. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5559. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5560. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5561. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5562. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5563. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5564. do { \
  5565. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5566. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5567. } while (0)
  5568. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5569. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5570. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5571. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5572. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5573. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5574. do { \
  5575. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5576. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5577. } while (0)
  5578. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5579. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  5580. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5581. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5582. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5583. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5584. do { \
  5585. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5586. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5587. } while (0)
  5588. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5589. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  5590. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5591. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5592. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5593. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5594. do { \
  5595. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5596. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5597. } while (0)
  5598. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5599. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  5600. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5601. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5602. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5603. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5604. do { \
  5605. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5606. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5607. } while (0)
  5608. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5609. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5610. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5611. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5612. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5613. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5614. do { \
  5615. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5616. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5617. } while (0)
  5618. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  5619. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  5620. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  5621. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  5622. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  5623. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  5626. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  5627. } while (0)
  5628. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  5629. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  5630. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  5631. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  5632. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  5633. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  5634. do { \
  5635. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  5636. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  5637. } while (0
  5638. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  5639. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  5640. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  5641. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  5642. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  5643. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  5644. do { \
  5645. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  5646. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  5647. } while (0)
  5648. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  5649. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  5650. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  5651. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  5652. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  5653. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  5654. do { \
  5655. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  5656. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  5657. } while (0)
  5658. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  5659. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  5660. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  5661. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  5662. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  5663. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  5664. do { \
  5665. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  5666. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  5667. } while (0
  5668. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  5669. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  5670. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  5671. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  5672. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  5673. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  5674. do { \
  5675. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  5676. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  5677. } while (0)
  5678. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  5679. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  5680. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  5681. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  5682. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  5683. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  5686. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  5687. } while (0)
  5688. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  5689. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  5690. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  5691. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  5692. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  5693. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  5694. do { \
  5695. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  5696. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  5697. } while (0
  5698. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  5699. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  5700. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  5701. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  5702. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  5703. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  5704. do { \
  5705. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  5706. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  5707. } while (0)
  5708. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  5709. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  5710. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  5711. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  5712. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  5713. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  5716. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  5717. } while (0)
  5718. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  5719. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  5720. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  5721. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  5722. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  5723. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  5726. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  5727. } while (0
  5728. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  5729. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  5730. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  5731. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  5732. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  5733. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  5734. do { \
  5735. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  5736. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  5737. } while (0)
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5741. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5742. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5744. do { \
  5745. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5746. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5747. } while (0)
  5748. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  5749. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5750. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5751. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5752. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5753. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5754. do { \
  5755. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5756. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5757. } while (0)
  5758. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  5759. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  5760. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5761. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5762. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5763. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5764. do { \
  5765. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5766. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5767. } while (0)
  5768. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  5769. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  5770. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5771. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5772. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5773. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5774. do { \
  5775. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5776. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5777. } while (0)
  5778. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  5779. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  5780. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5781. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5782. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5783. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5784. do { \
  5785. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5786. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5787. } while (0)
  5788. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  5789. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  5790. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5791. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5792. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5793. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5794. do { \
  5795. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5796. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5797. } while (0)
  5798. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  5799. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5800. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5801. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5802. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5803. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5804. do { \
  5805. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5806. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5807. } while (0)
  5808. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  5809. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  5810. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5811. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5812. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5813. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5814. do { \
  5815. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5816. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5817. } while (0)
  5818. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5819. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5820. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5821. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5822. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5823. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5824. do { \
  5825. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5826. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5827. } while (0)
  5828. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  5829. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  5830. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  5831. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  5832. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  5833. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5834. do { \
  5835. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  5836. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  5837. } while (0)
  5838. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  5839. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  5840. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  5841. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  5842. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  5843. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5844. do { \
  5845. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  5846. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  5847. } while (0)
  5848. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  5849. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  5850. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  5851. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  5852. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  5853. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5854. do { \
  5855. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  5856. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  5857. } while (0)
  5858. /*
  5859. * pkt_type_enable_flags
  5860. */
  5861. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  5862. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  5863. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  5864. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  5865. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  5866. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  5867. /*
  5868. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  5869. */
  5870. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5871. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5872. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5873. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5874. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5875. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5876. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5877. do { \
  5878. HTT_CHECK_SET_VAL(httsym, value); \
  5879. (word) |= (value) << httsym##_S; \
  5880. } while (0)
  5881. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5882. (((word) & httsym##_M) >> httsym##_S)
  5883. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  5884. * type -> MGMT, CTRL, DATA*/
  5885. #define htt_tx_ring_pkt_type_set( \
  5886. word, mode, type, val) \
  5887. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5888. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5889. #define htt_tx_ring_pkt_type_get( \
  5890. word, mode, type) \
  5891. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5892. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5893. /* Definition to filter in TLVs */
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5958. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5959. do { \
  5960. HTT_CHECK_SET_VAL(httsym, enable); \
  5961. (word) |= (enable) << httsym##_S; \
  5962. } while (0)
  5963. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5964. (((word) & httsym##_M) >> httsym##_S)
  5965. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5966. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5967. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5968. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5969. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5970. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6035. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6036. do { \
  6037. HTT_CHECK_SET_VAL(httsym, enable); \
  6038. (word) |= (enable) << httsym##_S; \
  6039. } while (0)
  6040. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6041. (((word) & httsym##_M) >> httsym##_S)
  6042. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6043. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6044. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6045. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6046. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6047. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6112. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6113. do { \
  6114. HTT_CHECK_SET_VAL(httsym, enable); \
  6115. (word) |= (enable) << httsym##_S; \
  6116. } while (0)
  6117. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6118. (((word) & httsym##_M) >> httsym##_S)
  6119. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6120. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6121. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6122. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6123. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6124. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6169. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6170. do { \
  6171. HTT_CHECK_SET_VAL(httsym, enable); \
  6172. (word) |= (enable) << httsym##_S; \
  6173. } while (0)
  6174. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6175. (((word) & httsym##_M) >> httsym##_S)
  6176. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6177. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6178. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6179. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6180. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6181. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6182. /**
  6183. * @brief host --> target Receive Flow Steering configuration message definition
  6184. *
  6185. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6186. *
  6187. * host --> target Receive Flow Steering configuration message definition.
  6188. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6189. * The reason for this is we want RFS to be configured and ready before MAC
  6190. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6191. *
  6192. * |31 24|23 16|15 9|8|7 0|
  6193. * |----------------+----------------+----------------+----------------|
  6194. * | reserved |E| msg type |
  6195. * |-------------------------------------------------------------------|
  6196. * Where E = RFS enable flag
  6197. *
  6198. * The RFS_CONFIG message consists of a single 4-byte word.
  6199. *
  6200. * Header fields:
  6201. * - MSG_TYPE
  6202. * Bits 7:0
  6203. * Purpose: identifies this as a RFS config msg
  6204. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6205. * - RFS_CONFIG
  6206. * Bit 8
  6207. * Purpose: Tells target whether to enable (1) or disable (0)
  6208. * flow steering feature when sending rx indication messages to host
  6209. */
  6210. #define HTT_H2T_RFS_CONFIG_M 0x100
  6211. #define HTT_H2T_RFS_CONFIG_S 8
  6212. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6213. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6214. HTT_H2T_RFS_CONFIG_S)
  6215. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6216. do { \
  6217. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6218. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6219. } while (0)
  6220. #define HTT_RFS_CFG_REQ_BYTES 4
  6221. /**
  6222. * @brief host -> target FW extended statistics retrieve
  6223. *
  6224. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6225. *
  6226. * @details
  6227. * The following field definitions describe the format of the HTT host
  6228. * to target FW extended stats retrieve message.
  6229. * The message specifies the type of stats the host wants to retrieve.
  6230. *
  6231. * |31 24|23 16|15 8|7 0|
  6232. * |-----------------------------------------------------------|
  6233. * | reserved | stats type | pdev_mask | msg type |
  6234. * |-----------------------------------------------------------|
  6235. * | config param [0] |
  6236. * |-----------------------------------------------------------|
  6237. * | config param [1] |
  6238. * |-----------------------------------------------------------|
  6239. * | config param [2] |
  6240. * |-----------------------------------------------------------|
  6241. * | config param [3] |
  6242. * |-----------------------------------------------------------|
  6243. * | reserved |
  6244. * |-----------------------------------------------------------|
  6245. * | cookie LSBs |
  6246. * |-----------------------------------------------------------|
  6247. * | cookie MSBs |
  6248. * |-----------------------------------------------------------|
  6249. * Header fields:
  6250. * - MSG_TYPE
  6251. * Bits 7:0
  6252. * Purpose: identifies this is a extended stats upload request message
  6253. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6254. * - PDEV_MASK
  6255. * Bits 8:15
  6256. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6257. * Value: This is a overloaded field, refer to usage and interpretation of
  6258. * PDEV in interface document.
  6259. * Bit 8 : Reserved for SOC stats
  6260. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6261. * Indicates MACID_MASK in DBS
  6262. * - STATS_TYPE
  6263. * Bits 23:16
  6264. * Purpose: identifies which FW statistics to upload
  6265. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6266. * - Reserved
  6267. * Bits 31:24
  6268. * - CONFIG_PARAM [0]
  6269. * Bits 31:0
  6270. * Purpose: give an opaque configuration value to the specified stats type
  6271. * Value: stats-type specific configuration value
  6272. * Refer to htt_stats.h for interpretation for each stats sub_type
  6273. * - CONFIG_PARAM [1]
  6274. * Bits 31:0
  6275. * Purpose: give an opaque configuration value to the specified stats type
  6276. * Value: stats-type specific configuration value
  6277. * Refer to htt_stats.h for interpretation for each stats sub_type
  6278. * - CONFIG_PARAM [2]
  6279. * Bits 31:0
  6280. * Purpose: give an opaque configuration value to the specified stats type
  6281. * Value: stats-type specific configuration value
  6282. * Refer to htt_stats.h for interpretation for each stats sub_type
  6283. * - CONFIG_PARAM [3]
  6284. * Bits 31:0
  6285. * Purpose: give an opaque configuration value to the specified stats type
  6286. * Value: stats-type specific configuration value
  6287. * Refer to htt_stats.h for interpretation for each stats sub_type
  6288. * - Reserved [31:0] for future use.
  6289. * - COOKIE_LSBS
  6290. * Bits 31:0
  6291. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6292. * message with its preceding host->target stats request message.
  6293. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6294. * - COOKIE_MSBS
  6295. * Bits 31:0
  6296. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6297. * message with its preceding host->target stats request message.
  6298. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6299. */
  6300. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6301. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6302. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6303. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6304. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6305. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6306. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6307. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6308. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6309. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6310. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6311. do { \
  6312. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6313. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6314. } while (0)
  6315. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6316. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6317. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6318. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6321. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6322. } while (0)
  6323. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6324. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6325. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6326. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6327. do { \
  6328. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6329. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6330. } while (0)
  6331. /**
  6332. * @brief host -> target FW PPDU_STATS request message
  6333. *
  6334. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6335. *
  6336. * @details
  6337. * The following field definitions describe the format of the HTT host
  6338. * to target FW for PPDU_STATS_CFG msg.
  6339. * The message allows the host to configure the PPDU_STATS_IND messages
  6340. * produced by the target.
  6341. *
  6342. * |31 24|23 16|15 8|7 0|
  6343. * |-----------------------------------------------------------|
  6344. * | REQ bit mask | pdev_mask | msg type |
  6345. * |-----------------------------------------------------------|
  6346. * Header fields:
  6347. * - MSG_TYPE
  6348. * Bits 7:0
  6349. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6350. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6351. * - PDEV_MASK
  6352. * Bits 8:15
  6353. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6354. * Value: This is a overloaded field, refer to usage and interpretation of
  6355. * PDEV in interface document.
  6356. * Bit 8 : Reserved for SOC stats
  6357. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6358. * Indicates MACID_MASK in DBS
  6359. * - REQ_TLV_BIT_MASK
  6360. * Bits 16:31
  6361. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6362. * needs to be included in the target's PPDU_STATS_IND messages.
  6363. * Value: refer htt_ppdu_stats_tlv_tag_t
  6364. *
  6365. */
  6366. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6367. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6368. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6369. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6370. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6371. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6372. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6373. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6374. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6375. do { \
  6376. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6377. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6378. } while (0)
  6379. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6380. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6381. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6382. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6385. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6386. } while (0)
  6387. /**
  6388. * @brief Host-->target HTT RX FSE setup message
  6389. *
  6390. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6391. *
  6392. * @details
  6393. * Through this message, the host will provide details of the flow tables
  6394. * in host DDR along with hash keys.
  6395. * This message can be sent per SOC or per PDEV, which is differentiated
  6396. * by pdev id values.
  6397. * The host will allocate flow search table and sends table size,
  6398. * physical DMA address of flow table, and hash keys to firmware to
  6399. * program into the RXOLE FSE HW block.
  6400. *
  6401. * The following field definitions describe the format of the RX FSE setup
  6402. * message sent from the host to target
  6403. *
  6404. * Header fields:
  6405. * dword0 - b'7:0 - msg_type: This will be set to
  6406. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6407. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6408. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6409. * pdev's LMAC ring.
  6410. * b'31:16 - reserved : Reserved for future use
  6411. * dword1 - b'19:0 - number of records: This field indicates the number of
  6412. * entries in the flow table. For example: 8k number of
  6413. * records is equivalent to
  6414. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6415. * b'27:20 - max search: This field specifies the skid length to FSE
  6416. * parser HW module whenever match is not found at the
  6417. * exact index pointed by hash.
  6418. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6419. * Refer htt_ip_da_sa_prefix below for more details.
  6420. * b'31:30 - reserved: Reserved for future use
  6421. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6422. * table allocated by host in DDR
  6423. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6424. * table allocated by host in DDR
  6425. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6426. * entry hashing
  6427. *
  6428. *
  6429. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6430. * |---------------------------------------------------------------|
  6431. * | reserved | pdev_id | MSG_TYPE |
  6432. * |---------------------------------------------------------------|
  6433. * |resvd|IPDSA| max_search | Number of records |
  6434. * |---------------------------------------------------------------|
  6435. * | base address lo |
  6436. * |---------------------------------------------------------------|
  6437. * | base address high |
  6438. * |---------------------------------------------------------------|
  6439. * | toeplitz key 31_0 |
  6440. * |---------------------------------------------------------------|
  6441. * | toeplitz key 63_32 |
  6442. * |---------------------------------------------------------------|
  6443. * | toeplitz key 95_64 |
  6444. * |---------------------------------------------------------------|
  6445. * | toeplitz key 127_96 |
  6446. * |---------------------------------------------------------------|
  6447. * | toeplitz key 159_128 |
  6448. * |---------------------------------------------------------------|
  6449. * | toeplitz key 191_160 |
  6450. * |---------------------------------------------------------------|
  6451. * | toeplitz key 223_192 |
  6452. * |---------------------------------------------------------------|
  6453. * | toeplitz key 255_224 |
  6454. * |---------------------------------------------------------------|
  6455. * | toeplitz key 287_256 |
  6456. * |---------------------------------------------------------------|
  6457. * | reserved | toeplitz key 314_288(26:0 bits) |
  6458. * |---------------------------------------------------------------|
  6459. * where:
  6460. * IPDSA = ip_da_sa
  6461. */
  6462. /**
  6463. * @brief: htt_ip_da_sa_prefix
  6464. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6465. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6466. * documentation per RFC3849
  6467. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6468. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6469. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6470. */
  6471. enum htt_ip_da_sa_prefix {
  6472. HTT_RX_IPV6_20010db8,
  6473. HTT_RX_IPV4_MAPPED_IPV6,
  6474. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6475. HTT_RX_IPV6_64FF9B,
  6476. };
  6477. /**
  6478. * @brief Host-->target HTT RX FISA configure and enable
  6479. *
  6480. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6481. *
  6482. * @details
  6483. * The host will send this command down to configure and enable the FISA
  6484. * operational params.
  6485. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6486. * register.
  6487. * Should configure both the MACs.
  6488. *
  6489. * dword0 - b'7:0 - msg_type:
  6490. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6491. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6492. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6493. * pdev's LMAC ring.
  6494. * b'31:16 - reserved : Reserved for future use
  6495. *
  6496. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6497. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6498. * packets. 1 flow search will be skipped
  6499. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6500. * tcp,udp packets
  6501. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6502. * calculation
  6503. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6504. * calculation
  6505. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6506. * calculation
  6507. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6508. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6509. * length
  6510. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6511. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6512. * length
  6513. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6514. * num jump
  6515. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6516. * num jump
  6517. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6518. * data type switch has happend for MPDU Sequence num jump
  6519. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6520. * for MPDU Sequence num jump
  6521. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6522. * for decrypt errors
  6523. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6524. * while aggregating a msdu
  6525. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6526. * The aggregation is done until (number of MSDUs aggregated
  6527. * < LIMIT + 1)
  6528. * b'31:18 - Reserved
  6529. *
  6530. * fisa_control_value - 32bit value FW can write to register
  6531. *
  6532. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6533. * Threshold value for FISA timeout (units are microseconds).
  6534. * When the global timestamp exceeds this threshold, FISA
  6535. * aggregation will be restarted.
  6536. * A value of 0 means timeout is disabled.
  6537. * Compare the threshold register with timestamp field in
  6538. * flow entry to generate timeout for the flow.
  6539. *
  6540. * |31 18 |17 16|15 8|7 0|
  6541. * |-------------------------------------------------------------|
  6542. * | reserved | pdev_mask | msg type |
  6543. * |-------------------------------------------------------------|
  6544. * | reserved | FISA_CTRL |
  6545. * |-------------------------------------------------------------|
  6546. * | FISA_TIMEOUT_THRESH |
  6547. * |-------------------------------------------------------------|
  6548. */
  6549. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6550. A_UINT32 msg_type:8,
  6551. pdev_id:8,
  6552. reserved0:16;
  6553. /**
  6554. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6555. * [17:0]
  6556. */
  6557. union {
  6558. /*
  6559. * fisa_control_bits structure is deprecated.
  6560. * Please use fisa_control_bits_v2 going forward.
  6561. */
  6562. struct {
  6563. A_UINT32 fisa_enable: 1,
  6564. ipsec_skip_search: 1,
  6565. nontcp_skip_search: 1,
  6566. add_ipv4_fixed_hdr_len: 1,
  6567. add_ipv6_fixed_hdr_len: 1,
  6568. add_tcp_fixed_hdr_len: 1,
  6569. add_udp_hdr_len: 1,
  6570. chksum_cum_ip_len_en: 1,
  6571. disable_tid_check: 1,
  6572. disable_ta_check: 1,
  6573. disable_qos_check: 1,
  6574. disable_raw_check: 1,
  6575. disable_decrypt_err_check: 1,
  6576. disable_msdu_drop_check: 1,
  6577. fisa_aggr_limit: 4,
  6578. reserved: 14;
  6579. } fisa_control_bits;
  6580. struct {
  6581. A_UINT32 fisa_enable: 1,
  6582. fisa_aggr_limit: 4,
  6583. reserved: 27;
  6584. } fisa_control_bits_v2;
  6585. A_UINT32 fisa_control_value;
  6586. } u_fisa_control;
  6587. /**
  6588. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6589. * timeout threshold for aggregation. Unit in usec.
  6590. * [31:0]
  6591. */
  6592. A_UINT32 fisa_timeout_threshold;
  6593. } POSTPACK;
  6594. /* DWord 0: pdev-ID */
  6595. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6596. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6597. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6598. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6599. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6600. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6603. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6604. } while (0)
  6605. /* Dword 1: fisa_control_value fisa config */
  6606. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6607. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6608. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6609. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6610. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6611. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6614. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6615. } while (0)
  6616. /* Dword 1: fisa_control_value ipsec_skip_search */
  6617. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6618. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6619. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6620. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6621. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6622. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6623. do { \
  6624. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6625. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6626. } while (0)
  6627. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6628. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6629. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6630. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6631. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6632. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6633. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6634. do { \
  6635. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6636. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6637. } while (0)
  6638. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6639. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6640. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6641. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6642. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6643. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6644. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6645. do { \
  6646. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6647. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6648. } while (0)
  6649. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6650. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6651. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6652. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6653. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6654. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6655. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6656. do { \
  6657. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6658. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6659. } while (0)
  6660. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6661. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6662. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6663. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6664. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6665. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6666. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6667. do { \
  6668. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6669. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6670. } while (0)
  6671. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6672. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6673. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6674. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6675. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6676. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6677. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6678. do { \
  6679. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6680. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6681. } while (0)
  6682. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6683. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6684. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6685. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6686. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6687. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6688. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6689. do { \
  6690. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6691. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6692. } while (0)
  6693. /* Dword 1: fisa_control_value disable_tid_check */
  6694. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6695. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6696. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6697. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6698. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6699. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6700. do { \
  6701. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6702. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6703. } while (0)
  6704. /* Dword 1: fisa_control_value disable_ta_check */
  6705. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6706. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6707. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6708. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6709. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6710. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6713. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6714. } while (0)
  6715. /* Dword 1: fisa_control_value disable_qos_check */
  6716. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6717. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6718. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6719. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6720. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6721. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6722. do { \
  6723. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6724. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6725. } while (0)
  6726. /* Dword 1: fisa_control_value disable_raw_check */
  6727. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6728. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6729. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6730. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6731. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6732. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6733. do { \
  6734. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6735. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6736. } while (0)
  6737. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6738. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6739. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6740. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6741. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6742. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6743. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6744. do { \
  6745. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6746. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6747. } while (0)
  6748. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6749. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6750. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6751. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6752. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6753. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6754. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6755. do { \
  6756. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6757. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6758. } while (0)
  6759. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6760. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6761. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6762. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6763. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6764. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6765. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6766. do { \
  6767. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6768. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6769. } while (0)
  6770. /* Dword 1: fisa_control_value fisa config */
  6771. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6772. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6773. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6774. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6775. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6776. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6777. do { \
  6778. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6779. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6780. } while (0)
  6781. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6782. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6783. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6784. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6785. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6786. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6787. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6788. do { \
  6789. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6790. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6791. } while (0)
  6792. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6793. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6794. pdev_id:8,
  6795. reserved0:16;
  6796. A_UINT32 num_records:20,
  6797. max_search:8,
  6798. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6799. reserved1:2;
  6800. A_UINT32 base_addr_lo;
  6801. A_UINT32 base_addr_hi;
  6802. A_UINT32 toeplitz31_0;
  6803. A_UINT32 toeplitz63_32;
  6804. A_UINT32 toeplitz95_64;
  6805. A_UINT32 toeplitz127_96;
  6806. A_UINT32 toeplitz159_128;
  6807. A_UINT32 toeplitz191_160;
  6808. A_UINT32 toeplitz223_192;
  6809. A_UINT32 toeplitz255_224;
  6810. A_UINT32 toeplitz287_256;
  6811. A_UINT32 toeplitz314_288:27,
  6812. reserved2:5;
  6813. } POSTPACK;
  6814. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6815. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6816. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6817. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6818. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6819. /* DWORD 0: Pdev ID */
  6820. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6821. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6822. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6823. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6824. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6825. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6828. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6829. } while (0)
  6830. /* DWORD 1:num of records */
  6831. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6832. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6833. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6834. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6835. HTT_RX_FSE_SETUP_NUM_REC_S)
  6836. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6837. do { \
  6838. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6839. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6840. } while (0)
  6841. /* DWORD 1:max_search */
  6842. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6843. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6844. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6845. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6846. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6847. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6848. do { \
  6849. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6850. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6851. } while (0)
  6852. /* DWORD 1:ip_da_sa prefix */
  6853. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6854. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6855. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6856. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6857. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6858. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6859. do { \
  6860. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6861. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6862. } while (0)
  6863. /* DWORD 2: Base Address LO */
  6864. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6865. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6866. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6867. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6868. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6869. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6870. do { \
  6871. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6872. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6873. } while (0)
  6874. /* DWORD 3: Base Address High */
  6875. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6876. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6877. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6878. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6879. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6880. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6881. do { \
  6882. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6883. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6884. } while (0)
  6885. /* DWORD 4-12: Hash Value */
  6886. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6887. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6888. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6889. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6890. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6891. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6892. do { \
  6893. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6894. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6895. } while (0)
  6896. /* DWORD 13: Hash Value 314:288 bits */
  6897. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6898. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6899. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6900. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6901. do { \
  6902. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6903. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6904. } while (0)
  6905. /**
  6906. * @brief Host-->target HTT RX FSE operation message
  6907. *
  6908. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6909. *
  6910. * @details
  6911. * The host will send this Flow Search Engine (FSE) operation message for
  6912. * every flow add/delete operation.
  6913. * The FSE operation includes FSE full cache invalidation or individual entry
  6914. * invalidation.
  6915. * This message can be sent per SOC or per PDEV which is differentiated
  6916. * by pdev id values.
  6917. *
  6918. * |31 16|15 8|7 1|0|
  6919. * |-------------------------------------------------------------|
  6920. * | reserved | pdev_id | MSG_TYPE |
  6921. * |-------------------------------------------------------------|
  6922. * | reserved | operation |I|
  6923. * |-------------------------------------------------------------|
  6924. * | ip_src_addr_31_0 |
  6925. * |-------------------------------------------------------------|
  6926. * | ip_src_addr_63_32 |
  6927. * |-------------------------------------------------------------|
  6928. * | ip_src_addr_95_64 |
  6929. * |-------------------------------------------------------------|
  6930. * | ip_src_addr_127_96 |
  6931. * |-------------------------------------------------------------|
  6932. * | ip_dst_addr_31_0 |
  6933. * |-------------------------------------------------------------|
  6934. * | ip_dst_addr_63_32 |
  6935. * |-------------------------------------------------------------|
  6936. * | ip_dst_addr_95_64 |
  6937. * |-------------------------------------------------------------|
  6938. * | ip_dst_addr_127_96 |
  6939. * |-------------------------------------------------------------|
  6940. * | l4_dst_port | l4_src_port |
  6941. * | (32-bit SPI incase of IPsec) |
  6942. * |-------------------------------------------------------------|
  6943. * | reserved | l4_proto |
  6944. * |-------------------------------------------------------------|
  6945. *
  6946. * where I is 1-bit ipsec_valid.
  6947. *
  6948. * The following field definitions describe the format of the RX FSE operation
  6949. * message sent from the host to target for every add/delete flow entry to flow
  6950. * table.
  6951. *
  6952. * Header fields:
  6953. * dword0 - b'7:0 - msg_type: This will be set to
  6954. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6955. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6956. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6957. * specified pdev's LMAC ring.
  6958. * b'31:16 - reserved : Reserved for future use
  6959. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6960. * (Internet Protocol Security).
  6961. * IPsec describes the framework for providing security at
  6962. * IP layer. IPsec is defined for both versions of IP:
  6963. * IPV4 and IPV6.
  6964. * Please refer to htt_rx_flow_proto enumeration below for
  6965. * more info.
  6966. * ipsec_valid = 1 for IPSEC packets
  6967. * ipsec_valid = 0 for IP Packets
  6968. * b'7:1 - operation: This indicates types of FSE operation.
  6969. * Refer to htt_rx_fse_operation enumeration:
  6970. * 0 - No Cache Invalidation required
  6971. * 1 - Cache invalidate only one entry given by IP
  6972. * src/dest address at DWORD[2:9]
  6973. * 2 - Complete FSE Cache Invalidation
  6974. * 3 - FSE Disable
  6975. * 4 - FSE Enable
  6976. * b'31:8 - reserved: Reserved for future use
  6977. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6978. * for per flow addition/deletion
  6979. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6980. * and the subsequent 3 A_UINT32 will be padding bytes.
  6981. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6982. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6983. * from 0 to 65535 but only 0 to 1023 are designated as
  6984. * well-known ports. Refer to [RFC1700] for more details.
  6985. * This field is valid only if
  6986. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6987. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6988. * range from 0 to 65535 but only 0 to 1023 are designated
  6989. * as well-known ports. Refer to [RFC1700] for more details.
  6990. * This field is valid only if
  6991. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6992. * - SPI (31:0): Security Parameters Index is an
  6993. * identification tag added to the header while using IPsec
  6994. * for tunneling the IP traffici.
  6995. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6996. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6997. * Assigned Internet Protocol Numbers.
  6998. * l4_proto numbers for standard protocol like UDP/TCP
  6999. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7000. * l4_proto = 17 for UDP etc.
  7001. * b'31:8 - reserved: Reserved for future use.
  7002. *
  7003. */
  7004. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7005. A_UINT32 msg_type:8,
  7006. pdev_id:8,
  7007. reserved0:16;
  7008. A_UINT32 ipsec_valid:1,
  7009. operation:7,
  7010. reserved1:24;
  7011. A_UINT32 ip_src_addr_31_0;
  7012. A_UINT32 ip_src_addr_63_32;
  7013. A_UINT32 ip_src_addr_95_64;
  7014. A_UINT32 ip_src_addr_127_96;
  7015. A_UINT32 ip_dest_addr_31_0;
  7016. A_UINT32 ip_dest_addr_63_32;
  7017. A_UINT32 ip_dest_addr_95_64;
  7018. A_UINT32 ip_dest_addr_127_96;
  7019. union {
  7020. A_UINT32 spi;
  7021. struct {
  7022. A_UINT32 l4_src_port:16,
  7023. l4_dest_port:16;
  7024. } ip;
  7025. } u;
  7026. A_UINT32 l4_proto:8,
  7027. reserved:24;
  7028. } POSTPACK;
  7029. /**
  7030. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7031. *
  7032. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7033. *
  7034. * @details
  7035. * The host will send this Full monitor mode register configuration message.
  7036. * This message can be sent per SOC or per PDEV which is differentiated
  7037. * by pdev id values.
  7038. *
  7039. * |31 16|15 11|10 8|7 3|2|1|0|
  7040. * |-------------------------------------------------------------|
  7041. * | reserved | pdev_id | MSG_TYPE |
  7042. * |-------------------------------------------------------------|
  7043. * | reserved |Release Ring |N|Z|E|
  7044. * |-------------------------------------------------------------|
  7045. *
  7046. * where E is 1-bit full monitor mode enable/disable.
  7047. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7048. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7049. *
  7050. * The following field definitions describe the format of the full monitor
  7051. * mode configuration message sent from the host to target for each pdev.
  7052. *
  7053. * Header fields:
  7054. * dword0 - b'7:0 - msg_type: This will be set to
  7055. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7056. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7057. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7058. * specified pdev's LMAC ring.
  7059. * b'31:16 - reserved : Reserved for future use.
  7060. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7061. * monitor mode rxdma register is to be enabled or disabled.
  7062. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7063. * additional descriptors at ppdu end for zero mpdus
  7064. * enabled or disabled.
  7065. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7066. * additional descriptors at ppdu end for non zero mpdus
  7067. * enabled or disabled.
  7068. * b'10:3 - release_ring: This indicates the destination ring
  7069. * selection for the descriptor at the end of PPDU
  7070. * 0 - REO ring select
  7071. * 1 - FW ring select
  7072. * 2 - SW ring select
  7073. * 3 - Release ring select
  7074. * Refer to htt_rx_full_mon_release_ring.
  7075. * b'31:11 - reserved for future use
  7076. */
  7077. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7078. A_UINT32 msg_type:8,
  7079. pdev_id:8,
  7080. reserved0:16;
  7081. A_UINT32 full_monitor_mode_enable:1,
  7082. addnl_descs_zero_mpdus_end:1,
  7083. addnl_descs_non_zero_mpdus_end:1,
  7084. release_ring:8,
  7085. reserved1:21;
  7086. } POSTPACK;
  7087. /**
  7088. * Enumeration for full monitor mode destination ring select
  7089. * 0 - REO destination ring select
  7090. * 1 - FW destination ring select
  7091. * 2 - SW destination ring select
  7092. * 3 - Release destination ring select
  7093. */
  7094. enum htt_rx_full_mon_release_ring {
  7095. HTT_RX_MON_RING_REO,
  7096. HTT_RX_MON_RING_FW,
  7097. HTT_RX_MON_RING_SW,
  7098. HTT_RX_MON_RING_RELEASE,
  7099. };
  7100. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7101. /* DWORD 0: Pdev ID */
  7102. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7103. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7104. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7105. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7106. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7107. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7108. do { \
  7109. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7110. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7111. } while (0)
  7112. /* DWORD 1:ENABLE */
  7113. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7114. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7115. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7116. do { \
  7117. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7118. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7119. } while (0)
  7120. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7121. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7122. /* DWORD 1:ZERO_MPDU */
  7123. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7124. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7125. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7126. do { \
  7127. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7128. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7129. } while (0)
  7130. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7131. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7132. /* DWORD 1:NON_ZERO_MPDU */
  7133. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7134. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7135. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7136. do { \
  7137. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7138. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7139. } while (0)
  7140. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7141. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7142. /* DWORD 1:RELEASE_RINGS */
  7143. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7144. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7145. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7146. do { \
  7147. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7148. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7149. } while (0)
  7150. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7151. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7152. /**
  7153. * Enumeration for IP Protocol or IPSEC Protocol
  7154. * IPsec describes the framework for providing security at IP layer.
  7155. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7156. */
  7157. enum htt_rx_flow_proto {
  7158. HTT_RX_FLOW_IP_PROTO,
  7159. HTT_RX_FLOW_IPSEC_PROTO,
  7160. };
  7161. /**
  7162. * Enumeration for FSE Cache Invalidation
  7163. * 0 - No Cache Invalidation required
  7164. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7165. * 2 - Complete FSE Cache Invalidation
  7166. * 3 - FSE Disable
  7167. * 4 - FSE Enable
  7168. */
  7169. enum htt_rx_fse_operation {
  7170. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7171. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7172. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7173. HTT_RX_FSE_DISABLE,
  7174. HTT_RX_FSE_ENABLE,
  7175. };
  7176. /* DWORD 0: Pdev ID */
  7177. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7178. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7179. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7180. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7181. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7182. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7183. do { \
  7184. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7185. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7186. } while (0)
  7187. /* DWORD 1:IP PROTO or IPSEC */
  7188. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7189. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7190. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7191. do { \
  7192. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7193. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7194. } while (0)
  7195. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7196. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7197. /* DWORD 1:FSE Operation */
  7198. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7199. #define HTT_RX_FSE_OPERATION_S 1
  7200. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7201. do { \
  7202. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7203. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7204. } while (0)
  7205. #define HTT_RX_FSE_OPERATION_GET(word) \
  7206. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7207. /* DWORD 2-9:IP Address */
  7208. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7209. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7210. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7211. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7212. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7213. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7214. do { \
  7215. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7216. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7217. } while (0)
  7218. /* DWORD 10:Source Port Number */
  7219. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7220. #define HTT_RX_FSE_SOURCEPORT_S 0
  7221. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7222. do { \
  7223. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7224. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7225. } while (0)
  7226. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7227. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7228. /* DWORD 11:Destination Port Number */
  7229. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7230. #define HTT_RX_FSE_DESTPORT_S 16
  7231. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7232. do { \
  7233. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7234. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7235. } while (0)
  7236. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7237. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7238. /* DWORD 10-11:SPI (In case of IPSEC) */
  7239. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7240. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7241. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7242. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7243. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7244. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7245. do { \
  7246. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7247. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7248. } while (0)
  7249. /* DWORD 12:L4 PROTO */
  7250. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7251. #define HTT_RX_FSE_L4_PROTO_S 0
  7252. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7253. do { \
  7254. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7255. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7256. } while (0)
  7257. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7258. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7259. /**
  7260. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7261. *
  7262. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7263. *
  7264. * |31 24|23 |15 8|7 2|1|0|
  7265. * |----------------+----------------+----------------+----------------|
  7266. * | reserved | pdev_id | msg_type |
  7267. * |---------------------------------+----------------+----------------|
  7268. * | reserved |E|F|
  7269. * |---------------------------------+----------------+----------------|
  7270. * Where E = Configure the target to provide the 3-tuple hash value in
  7271. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7272. * F = Configure the target to provide the 3-tuple hash value in
  7273. * flow_id_toeplitz field of rx_msdu_start tlv
  7274. *
  7275. * The following field definitions describe the format of the 3 tuple hash value
  7276. * message sent from the host to target as part of initialization sequence.
  7277. *
  7278. * Header fields:
  7279. * dword0 - b'7:0 - msg_type: This will be set to
  7280. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7281. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7282. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7283. * specified pdev's LMAC ring.
  7284. * b'31:16 - reserved : Reserved for future use
  7285. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7286. * b'1 - toeplitz_hash_2_or_4_field_enable
  7287. * b'31:2 - reserved : Reserved for future use
  7288. * ---------+------+----------------------------------------------------------
  7289. * bit1 | bit0 | Functionality
  7290. * ---------+------+----------------------------------------------------------
  7291. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7292. * | | in flow_id_toeplitz field
  7293. * ---------+------+----------------------------------------------------------
  7294. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7295. * | | in toeplitz_hash_2_or_4 field
  7296. * ---------+------+----------------------------------------------------------
  7297. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7298. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7299. * ---------+------+----------------------------------------------------------
  7300. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7301. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7302. * | | toeplitz_hash_2_or_4 field
  7303. *----------------------------------------------------------------------------
  7304. */
  7305. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7306. A_UINT32 msg_type :8,
  7307. pdev_id :8,
  7308. reserved0 :16;
  7309. A_UINT32 flow_id_toeplitz_field_enable :1,
  7310. toeplitz_hash_2_or_4_field_enable :1,
  7311. reserved1 :30;
  7312. } POSTPACK;
  7313. /* DWORD0 : pdev_id configuration Macros */
  7314. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7315. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7316. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7317. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7318. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7319. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7320. do { \
  7321. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7322. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7323. } while (0)
  7324. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7325. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7326. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7327. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7328. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7329. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7330. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7331. do { \
  7332. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7333. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7334. } while (0)
  7335. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7336. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7337. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7338. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7339. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7340. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7343. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7344. } while (0)
  7345. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7346. /**
  7347. * @brief host --> target Host PA Address Size
  7348. *
  7349. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7350. *
  7351. * @details
  7352. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7353. * provide the physical start address and size of each of the memory
  7354. * areas within host DDR that the target FW may need to access.
  7355. *
  7356. * For example, the host can use this message to allow the target FW
  7357. * to set up access to the host's pools of TQM link descriptors.
  7358. * The message would appear as follows:
  7359. *
  7360. * |31 24|23 16|15 8|7 0|
  7361. * |----------------+----------------+----------------+----------------|
  7362. * | reserved | num_entries | msg_type |
  7363. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7364. * | mem area 0 size |
  7365. * |----------------+----------------+----------------+----------------|
  7366. * | mem area 0 physical_address_lo |
  7367. * |----------------+----------------+----------------+----------------|
  7368. * | mem area 0 physical_address_hi |
  7369. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7370. * | mem area 1 size |
  7371. * |----------------+----------------+----------------+----------------|
  7372. * | mem area 1 physical_address_lo |
  7373. * |----------------+----------------+----------------+----------------|
  7374. * | mem area 1 physical_address_hi |
  7375. * |----------------+----------------+----------------+----------------|
  7376. * ...
  7377. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7378. * | mem area N size |
  7379. * |----------------+----------------+----------------+----------------|
  7380. * | mem area N physical_address_lo |
  7381. * |----------------+----------------+----------------+----------------|
  7382. * | mem area N physical_address_hi |
  7383. * |----------------+----------------+----------------+----------------|
  7384. *
  7385. * The message is interpreted as follows:
  7386. * dword0 - b'0:7 - msg_type: This will be set to
  7387. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7388. * b'8:15 - number_entries: Indicated the number of host memory
  7389. * areas specified within the remainder of the message
  7390. * b'16:31 - reserved.
  7391. * dword1 - b'0:31 - memory area 0 size in bytes
  7392. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7393. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7394. * and similar for memory area 1 through memory area N.
  7395. */
  7396. PREPACK struct htt_h2t_host_paddr_size {
  7397. A_UINT32 msg_type: 8,
  7398. num_entries: 8,
  7399. reserved: 16;
  7400. } POSTPACK;
  7401. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7402. A_UINT32 size;
  7403. A_UINT32 physical_address_lo;
  7404. A_UINT32 physical_address_hi;
  7405. } POSTPACK;
  7406. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7407. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7408. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7409. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7410. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7411. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7412. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7413. do { \
  7414. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7415. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7416. } while (0)
  7417. /**
  7418. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7419. *
  7420. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7421. *
  7422. * @details
  7423. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7424. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7425. *
  7426. * The message would appear as follows:
  7427. *
  7428. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7429. * |---------------------------------+---+---+----------+-+-----------|
  7430. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7431. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7432. *
  7433. *
  7434. * The message is interpreted as follows:
  7435. * dword0 - b'0:7 - msg_type: This will be set to
  7436. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7437. * b'8 - override bit to drive MSDUs to PPE ring
  7438. * b'9:13 - REO destination ring indication
  7439. * b'14 - Multi buffer msdu override enable bit
  7440. * b'15 - Intra BSS override
  7441. * b'16 - Decap raw override
  7442. * b'17 - Decap Native wifi override
  7443. * b'18 - IP frag override
  7444. * b'19:31 - reserved
  7445. */
  7446. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7447. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7448. override: 1,
  7449. reo_destination_indication: 5,
  7450. multi_buffer_msdu_override_en: 1,
  7451. intra_bss_override: 1,
  7452. decap_raw_override: 1,
  7453. decap_nwifi_override: 1,
  7454. ip_frag_override: 1,
  7455. reserved: 13;
  7456. } POSTPACK;
  7457. /* DWORD 0: Override */
  7458. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7459. #define HTT_PPE_CFG_OVERRIDE_S 8
  7460. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7461. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7462. HTT_PPE_CFG_OVERRIDE_S)
  7463. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7464. do { \
  7465. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7466. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7467. } while (0)
  7468. /* DWORD 0: REO Destination Indication*/
  7469. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7470. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7471. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7472. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7473. HTT_PPE_CFG_REO_DEST_IND_S)
  7474. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7475. do { \
  7476. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7477. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7478. } while (0)
  7479. /* DWORD 0: Multi buffer MSDU override */
  7480. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7481. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7482. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7483. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7484. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7485. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7486. do { \
  7487. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7488. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7489. } while (0)
  7490. /* DWORD 0: Intra BSS override */
  7491. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7492. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7493. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7494. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7495. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7496. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7497. do { \
  7498. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7499. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7500. } while (0)
  7501. /* DWORD 0: Decap RAW override */
  7502. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7503. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7504. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7505. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7506. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7507. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7508. do { \
  7509. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7510. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7511. } while (0)
  7512. /* DWORD 0: Decap NWIFI override */
  7513. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7514. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7515. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7516. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7517. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7518. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7519. do { \
  7520. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7521. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7522. } while (0)
  7523. /* DWORD 0: IP frag override */
  7524. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7525. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7526. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7527. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7528. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7529. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7530. do { \
  7531. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7532. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7533. } while (0)
  7534. /*
  7535. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7536. *
  7537. * @details
  7538. * The following field definitions describe the format of the HTT host
  7539. * to target FW VDEV TX RX stats retrieve message.
  7540. * The message specifies the type of stats the host wants to retrieve.
  7541. *
  7542. * |31 27|26 25|24 17|16|15 8|7 0|
  7543. * |-----------------------------------------------------------|
  7544. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7545. * |-----------------------------------------------------------|
  7546. * | vdev_id lower bitmask |
  7547. * |-----------------------------------------------------------|
  7548. * | vdev_id upper bitmask |
  7549. * |-----------------------------------------------------------|
  7550. * Header fields:
  7551. * Where:
  7552. * dword0 - b'7:0 - msg_type: This will be set to
  7553. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7554. * b'15:8 - pdev id
  7555. * b'16(E) - Enable/Disable the vdev HW stats
  7556. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7557. * b'25:26(R) - Reset stats bits
  7558. * 0: don't reset stats
  7559. * 1: reset stats once
  7560. * 2: reset stats at the start of each periodic interval
  7561. * b'27:31 - reserved for future use
  7562. * dword1 - b'0:31 - vdev_id lower bitmask
  7563. * dword2 - b'0:31 - vdev_id upper bitmask
  7564. */
  7565. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7566. A_UINT32 msg_type :8,
  7567. pdev_id :8,
  7568. enable :1,
  7569. periodic_interval :8,
  7570. reset_stats_bits :2,
  7571. reserved0 :5;
  7572. A_UINT32 vdev_id_lower_bitmask;
  7573. A_UINT32 vdev_id_upper_bitmask;
  7574. } POSTPACK;
  7575. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7576. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7577. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7578. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7579. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7580. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7581. do { \
  7582. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7583. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7584. } while (0)
  7585. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7586. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7587. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7588. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7589. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7590. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7591. do { \
  7592. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7593. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7594. } while (0)
  7595. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7596. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7597. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7598. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7599. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7600. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7601. do { \
  7602. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7603. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7604. } while (0)
  7605. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7606. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7607. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7608. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7609. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7610. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7611. do { \
  7612. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7613. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7614. } while (0)
  7615. /*=== target -> host messages ===============================================*/
  7616. enum htt_t2h_msg_type {
  7617. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7618. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7619. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7620. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7621. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7622. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7623. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7624. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7625. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7626. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7627. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7628. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7629. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7630. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7631. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7632. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7633. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7634. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7635. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7636. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7637. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7638. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7639. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7640. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7641. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7642. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7643. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7644. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7645. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7646. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7647. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7648. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7649. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7650. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7651. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7652. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7653. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7654. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7655. /* TX_OFFLOAD_DELIVER_IND:
  7656. * Forward the target's locally-generated packets to the host,
  7657. * to provide to the monitor mode interface.
  7658. */
  7659. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7660. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7661. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7662. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7663. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7664. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7665. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7666. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7667. HTT_T2H_MSG_TYPE_TEST,
  7668. /* keep this last */
  7669. HTT_T2H_NUM_MSGS
  7670. };
  7671. /*
  7672. * HTT target to host message type -
  7673. * stored in bits 7:0 of the first word of the message
  7674. */
  7675. #define HTT_T2H_MSG_TYPE_M 0xff
  7676. #define HTT_T2H_MSG_TYPE_S 0
  7677. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7680. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7681. } while (0)
  7682. #define HTT_T2H_MSG_TYPE_GET(word) \
  7683. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7684. /**
  7685. * @brief target -> host version number confirmation message definition
  7686. *
  7687. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7688. *
  7689. * |31 24|23 16|15 8|7 0|
  7690. * |----------------+----------------+----------------+----------------|
  7691. * | reserved | major number | minor number | msg type |
  7692. * |-------------------------------------------------------------------|
  7693. * : option request TLV (optional) |
  7694. * :...................................................................:
  7695. *
  7696. * The VER_CONF message may consist of a single 4-byte word, or may be
  7697. * extended with TLVs that specify HTT options selected by the target.
  7698. * The following option TLVs may be appended to the VER_CONF message:
  7699. * - LL_BUS_ADDR_SIZE
  7700. * - HL_SUPPRESS_TX_COMPL_IND
  7701. * - MAX_TX_QUEUE_GROUPS
  7702. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7703. * may be appended to the VER_CONF message (but only one TLV of each type).
  7704. *
  7705. * Header fields:
  7706. * - MSG_TYPE
  7707. * Bits 7:0
  7708. * Purpose: identifies this as a version number confirmation message
  7709. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7710. * - VER_MINOR
  7711. * Bits 15:8
  7712. * Purpose: Specify the minor number of the HTT message library version
  7713. * in use by the target firmware.
  7714. * The minor number specifies the specific revision within a range
  7715. * of fundamentally compatible HTT message definition revisions.
  7716. * Compatible revisions involve adding new messages or perhaps
  7717. * adding new fields to existing messages, in a backwards-compatible
  7718. * manner.
  7719. * Incompatible revisions involve changing the message type values,
  7720. * or redefining existing messages.
  7721. * Value: minor number
  7722. * - VER_MAJOR
  7723. * Bits 15:8
  7724. * Purpose: Specify the major number of the HTT message library version
  7725. * in use by the target firmware.
  7726. * The major number specifies the family of minor revisions that are
  7727. * fundamentally compatible with each other, but not with prior or
  7728. * later families.
  7729. * Value: major number
  7730. */
  7731. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7732. #define HTT_VER_CONF_MINOR_S 8
  7733. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7734. #define HTT_VER_CONF_MAJOR_S 16
  7735. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7736. do { \
  7737. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7738. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7739. } while (0)
  7740. #define HTT_VER_CONF_MINOR_GET(word) \
  7741. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7742. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7745. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7746. } while (0)
  7747. #define HTT_VER_CONF_MAJOR_GET(word) \
  7748. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7749. #define HTT_VER_CONF_BYTES 4
  7750. /**
  7751. * @brief - target -> host HTT Rx In order indication message
  7752. *
  7753. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7754. *
  7755. * @details
  7756. *
  7757. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7758. * |----------------+-------------------+---------------------+---------------|
  7759. * | peer ID | P| F| O| ext TID | msg type |
  7760. * |--------------------------------------------------------------------------|
  7761. * | MSDU count | Reserved | vdev id |
  7762. * |--------------------------------------------------------------------------|
  7763. * | MSDU 0 bus address (bits 31:0) |
  7764. #if HTT_PADDR64
  7765. * | MSDU 0 bus address (bits 63:32) |
  7766. #endif
  7767. * |--------------------------------------------------------------------------|
  7768. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7769. * |--------------------------------------------------------------------------|
  7770. * | MSDU 1 bus address (bits 31:0) |
  7771. #if HTT_PADDR64
  7772. * | MSDU 1 bus address (bits 63:32) |
  7773. #endif
  7774. * |--------------------------------------------------------------------------|
  7775. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7776. * |--------------------------------------------------------------------------|
  7777. */
  7778. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7779. *
  7780. * @details
  7781. * bits
  7782. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7783. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7784. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7785. * | | frag | | | | fail |chksum fail|
  7786. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7787. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7788. */
  7789. struct htt_rx_in_ord_paddr_ind_hdr_t
  7790. {
  7791. A_UINT32 /* word 0 */
  7792. msg_type: 8,
  7793. ext_tid: 5,
  7794. offload: 1,
  7795. frag: 1,
  7796. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7797. peer_id: 16;
  7798. A_UINT32 /* word 1 */
  7799. vap_id: 8,
  7800. /* NOTE:
  7801. * This reserved_1 field is not truly reserved - certain targets use
  7802. * this field internally to store debug information, and do not zero
  7803. * out the contents of the field before uploading the message to the
  7804. * host. Thus, any host-target communication supported by this field
  7805. * is limited to using values that are never used by the debug
  7806. * information stored by certain targets in the reserved_1 field.
  7807. * In particular, the targets in question don't use the value 0x3
  7808. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7809. * so this previously-unused value within these bits is available to
  7810. * use as the host / target PKT_CAPTURE_MODE flag.
  7811. */
  7812. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7813. /* if pkt_capture_mode == 0x3, host should
  7814. * send rx frames to monitor mode interface
  7815. */
  7816. msdu_cnt: 16;
  7817. };
  7818. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7819. {
  7820. A_UINT32 dma_addr;
  7821. A_UINT32
  7822. length: 16,
  7823. fw_desc: 8,
  7824. msdu_info:8;
  7825. };
  7826. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7827. {
  7828. A_UINT32 dma_addr_lo;
  7829. A_UINT32 dma_addr_hi;
  7830. A_UINT32
  7831. length: 16,
  7832. fw_desc: 8,
  7833. msdu_info:8;
  7834. };
  7835. #if HTT_PADDR64
  7836. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7837. #else
  7838. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7839. #endif
  7840. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7841. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7842. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7843. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7844. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7845. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7846. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7847. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7848. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7849. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7850. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7851. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7852. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7853. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7854. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7855. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7856. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7857. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7858. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7859. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7860. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7861. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7862. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7863. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7864. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7865. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7866. /* for systems using 64-bit format for bus addresses */
  7867. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7868. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7869. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7870. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7871. /* for systems using 32-bit format for bus addresses */
  7872. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7873. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7874. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7875. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7876. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7877. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7878. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7879. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7880. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7881. do { \
  7882. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7883. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7884. } while (0)
  7885. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7886. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7887. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7888. do { \
  7889. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7890. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7891. } while (0)
  7892. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7893. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7894. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7895. do { \
  7896. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7897. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7898. } while (0)
  7899. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7900. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7901. /*
  7902. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7903. * deliver the rx frames to the monitor mode interface.
  7904. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7905. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7906. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7907. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7908. */
  7909. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7910. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7911. do { \
  7912. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7913. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7914. } while (0)
  7915. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7916. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7917. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7918. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7921. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7922. } while (0)
  7923. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7924. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7925. /* for systems using 64-bit format for bus addresses */
  7926. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7927. do { \
  7928. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7929. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7930. } while (0)
  7931. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7932. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7933. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7934. do { \
  7935. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7936. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7937. } while (0)
  7938. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7939. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7940. /* for systems using 32-bit format for bus addresses */
  7941. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7942. do { \
  7943. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7944. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7945. } while (0)
  7946. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7947. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7948. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7949. do { \
  7950. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7951. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7952. } while (0)
  7953. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7954. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7955. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7956. do { \
  7957. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7958. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7959. } while (0)
  7960. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7961. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7962. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7963. do { \
  7964. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7965. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7966. } while (0)
  7967. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7968. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7969. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7970. do { \
  7971. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7972. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7973. } while (0)
  7974. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7975. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7976. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7977. do { \
  7978. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7979. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7980. } while (0)
  7981. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7982. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7983. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7984. do { \
  7985. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7986. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7987. } while (0)
  7988. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7989. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7990. /* definitions used within target -> host rx indication message */
  7991. PREPACK struct htt_rx_ind_hdr_prefix_t
  7992. {
  7993. A_UINT32 /* word 0 */
  7994. msg_type: 8,
  7995. ext_tid: 5,
  7996. release_valid: 1,
  7997. flush_valid: 1,
  7998. reserved0: 1,
  7999. peer_id: 16;
  8000. A_UINT32 /* word 1 */
  8001. flush_start_seq_num: 6,
  8002. flush_end_seq_num: 6,
  8003. release_start_seq_num: 6,
  8004. release_end_seq_num: 6,
  8005. num_mpdu_ranges: 8;
  8006. } POSTPACK;
  8007. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8008. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8009. #define HTT_TGT_RSSI_INVALID 0x80
  8010. PREPACK struct htt_rx_ppdu_desc_t
  8011. {
  8012. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8013. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8014. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8015. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8016. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8017. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8018. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8019. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8020. A_UINT32 /* word 0 */
  8021. rssi_cmb: 8,
  8022. timestamp_submicrosec: 8,
  8023. phy_err_code: 8,
  8024. phy_err: 1,
  8025. legacy_rate: 4,
  8026. legacy_rate_sel: 1,
  8027. end_valid: 1,
  8028. start_valid: 1;
  8029. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8030. union {
  8031. A_UINT32 /* word 1 */
  8032. rssi0_pri20: 8,
  8033. rssi0_ext20: 8,
  8034. rssi0_ext40: 8,
  8035. rssi0_ext80: 8;
  8036. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8037. } u0;
  8038. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8039. union {
  8040. A_UINT32 /* word 2 */
  8041. rssi1_pri20: 8,
  8042. rssi1_ext20: 8,
  8043. rssi1_ext40: 8,
  8044. rssi1_ext80: 8;
  8045. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8046. } u1;
  8047. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8048. union {
  8049. A_UINT32 /* word 3 */
  8050. rssi2_pri20: 8,
  8051. rssi2_ext20: 8,
  8052. rssi2_ext40: 8,
  8053. rssi2_ext80: 8;
  8054. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8055. } u2;
  8056. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8057. union {
  8058. A_UINT32 /* word 4 */
  8059. rssi3_pri20: 8,
  8060. rssi3_ext20: 8,
  8061. rssi3_ext40: 8,
  8062. rssi3_ext80: 8;
  8063. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8064. } u3;
  8065. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8066. A_UINT32 tsf32; /* word 5 */
  8067. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8068. A_UINT32 timestamp_microsec; /* word 6 */
  8069. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8070. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8071. A_UINT32 /* word 7 */
  8072. vht_sig_a1: 24,
  8073. preamble_type: 8;
  8074. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8075. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8076. A_UINT32 /* word 8 */
  8077. vht_sig_a2: 24,
  8078. /* sa_ant_matrix
  8079. * For cases where a single rx chain has options to be connected to
  8080. * different rx antennas, show which rx antennas were in use during
  8081. * receipt of a given PPDU.
  8082. * This sa_ant_matrix provides a bitmask of the antennas used while
  8083. * receiving this frame.
  8084. */
  8085. sa_ant_matrix: 8;
  8086. } POSTPACK;
  8087. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8088. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8089. PREPACK struct htt_rx_ind_hdr_suffix_t
  8090. {
  8091. A_UINT32 /* word 0 */
  8092. fw_rx_desc_bytes: 16,
  8093. reserved0: 16;
  8094. } POSTPACK;
  8095. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8096. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8097. PREPACK struct htt_rx_ind_hdr_t
  8098. {
  8099. struct htt_rx_ind_hdr_prefix_t prefix;
  8100. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8101. struct htt_rx_ind_hdr_suffix_t suffix;
  8102. } POSTPACK;
  8103. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8104. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8105. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8106. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8107. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8108. /*
  8109. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8110. * the offset into the HTT rx indication message at which the
  8111. * FW rx PPDU descriptor resides
  8112. */
  8113. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8114. /*
  8115. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8116. * the offset into the HTT rx indication message at which the
  8117. * header suffix (FW rx MSDU byte count) resides
  8118. */
  8119. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8120. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8121. /*
  8122. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8123. * the offset into the HTT rx indication message at which the per-MSDU
  8124. * information starts
  8125. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8126. * per-MSDU information portion of the message. The per-MSDU info itself
  8127. * starts at byte 12.
  8128. */
  8129. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8130. /**
  8131. * @brief target -> host rx indication message definition
  8132. *
  8133. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8134. *
  8135. * @details
  8136. * The following field definitions describe the format of the rx indication
  8137. * message sent from the target to the host.
  8138. * The message consists of three major sections:
  8139. * 1. a fixed-length header
  8140. * 2. a variable-length list of firmware rx MSDU descriptors
  8141. * 3. one or more 4-octet MPDU range information elements
  8142. * The fixed length header itself has two sub-sections
  8143. * 1. the message meta-information, including identification of the
  8144. * sender and type of the received data, and a 4-octet flush/release IE
  8145. * 2. the firmware rx PPDU descriptor
  8146. *
  8147. * The format of the message is depicted below.
  8148. * in this depiction, the following abbreviations are used for information
  8149. * elements within the message:
  8150. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8151. * elements associated with the PPDU start are valid.
  8152. * Specifically, the following fields are valid only if SV is set:
  8153. * RSSI (all variants), L, legacy rate, preamble type, service,
  8154. * VHT-SIG-A
  8155. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8156. * elements associated with the PPDU end are valid.
  8157. * Specifically, the following fields are valid only if EV is set:
  8158. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8159. * - L - Legacy rate selector - if legacy rates are used, this flag
  8160. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8161. * (L == 0) PHY.
  8162. * - P - PHY error flag - boolean indication of whether the rx frame had
  8163. * a PHY error
  8164. *
  8165. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8166. * |----------------+-------------------+---------------------+---------------|
  8167. * | peer ID | |RV|FV| ext TID | msg type |
  8168. * |--------------------------------------------------------------------------|
  8169. * | num | release | release | flush | flush |
  8170. * | MPDU | end | start | end | start |
  8171. * | ranges | seq num | seq num | seq num | seq num |
  8172. * |==========================================================================|
  8173. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8174. * |V|V| | rate | | | timestamp | RSSI |
  8175. * |--------------------------------------------------------------------------|
  8176. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8177. * |--------------------------------------------------------------------------|
  8178. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8179. * |--------------------------------------------------------------------------|
  8180. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8181. * |--------------------------------------------------------------------------|
  8182. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8183. * |--------------------------------------------------------------------------|
  8184. * | TSF LSBs |
  8185. * |--------------------------------------------------------------------------|
  8186. * | microsec timestamp |
  8187. * |--------------------------------------------------------------------------|
  8188. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8189. * |--------------------------------------------------------------------------|
  8190. * | service | HT-SIG / VHT-SIG-A2 |
  8191. * |==========================================================================|
  8192. * | reserved | FW rx desc bytes |
  8193. * |--------------------------------------------------------------------------|
  8194. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8195. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8196. * |--------------------------------------------------------------------------|
  8197. * : : :
  8198. * |--------------------------------------------------------------------------|
  8199. * | alignment | MSDU Rx |
  8200. * | padding | desc Bn |
  8201. * |--------------------------------------------------------------------------|
  8202. * | reserved | MPDU range status | MPDU count |
  8203. * |--------------------------------------------------------------------------|
  8204. * : reserved : MPDU range status : MPDU count :
  8205. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8206. *
  8207. * Header fields:
  8208. * - MSG_TYPE
  8209. * Bits 7:0
  8210. * Purpose: identifies this as an rx indication message
  8211. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8212. * - EXT_TID
  8213. * Bits 12:8
  8214. * Purpose: identify the traffic ID of the rx data, including
  8215. * special "extended" TID values for multicast, broadcast, and
  8216. * non-QoS data frames
  8217. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8218. * - FLUSH_VALID (FV)
  8219. * Bit 13
  8220. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8221. * is valid
  8222. * Value:
  8223. * 1 -> flush IE is valid and needs to be processed
  8224. * 0 -> flush IE is not valid and should be ignored
  8225. * - REL_VALID (RV)
  8226. * Bit 13
  8227. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8228. * is valid
  8229. * Value:
  8230. * 1 -> release IE is valid and needs to be processed
  8231. * 0 -> release IE is not valid and should be ignored
  8232. * - PEER_ID
  8233. * Bits 31:16
  8234. * Purpose: Identify, by ID, which peer sent the rx data
  8235. * Value: ID of the peer who sent the rx data
  8236. * - FLUSH_SEQ_NUM_START
  8237. * Bits 5:0
  8238. * Purpose: Indicate the start of a series of MPDUs to flush
  8239. * Not all MPDUs within this series are necessarily valid - the host
  8240. * must check each sequence number within this range to see if the
  8241. * corresponding MPDU is actually present.
  8242. * This field is only valid if the FV bit is set.
  8243. * Value:
  8244. * The sequence number for the first MPDUs to check to flush.
  8245. * The sequence number is masked by 0x3f.
  8246. * - FLUSH_SEQ_NUM_END
  8247. * Bits 11:6
  8248. * Purpose: Indicate the end of a series of MPDUs to flush
  8249. * Value:
  8250. * The sequence number one larger than the sequence number of the
  8251. * last MPDU to check to flush.
  8252. * The sequence number is masked by 0x3f.
  8253. * Not all MPDUs within this series are necessarily valid - the host
  8254. * must check each sequence number within this range to see if the
  8255. * corresponding MPDU is actually present.
  8256. * This field is only valid if the FV bit is set.
  8257. * - REL_SEQ_NUM_START
  8258. * Bits 17:12
  8259. * Purpose: Indicate the start of a series of MPDUs to release.
  8260. * All MPDUs within this series are present and valid - the host
  8261. * need not check each sequence number within this range to see if
  8262. * the corresponding MPDU is actually present.
  8263. * This field is only valid if the RV bit is set.
  8264. * Value:
  8265. * The sequence number for the first MPDUs to check to release.
  8266. * The sequence number is masked by 0x3f.
  8267. * - REL_SEQ_NUM_END
  8268. * Bits 23:18
  8269. * Purpose: Indicate the end of a series of MPDUs to release.
  8270. * Value:
  8271. * The sequence number one larger than the sequence number of the
  8272. * last MPDU to check to release.
  8273. * The sequence number is masked by 0x3f.
  8274. * All MPDUs within this series are present and valid - the host
  8275. * need not check each sequence number within this range to see if
  8276. * the corresponding MPDU is actually present.
  8277. * This field is only valid if the RV bit is set.
  8278. * - NUM_MPDU_RANGES
  8279. * Bits 31:24
  8280. * Purpose: Indicate how many ranges of MPDUs are present.
  8281. * Each MPDU range consists of a series of contiguous MPDUs within the
  8282. * rx frame sequence which all have the same MPDU status.
  8283. * Value: 1-63 (typically a small number, like 1-3)
  8284. *
  8285. * Rx PPDU descriptor fields:
  8286. * - RSSI_CMB
  8287. * Bits 7:0
  8288. * Purpose: Combined RSSI from all active rx chains, across the active
  8289. * bandwidth.
  8290. * Value: RSSI dB units w.r.t. noise floor
  8291. * - TIMESTAMP_SUBMICROSEC
  8292. * Bits 15:8
  8293. * Purpose: high-resolution timestamp
  8294. * Value:
  8295. * Sub-microsecond time of PPDU reception.
  8296. * This timestamp ranges from [0,MAC clock MHz).
  8297. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8298. * to form a high-resolution, large range rx timestamp.
  8299. * - PHY_ERR_CODE
  8300. * Bits 23:16
  8301. * Purpose:
  8302. * If the rx frame processing resulted in a PHY error, indicate what
  8303. * type of rx PHY error occurred.
  8304. * Value:
  8305. * This field is valid if the "P" (PHY_ERR) flag is set.
  8306. * TBD: document/specify the values for this field
  8307. * - PHY_ERR
  8308. * Bit 24
  8309. * Purpose: indicate whether the rx PPDU had a PHY error
  8310. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8311. * - LEGACY_RATE
  8312. * Bits 28:25
  8313. * Purpose:
  8314. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8315. * specify which rate was used.
  8316. * Value:
  8317. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8318. * flag.
  8319. * If LEGACY_RATE_SEL is 0:
  8320. * 0x8: OFDM 48 Mbps
  8321. * 0x9: OFDM 24 Mbps
  8322. * 0xA: OFDM 12 Mbps
  8323. * 0xB: OFDM 6 Mbps
  8324. * 0xC: OFDM 54 Mbps
  8325. * 0xD: OFDM 36 Mbps
  8326. * 0xE: OFDM 18 Mbps
  8327. * 0xF: OFDM 9 Mbps
  8328. * If LEGACY_RATE_SEL is 1:
  8329. * 0x8: CCK 11 Mbps long preamble
  8330. * 0x9: CCK 5.5 Mbps long preamble
  8331. * 0xA: CCK 2 Mbps long preamble
  8332. * 0xB: CCK 1 Mbps long preamble
  8333. * 0xC: CCK 11 Mbps short preamble
  8334. * 0xD: CCK 5.5 Mbps short preamble
  8335. * 0xE: CCK 2 Mbps short preamble
  8336. * - LEGACY_RATE_SEL
  8337. * Bit 29
  8338. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8339. * Value:
  8340. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8341. * used a legacy rate.
  8342. * 0 -> OFDM, 1 -> CCK
  8343. * - END_VALID
  8344. * Bit 30
  8345. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8346. * the start of the PPDU are valid. Specifically, the following
  8347. * fields are only valid if END_VALID is set:
  8348. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8349. * TIMESTAMP_SUBMICROSEC
  8350. * Value:
  8351. * 0 -> rx PPDU desc end fields are not valid
  8352. * 1 -> rx PPDU desc end fields are valid
  8353. * - START_VALID
  8354. * Bit 31
  8355. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8356. * the end of the PPDU are valid. Specifically, the following
  8357. * fields are only valid if START_VALID is set:
  8358. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8359. * VHT-SIG-A
  8360. * Value:
  8361. * 0 -> rx PPDU desc start fields are not valid
  8362. * 1 -> rx PPDU desc start fields are valid
  8363. * - RSSI0_PRI20
  8364. * Bits 7:0
  8365. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8366. * Value: RSSI dB units w.r.t. noise floor
  8367. *
  8368. * - RSSI0_EXT20
  8369. * Bits 7:0
  8370. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8371. * (if the rx bandwidth was >= 40 MHz)
  8372. * Value: RSSI dB units w.r.t. noise floor
  8373. * - RSSI0_EXT40
  8374. * Bits 7:0
  8375. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8376. * (if the rx bandwidth was >= 80 MHz)
  8377. * Value: RSSI dB units w.r.t. noise floor
  8378. * - RSSI0_EXT80
  8379. * Bits 7:0
  8380. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8381. * (if the rx bandwidth was >= 160 MHz)
  8382. * Value: RSSI dB units w.r.t. noise floor
  8383. *
  8384. * - RSSI1_PRI20
  8385. * Bits 7:0
  8386. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8387. * Value: RSSI dB units w.r.t. noise floor
  8388. * - RSSI1_EXT20
  8389. * Bits 7:0
  8390. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8391. * (if the rx bandwidth was >= 40 MHz)
  8392. * Value: RSSI dB units w.r.t. noise floor
  8393. * - RSSI1_EXT40
  8394. * Bits 7:0
  8395. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8396. * (if the rx bandwidth was >= 80 MHz)
  8397. * Value: RSSI dB units w.r.t. noise floor
  8398. * - RSSI1_EXT80
  8399. * Bits 7:0
  8400. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8401. * (if the rx bandwidth was >= 160 MHz)
  8402. * Value: RSSI dB units w.r.t. noise floor
  8403. *
  8404. * - RSSI2_PRI20
  8405. * Bits 7:0
  8406. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8407. * Value: RSSI dB units w.r.t. noise floor
  8408. * - RSSI2_EXT20
  8409. * Bits 7:0
  8410. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8411. * (if the rx bandwidth was >= 40 MHz)
  8412. * Value: RSSI dB units w.r.t. noise floor
  8413. * - RSSI2_EXT40
  8414. * Bits 7:0
  8415. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8416. * (if the rx bandwidth was >= 80 MHz)
  8417. * Value: RSSI dB units w.r.t. noise floor
  8418. * - RSSI2_EXT80
  8419. * Bits 7:0
  8420. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8421. * (if the rx bandwidth was >= 160 MHz)
  8422. * Value: RSSI dB units w.r.t. noise floor
  8423. *
  8424. * - RSSI3_PRI20
  8425. * Bits 7:0
  8426. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8427. * Value: RSSI dB units w.r.t. noise floor
  8428. * - RSSI3_EXT20
  8429. * Bits 7:0
  8430. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8431. * (if the rx bandwidth was >= 40 MHz)
  8432. * Value: RSSI dB units w.r.t. noise floor
  8433. * - RSSI3_EXT40
  8434. * Bits 7:0
  8435. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8436. * (if the rx bandwidth was >= 80 MHz)
  8437. * Value: RSSI dB units w.r.t. noise floor
  8438. * - RSSI3_EXT80
  8439. * Bits 7:0
  8440. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8441. * (if the rx bandwidth was >= 160 MHz)
  8442. * Value: RSSI dB units w.r.t. noise floor
  8443. *
  8444. * - TSF32
  8445. * Bits 31:0
  8446. * Purpose: specify the time the rx PPDU was received, in TSF units
  8447. * Value: 32 LSBs of the TSF
  8448. * - TIMESTAMP_MICROSEC
  8449. * Bits 31:0
  8450. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8451. * Value: PPDU rx time, in microseconds
  8452. * - VHT_SIG_A1
  8453. * Bits 23:0
  8454. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8455. * from the rx PPDU
  8456. * Value:
  8457. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8458. * VHT-SIG-A1 data.
  8459. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8460. * first 24 bits of the HT-SIG data.
  8461. * Otherwise, this field is invalid.
  8462. * Refer to the the 802.11 protocol for the definition of the
  8463. * HT-SIG and VHT-SIG-A1 fields
  8464. * - VHT_SIG_A2
  8465. * Bits 23:0
  8466. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8467. * from the rx PPDU
  8468. * Value:
  8469. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8470. * VHT-SIG-A2 data.
  8471. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8472. * last 24 bits of the HT-SIG data.
  8473. * Otherwise, this field is invalid.
  8474. * Refer to the the 802.11 protocol for the definition of the
  8475. * HT-SIG and VHT-SIG-A2 fields
  8476. * - PREAMBLE_TYPE
  8477. * Bits 31:24
  8478. * Purpose: indicate the PHY format of the received burst
  8479. * Value:
  8480. * 0x4: Legacy (OFDM/CCK)
  8481. * 0x8: HT
  8482. * 0x9: HT with TxBF
  8483. * 0xC: VHT
  8484. * 0xD: VHT with TxBF
  8485. * - SERVICE
  8486. * Bits 31:24
  8487. * Purpose: TBD
  8488. * Value: TBD
  8489. *
  8490. * Rx MSDU descriptor fields:
  8491. * - FW_RX_DESC_BYTES
  8492. * Bits 15:0
  8493. * Purpose: Indicate how many bytes in the Rx indication are used for
  8494. * FW Rx descriptors
  8495. *
  8496. * Payload fields:
  8497. * - MPDU_COUNT
  8498. * Bits 7:0
  8499. * Purpose: Indicate how many sequential MPDUs share the same status.
  8500. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8501. * - MPDU_STATUS
  8502. * Bits 15:8
  8503. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8504. * received successfully.
  8505. * Value:
  8506. * 0x1: success
  8507. * 0x2: FCS error
  8508. * 0x3: duplicate error
  8509. * 0x4: replay error
  8510. * 0x5: invalid peer
  8511. */
  8512. /* header fields */
  8513. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8514. #define HTT_RX_IND_EXT_TID_S 8
  8515. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8516. #define HTT_RX_IND_FLUSH_VALID_S 13
  8517. #define HTT_RX_IND_REL_VALID_M 0x4000
  8518. #define HTT_RX_IND_REL_VALID_S 14
  8519. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8520. #define HTT_RX_IND_PEER_ID_S 16
  8521. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8522. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8523. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8524. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8525. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8526. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8527. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8528. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8529. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8530. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8531. /* rx PPDU descriptor fields */
  8532. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8533. #define HTT_RX_IND_RSSI_CMB_S 0
  8534. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8535. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8536. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8537. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8538. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8539. #define HTT_RX_IND_PHY_ERR_S 24
  8540. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8541. #define HTT_RX_IND_LEGACY_RATE_S 25
  8542. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8543. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8544. #define HTT_RX_IND_END_VALID_M 0x40000000
  8545. #define HTT_RX_IND_END_VALID_S 30
  8546. #define HTT_RX_IND_START_VALID_M 0x80000000
  8547. #define HTT_RX_IND_START_VALID_S 31
  8548. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8549. #define HTT_RX_IND_RSSI_PRI20_S 0
  8550. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8551. #define HTT_RX_IND_RSSI_EXT20_S 8
  8552. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8553. #define HTT_RX_IND_RSSI_EXT40_S 16
  8554. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8555. #define HTT_RX_IND_RSSI_EXT80_S 24
  8556. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8557. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8558. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8559. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8560. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8561. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8562. #define HTT_RX_IND_SERVICE_M 0xff000000
  8563. #define HTT_RX_IND_SERVICE_S 24
  8564. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8565. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8566. /* rx MSDU descriptor fields */
  8567. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8568. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8569. /* payload fields */
  8570. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8571. #define HTT_RX_IND_MPDU_COUNT_S 0
  8572. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8573. #define HTT_RX_IND_MPDU_STATUS_S 8
  8574. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8575. do { \
  8576. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8577. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8578. } while (0)
  8579. #define HTT_RX_IND_EXT_TID_GET(word) \
  8580. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8581. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8582. do { \
  8583. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8584. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8585. } while (0)
  8586. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8587. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8588. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8589. do { \
  8590. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8591. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8592. } while (0)
  8593. #define HTT_RX_IND_REL_VALID_GET(word) \
  8594. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8595. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8596. do { \
  8597. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8598. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8599. } while (0)
  8600. #define HTT_RX_IND_PEER_ID_GET(word) \
  8601. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8602. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8603. do { \
  8604. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8605. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8606. } while (0)
  8607. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8608. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8609. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8610. do { \
  8611. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8612. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8613. } while (0)
  8614. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8615. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8616. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8617. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8618. do { \
  8619. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8620. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8621. } while (0)
  8622. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8623. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8624. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8625. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8626. do { \
  8627. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8628. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8629. } while (0)
  8630. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8631. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8632. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8633. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8634. do { \
  8635. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8636. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8637. } while (0)
  8638. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8639. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8640. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8641. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8642. do { \
  8643. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8644. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8645. } while (0)
  8646. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8647. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8648. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8649. /* FW rx PPDU descriptor fields */
  8650. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8651. do { \
  8652. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8653. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8654. } while (0)
  8655. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8656. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8657. HTT_RX_IND_RSSI_CMB_S)
  8658. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8659. do { \
  8660. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8661. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8662. } while (0)
  8663. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8664. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8665. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8666. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8667. do { \
  8668. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8669. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8670. } while (0)
  8671. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8672. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8673. HTT_RX_IND_PHY_ERR_CODE_S)
  8674. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8675. do { \
  8676. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8677. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8678. } while (0)
  8679. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8680. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8681. HTT_RX_IND_PHY_ERR_S)
  8682. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8683. do { \
  8684. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8685. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8686. } while (0)
  8687. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8688. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8689. HTT_RX_IND_LEGACY_RATE_S)
  8690. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8691. do { \
  8692. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8693. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8694. } while (0)
  8695. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8696. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8697. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8698. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8699. do { \
  8700. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8701. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8702. } while (0)
  8703. #define HTT_RX_IND_END_VALID_GET(word) \
  8704. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8705. HTT_RX_IND_END_VALID_S)
  8706. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8707. do { \
  8708. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8709. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8710. } while (0)
  8711. #define HTT_RX_IND_START_VALID_GET(word) \
  8712. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8713. HTT_RX_IND_START_VALID_S)
  8714. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8715. do { \
  8716. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8717. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8718. } while (0)
  8719. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8720. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8721. HTT_RX_IND_RSSI_PRI20_S)
  8722. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8723. do { \
  8724. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8725. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8726. } while (0)
  8727. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8728. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8729. HTT_RX_IND_RSSI_EXT20_S)
  8730. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8731. do { \
  8732. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8733. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8734. } while (0)
  8735. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8736. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8737. HTT_RX_IND_RSSI_EXT40_S)
  8738. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8739. do { \
  8740. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8741. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8742. } while (0)
  8743. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8744. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8745. HTT_RX_IND_RSSI_EXT80_S)
  8746. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8747. do { \
  8748. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8749. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8750. } while (0)
  8751. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8752. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8753. HTT_RX_IND_VHT_SIG_A1_S)
  8754. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8755. do { \
  8756. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8757. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8758. } while (0)
  8759. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8760. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8761. HTT_RX_IND_VHT_SIG_A2_S)
  8762. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8763. do { \
  8764. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8765. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8766. } while (0)
  8767. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8768. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8769. HTT_RX_IND_PREAMBLE_TYPE_S)
  8770. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8771. do { \
  8772. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8773. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8774. } while (0)
  8775. #define HTT_RX_IND_SERVICE_GET(word) \
  8776. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8777. HTT_RX_IND_SERVICE_S)
  8778. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8779. do { \
  8780. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8781. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8782. } while (0)
  8783. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8784. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8785. HTT_RX_IND_SA_ANT_MATRIX_S)
  8786. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8787. do { \
  8788. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8789. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8790. } while (0)
  8791. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8792. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8793. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8794. do { \
  8795. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8796. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8797. } while (0)
  8798. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8799. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8800. #define HTT_RX_IND_HL_BYTES \
  8801. (HTT_RX_IND_HDR_BYTES + \
  8802. 4 /* single FW rx MSDU descriptor */ + \
  8803. 4 /* single MPDU range information element */)
  8804. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8805. /* Could we use one macro entry? */
  8806. #define HTT_WORD_SET(word, field, value) \
  8807. do { \
  8808. HTT_CHECK_SET_VAL(field, value); \
  8809. (word) |= ((value) << field ## _S); \
  8810. } while (0)
  8811. #define HTT_WORD_GET(word, field) \
  8812. (((word) & field ## _M) >> field ## _S)
  8813. PREPACK struct hl_htt_rx_ind_base {
  8814. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8815. } POSTPACK;
  8816. /*
  8817. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8818. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8819. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8820. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8821. * htt_rx_ind_hl_rx_desc_t.
  8822. */
  8823. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8824. struct htt_rx_ind_hl_rx_desc_t {
  8825. A_UINT8 ver;
  8826. A_UINT8 len;
  8827. struct {
  8828. A_UINT8
  8829. first_msdu: 1,
  8830. last_msdu: 1,
  8831. c3_failed: 1,
  8832. c4_failed: 1,
  8833. ipv6: 1,
  8834. tcp: 1,
  8835. udp: 1,
  8836. reserved: 1;
  8837. } flags;
  8838. /* NOTE: no reserved space - don't append any new fields here */
  8839. };
  8840. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8841. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8842. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8843. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8844. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8845. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8846. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8847. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8848. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8849. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8850. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8851. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8852. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8853. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8854. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8855. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8856. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8857. /* This structure is used in HL, the basic descriptor information
  8858. * used by host. the structure is translated by FW from HW desc
  8859. * or generated by FW. But in HL monitor mode, the host would use
  8860. * the same structure with LL.
  8861. */
  8862. PREPACK struct hl_htt_rx_desc_base {
  8863. A_UINT32
  8864. seq_num:12,
  8865. encrypted:1,
  8866. chan_info_present:1,
  8867. resv0:2,
  8868. mcast_bcast:1,
  8869. fragment:1,
  8870. key_id_oct:8,
  8871. resv1:6;
  8872. A_UINT32
  8873. pn_31_0;
  8874. union {
  8875. struct {
  8876. A_UINT16 pn_47_32;
  8877. A_UINT16 pn_63_48;
  8878. } pn16;
  8879. A_UINT32 pn_63_32;
  8880. } u0;
  8881. A_UINT32
  8882. pn_95_64;
  8883. A_UINT32
  8884. pn_127_96;
  8885. } POSTPACK;
  8886. /*
  8887. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8888. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8889. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8890. * Please see htt_chan_change_t for description of the fields.
  8891. */
  8892. PREPACK struct htt_chan_info_t
  8893. {
  8894. A_UINT32 primary_chan_center_freq_mhz: 16,
  8895. contig_chan1_center_freq_mhz: 16;
  8896. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8897. phy_mode: 8,
  8898. reserved: 8;
  8899. } POSTPACK;
  8900. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8901. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8902. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8903. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8904. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8905. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8906. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8907. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8908. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8909. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8910. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8911. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8912. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8913. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8914. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8915. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8916. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8917. /* Channel information */
  8918. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8919. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8920. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8921. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8922. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8923. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8924. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8925. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8926. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8927. do { \
  8928. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8929. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8930. } while (0)
  8931. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8932. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8933. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8934. do { \
  8935. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8936. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8937. } while (0)
  8938. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8939. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8940. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8941. do { \
  8942. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8943. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8944. } while (0)
  8945. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8946. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8947. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8948. do { \
  8949. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8950. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8951. } while (0)
  8952. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8953. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8954. /*
  8955. * @brief target -> host message definition for FW offloaded pkts
  8956. *
  8957. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8958. *
  8959. * @details
  8960. * The following field definitions describe the format of the firmware
  8961. * offload deliver message sent from the target to the host.
  8962. *
  8963. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8964. *
  8965. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8966. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8967. * | reserved_1 | msg type |
  8968. * |--------------------------------------------------------------------------|
  8969. * | phy_timestamp_l32 |
  8970. * |--------------------------------------------------------------------------|
  8971. * | WORD2 (see below) |
  8972. * |--------------------------------------------------------------------------|
  8973. * | seqno | framectrl |
  8974. * |--------------------------------------------------------------------------|
  8975. * | reserved_3 | vdev_id | tid_num|
  8976. * |--------------------------------------------------------------------------|
  8977. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8978. * |--------------------------------------------------------------------------|
  8979. *
  8980. * where:
  8981. * STAT = status
  8982. * F = format (802.3 vs. 802.11)
  8983. *
  8984. * definition for word 2
  8985. *
  8986. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8987. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8988. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8989. * |--------------------------------------------------------------------------|
  8990. *
  8991. * where:
  8992. * PR = preamble
  8993. * BF = beamformed
  8994. */
  8995. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8996. {
  8997. A_UINT32 /* word 0 */
  8998. msg_type:8, /* [ 7: 0] */
  8999. reserved_1:24; /* [31: 8] */
  9000. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9001. A_UINT32 /* word 2 */
  9002. /* preamble:
  9003. * 0-OFDM,
  9004. * 1-CCk,
  9005. * 2-HT,
  9006. * 3-VHT
  9007. */
  9008. preamble: 2, /* [1:0] */
  9009. /* mcs:
  9010. * In case of HT preamble interpret
  9011. * MCS along with NSS.
  9012. * Valid values for HT are 0 to 7.
  9013. * HT mcs 0 with NSS 2 is mcs 8.
  9014. * Valid values for VHT are 0 to 9.
  9015. */
  9016. mcs: 4, /* [5:2] */
  9017. /* rate:
  9018. * This is applicable only for
  9019. * CCK and OFDM preamble type
  9020. * rate 0: OFDM 48 Mbps,
  9021. * 1: OFDM 24 Mbps,
  9022. * 2: OFDM 12 Mbps
  9023. * 3: OFDM 6 Mbps
  9024. * 4: OFDM 54 Mbps
  9025. * 5: OFDM 36 Mbps
  9026. * 6: OFDM 18 Mbps
  9027. * 7: OFDM 9 Mbps
  9028. * rate 0: CCK 11 Mbps Long
  9029. * 1: CCK 5.5 Mbps Long
  9030. * 2: CCK 2 Mbps Long
  9031. * 3: CCK 1 Mbps Long
  9032. * 4: CCK 11 Mbps Short
  9033. * 5: CCK 5.5 Mbps Short
  9034. * 6: CCK 2 Mbps Short
  9035. */
  9036. rate : 3, /* [ 8: 6] */
  9037. rssi : 8, /* [16: 9] units=dBm */
  9038. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9039. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9040. stbc : 1, /* [22] */
  9041. sgi : 1, /* [23] */
  9042. ldpc : 1, /* [24] */
  9043. beamformed: 1, /* [25] */
  9044. reserved_2: 6; /* [31:26] */
  9045. A_UINT32 /* word 3 */
  9046. framectrl:16, /* [15: 0] */
  9047. seqno:16; /* [31:16] */
  9048. A_UINT32 /* word 4 */
  9049. tid_num:5, /* [ 4: 0] actual TID number */
  9050. vdev_id:8, /* [12: 5] */
  9051. reserved_3:19; /* [31:13] */
  9052. A_UINT32 /* word 5 */
  9053. /* status:
  9054. * 0: tx_ok
  9055. * 1: retry
  9056. * 2: drop
  9057. * 3: filtered
  9058. * 4: abort
  9059. * 5: tid delete
  9060. * 6: sw abort
  9061. * 7: dropped by peer migration
  9062. */
  9063. status:3, /* [2:0] */
  9064. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9065. tx_mpdu_bytes:16, /* [19:4] */
  9066. /* Indicates retry count of offloaded/local generated Data tx frames */
  9067. tx_retry_cnt:6, /* [25:20] */
  9068. reserved_4:6; /* [31:26] */
  9069. } POSTPACK;
  9070. /* FW offload deliver ind message header fields */
  9071. /* DWORD one */
  9072. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9073. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9074. /* DWORD two */
  9075. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9076. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9077. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9078. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9079. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9080. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9081. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9082. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9083. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9084. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9085. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9086. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9087. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9088. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9089. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9090. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9091. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9092. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9093. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9094. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9095. /* DWORD three*/
  9096. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9097. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9098. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9099. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9100. /* DWORD four */
  9101. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9102. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9103. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9104. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9105. /* DWORD five */
  9106. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9107. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9108. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9109. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9110. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9111. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9112. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9113. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9114. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9115. do { \
  9116. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9117. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9118. } while (0)
  9119. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9120. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9121. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9122. do { \
  9123. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9124. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9125. } while (0)
  9126. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9127. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9128. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9129. do { \
  9130. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9131. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9132. } while (0)
  9133. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9134. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9135. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9136. do { \
  9137. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9138. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9139. } while (0)
  9140. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9141. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9142. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9143. do { \
  9144. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9145. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9146. } while (0)
  9147. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9148. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9149. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9150. do { \
  9151. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9152. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9153. } while (0)
  9154. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9155. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9156. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9157. do { \
  9158. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9159. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9160. } while (0)
  9161. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9162. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9163. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9164. do { \
  9165. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9166. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9167. } while (0)
  9168. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9169. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9170. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9171. do { \
  9172. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9173. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9174. } while (0)
  9175. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9176. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9177. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9178. do { \
  9179. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9180. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9181. } while (0)
  9182. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9183. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9184. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9185. do { \
  9186. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9187. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9188. } while (0)
  9189. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9190. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9191. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9192. do { \
  9193. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9194. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9195. } while (0)
  9196. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9197. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9198. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9199. do { \
  9200. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9201. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9202. } while (0)
  9203. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9204. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9205. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9206. do { \
  9207. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9208. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9209. } while (0)
  9210. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9211. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9212. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9213. do { \
  9214. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9215. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9216. } while (0)
  9217. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9218. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9219. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9220. do { \
  9221. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9222. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9223. } while (0)
  9224. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9225. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9226. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9227. do { \
  9228. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9229. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9230. } while (0)
  9231. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9232. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9233. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9234. do { \
  9235. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9236. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9237. } while (0)
  9238. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9239. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9240. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9241. do { \
  9242. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9243. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9244. } while (0)
  9245. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9246. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9247. /*
  9248. * @brief target -> host rx reorder flush message definition
  9249. *
  9250. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9251. *
  9252. * @details
  9253. * The following field definitions describe the format of the rx flush
  9254. * message sent from the target to the host.
  9255. * The message consists of a 4-octet header, followed by one or more
  9256. * 4-octet payload information elements.
  9257. *
  9258. * |31 24|23 8|7 0|
  9259. * |--------------------------------------------------------------|
  9260. * | TID | peer ID | msg type |
  9261. * |--------------------------------------------------------------|
  9262. * | seq num end | seq num start | MPDU status | reserved |
  9263. * |--------------------------------------------------------------|
  9264. * First DWORD:
  9265. * - MSG_TYPE
  9266. * Bits 7:0
  9267. * Purpose: identifies this as an rx flush message
  9268. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9269. * - PEER_ID
  9270. * Bits 23:8 (only bits 18:8 actually used)
  9271. * Purpose: identify which peer's rx data is being flushed
  9272. * Value: (rx) peer ID
  9273. * - TID
  9274. * Bits 31:24 (only bits 27:24 actually used)
  9275. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9276. * Value: traffic identifier
  9277. * Second DWORD:
  9278. * - MPDU_STATUS
  9279. * Bits 15:8
  9280. * Purpose:
  9281. * Indicate whether the flushed MPDUs should be discarded or processed.
  9282. * Value:
  9283. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9284. * stages of rx processing
  9285. * other: discard the MPDUs
  9286. * It is anticipated that flush messages will always have
  9287. * MPDU status == 1, but the status flag is included for
  9288. * flexibility.
  9289. * - SEQ_NUM_START
  9290. * Bits 23:16
  9291. * Purpose:
  9292. * Indicate the start of a series of consecutive MPDUs being flushed.
  9293. * Not all MPDUs within this range are necessarily valid - the host
  9294. * must check each sequence number within this range to see if the
  9295. * corresponding MPDU is actually present.
  9296. * Value:
  9297. * The sequence number for the first MPDU in the sequence.
  9298. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9299. * - SEQ_NUM_END
  9300. * Bits 30:24
  9301. * Purpose:
  9302. * Indicate the end of a series of consecutive MPDUs being flushed.
  9303. * Value:
  9304. * The sequence number one larger than the sequence number of the
  9305. * last MPDU being flushed.
  9306. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9307. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9308. * are to be released for further rx processing.
  9309. * Not all MPDUs within this range are necessarily valid - the host
  9310. * must check each sequence number within this range to see if the
  9311. * corresponding MPDU is actually present.
  9312. */
  9313. /* first DWORD */
  9314. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9315. #define HTT_RX_FLUSH_PEER_ID_S 8
  9316. #define HTT_RX_FLUSH_TID_M 0xff000000
  9317. #define HTT_RX_FLUSH_TID_S 24
  9318. /* second DWORD */
  9319. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9320. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9321. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9322. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9323. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9324. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9325. #define HTT_RX_FLUSH_BYTES 8
  9326. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9327. do { \
  9328. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9329. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9330. } while (0)
  9331. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9332. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9333. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9334. do { \
  9335. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9336. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9337. } while (0)
  9338. #define HTT_RX_FLUSH_TID_GET(word) \
  9339. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9340. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9341. do { \
  9342. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9343. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9344. } while (0)
  9345. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9346. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9347. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9348. do { \
  9349. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9350. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9351. } while (0)
  9352. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9353. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9354. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9355. do { \
  9356. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9357. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9358. } while (0)
  9359. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9360. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9361. /*
  9362. * @brief target -> host rx pn check indication message
  9363. *
  9364. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9365. *
  9366. * @details
  9367. * The following field definitions describe the format of the Rx PN check
  9368. * indication message sent from the target to the host.
  9369. * The message consists of a 4-octet header, followed by the start and
  9370. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9371. * IE is one octet containing the sequence number that failed the PN
  9372. * check.
  9373. *
  9374. * |31 24|23 8|7 0|
  9375. * |--------------------------------------------------------------|
  9376. * | TID | peer ID | msg type |
  9377. * |--------------------------------------------------------------|
  9378. * | Reserved | PN IE count | seq num end | seq num start|
  9379. * |--------------------------------------------------------------|
  9380. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9381. * |--------------------------------------------------------------|
  9382. * First DWORD:
  9383. * - MSG_TYPE
  9384. * Bits 7:0
  9385. * Purpose: Identifies this as an rx pn check indication message
  9386. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9387. * - PEER_ID
  9388. * Bits 23:8 (only bits 18:8 actually used)
  9389. * Purpose: identify which peer
  9390. * Value: (rx) peer ID
  9391. * - TID
  9392. * Bits 31:24 (only bits 27:24 actually used)
  9393. * Purpose: identify traffic identifier
  9394. * Value: traffic identifier
  9395. * Second DWORD:
  9396. * - SEQ_NUM_START
  9397. * Bits 7:0
  9398. * Purpose:
  9399. * Indicates the starting sequence number of the MPDU in this
  9400. * series of MPDUs that went though PN check.
  9401. * Value:
  9402. * The sequence number for the first MPDU in the sequence.
  9403. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9404. * - SEQ_NUM_END
  9405. * Bits 15:8
  9406. * Purpose:
  9407. * Indicates the ending sequence number of the MPDU in this
  9408. * series of MPDUs that went though PN check.
  9409. * Value:
  9410. * The sequence number one larger then the sequence number of the last
  9411. * MPDU being flushed.
  9412. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9413. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9414. * for invalid PN numbers and are ready to be released for further processing.
  9415. * Not all MPDUs within this range are necessarily valid - the host
  9416. * must check each sequence number within this range to see if the
  9417. * corresponding MPDU is actually present.
  9418. * - PN_IE_COUNT
  9419. * Bits 23:16
  9420. * Purpose:
  9421. * Used to determine the variable number of PN information elements in this
  9422. * message
  9423. *
  9424. * PN information elements:
  9425. * - PN_IE_x-
  9426. * Purpose:
  9427. * Each PN information element contains the sequence number of the MPDU that
  9428. * has failed the target PN check.
  9429. * Value:
  9430. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9431. * that failed the PN check.
  9432. */
  9433. /* first DWORD */
  9434. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9435. #define HTT_RX_PN_IND_PEER_ID_S 8
  9436. #define HTT_RX_PN_IND_TID_M 0xff000000
  9437. #define HTT_RX_PN_IND_TID_S 24
  9438. /* second DWORD */
  9439. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9440. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9441. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9442. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9443. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9444. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9445. #define HTT_RX_PN_IND_BYTES 8
  9446. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9447. do { \
  9448. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9449. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9450. } while (0)
  9451. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9452. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9453. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9454. do { \
  9455. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9456. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9457. } while (0)
  9458. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9459. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9460. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9461. do { \
  9462. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9463. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9464. } while (0)
  9465. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9466. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9467. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9468. do { \
  9469. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9470. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9471. } while (0)
  9472. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9473. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9474. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9475. do { \
  9476. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9477. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9478. } while (0)
  9479. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9480. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9481. /*
  9482. * @brief target -> host rx offload deliver message for LL system
  9483. *
  9484. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9485. *
  9486. * @details
  9487. * In a low latency system this message is sent whenever the offload
  9488. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9489. * The DMA of the actual packets into host memory is done before sending out
  9490. * this message. This message indicates only how many MSDUs to reap. The
  9491. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9492. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9493. * DMA'd by the MAC directly into host memory these packets do not contain
  9494. * the MAC descriptors in the header portion of the packet. Instead they contain
  9495. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9496. * message, the packets are delivered directly to the NW stack without going
  9497. * through the regular reorder buffering and PN checking path since it has
  9498. * already been done in target.
  9499. *
  9500. * |31 24|23 16|15 8|7 0|
  9501. * |-----------------------------------------------------------------------|
  9502. * | Total MSDU count | reserved | msg type |
  9503. * |-----------------------------------------------------------------------|
  9504. *
  9505. * @brief target -> host rx offload deliver message for HL system
  9506. *
  9507. * @details
  9508. * In a high latency system this message is sent whenever the offload manager
  9509. * flushes out the packets it has coalesced in its coalescing buffer. The
  9510. * actual packets are also carried along with this message. When the host
  9511. * receives this message, it is expected to deliver these packets to the NW
  9512. * stack directly instead of routing them through the reorder buffering and
  9513. * PN checking path since it has already been done in target.
  9514. *
  9515. * |31 24|23 16|15 8|7 0|
  9516. * |-----------------------------------------------------------------------|
  9517. * | Total MSDU count | reserved | msg type |
  9518. * |-----------------------------------------------------------------------|
  9519. * | peer ID | MSDU length |
  9520. * |-----------------------------------------------------------------------|
  9521. * | MSDU payload | FW Desc | tid | vdev ID |
  9522. * |-----------------------------------------------------------------------|
  9523. * | MSDU payload contd. |
  9524. * |-----------------------------------------------------------------------|
  9525. * | peer ID | MSDU length |
  9526. * |-----------------------------------------------------------------------|
  9527. * | MSDU payload | FW Desc | tid | vdev ID |
  9528. * |-----------------------------------------------------------------------|
  9529. * | MSDU payload contd. |
  9530. * |-----------------------------------------------------------------------|
  9531. *
  9532. */
  9533. /* first DWORD */
  9534. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9535. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9537. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9538. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9539. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9541. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9542. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9543. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9544. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9545. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9546. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9547. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9548. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9549. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9550. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9551. do { \
  9552. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9553. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9554. } while (0)
  9555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9556. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9558. do { \
  9559. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9560. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9561. } while (0)
  9562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9563. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9565. do { \
  9566. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9567. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9568. } while (0)
  9569. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9570. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9571. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9572. do { \
  9573. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9574. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9575. } while (0)
  9576. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9577. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9578. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9579. do { \
  9580. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9581. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9582. } while (0)
  9583. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9584. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9585. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9586. do { \
  9587. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9588. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9589. } while (0)
  9590. /**
  9591. * @brief target -> host rx peer map/unmap message definition
  9592. *
  9593. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9594. *
  9595. * @details
  9596. * The following diagram shows the format of the rx peer map message sent
  9597. * from the target to the host. This layout assumes the target operates
  9598. * as little-endian.
  9599. *
  9600. * This message always contains a SW peer ID. The main purpose of the
  9601. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9602. * with, so that the host can use that peer ID to determine which peer
  9603. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9604. * other purposes, such as identifying during tx completions which peer
  9605. * the tx frames in question were transmitted to.
  9606. *
  9607. * In certain generations of chips, the peer map message also contains
  9608. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9609. * to identify which peer the frame needs to be forwarded to (i.e. the
  9610. * peer assocated with the Destination MAC Address within the packet),
  9611. * and particularly which vdev needs to transmit the frame (for cases
  9612. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9613. * meaning as AST_INDEX_0.
  9614. * This DA-based peer ID that is provided for certain rx frames
  9615. * (the rx frames that need to be re-transmitted as tx frames)
  9616. * is the ID that the HW uses for referring to the peer in question,
  9617. * rather than the peer ID that the SW+FW use to refer to the peer.
  9618. *
  9619. *
  9620. * |31 24|23 16|15 8|7 0|
  9621. * |-----------------------------------------------------------------------|
  9622. * | SW peer ID | VDEV ID | msg type |
  9623. * |-----------------------------------------------------------------------|
  9624. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9625. * |-----------------------------------------------------------------------|
  9626. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9627. * |-----------------------------------------------------------------------|
  9628. *
  9629. *
  9630. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9631. *
  9632. * The following diagram shows the format of the rx peer unmap message sent
  9633. * from the target to the host.
  9634. *
  9635. * |31 24|23 16|15 8|7 0|
  9636. * |-----------------------------------------------------------------------|
  9637. * | SW peer ID | VDEV ID | msg type |
  9638. * |-----------------------------------------------------------------------|
  9639. *
  9640. * The following field definitions describe the format of the rx peer map
  9641. * and peer unmap messages sent from the target to the host.
  9642. * - MSG_TYPE
  9643. * Bits 7:0
  9644. * Purpose: identifies this as an rx peer map or peer unmap message
  9645. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9646. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9647. * - VDEV_ID
  9648. * Bits 15:8
  9649. * Purpose: Indicates which virtual device the peer is associated
  9650. * with.
  9651. * Value: vdev ID (used in the host to look up the vdev object)
  9652. * - PEER_ID (a.k.a. SW_PEER_ID)
  9653. * Bits 31:16
  9654. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9655. * freeing (unmap)
  9656. * Value: (rx) peer ID
  9657. * - MAC_ADDR_L32 (peer map only)
  9658. * Bits 31:0
  9659. * Purpose: Identifies which peer node the peer ID is for.
  9660. * Value: lower 4 bytes of peer node's MAC address
  9661. * - MAC_ADDR_U16 (peer map only)
  9662. * Bits 15:0
  9663. * Purpose: Identifies which peer node the peer ID is for.
  9664. * Value: upper 2 bytes of peer node's MAC address
  9665. * - HW_PEER_ID
  9666. * Bits 31:16
  9667. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9668. * address, so for rx frames marked for rx --> tx forwarding, the
  9669. * host can determine from the HW peer ID provided as meta-data with
  9670. * the rx frame which peer the frame is supposed to be forwarded to.
  9671. * Value: ID used by the MAC HW to identify the peer
  9672. */
  9673. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9674. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9675. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9676. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9677. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9678. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9679. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9680. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9681. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9682. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9683. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9684. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9685. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9686. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9687. do { \
  9688. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9689. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9690. } while (0)
  9691. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9692. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9693. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9694. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9695. do { \
  9696. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9697. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9698. } while (0)
  9699. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9700. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9701. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9702. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9703. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9704. do { \
  9705. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9706. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9707. } while (0)
  9708. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9709. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9710. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9711. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9712. #define HTT_RX_PEER_MAP_BYTES 12
  9713. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9714. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9715. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9716. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9717. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9718. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9719. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9720. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9721. #define HTT_RX_PEER_UNMAP_BYTES 4
  9722. /**
  9723. * @brief target -> host rx peer map V2 message definition
  9724. *
  9725. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9726. *
  9727. * @details
  9728. * The following diagram shows the format of the rx peer map v2 message sent
  9729. * from the target to the host. This layout assumes the target operates
  9730. * as little-endian.
  9731. *
  9732. * This message always contains a SW peer ID. The main purpose of the
  9733. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9734. * with, so that the host can use that peer ID to determine which peer
  9735. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9736. * other purposes, such as identifying during tx completions which peer
  9737. * the tx frames in question were transmitted to.
  9738. *
  9739. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9740. * is used during rx --> tx frame forwarding to identify which peer the
  9741. * frame needs to be forwarded to (i.e. the peer assocated with the
  9742. * Destination MAC Address within the packet), and particularly which vdev
  9743. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9744. * This DA-based peer ID that is provided for certain rx frames
  9745. * (the rx frames that need to be re-transmitted as tx frames)
  9746. * is the ID that the HW uses for referring to the peer in question,
  9747. * rather than the peer ID that the SW+FW use to refer to the peer.
  9748. *
  9749. * The HW peer id here is the same meaning as AST_INDEX_0.
  9750. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9751. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9752. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9753. * AST is valid.
  9754. *
  9755. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9756. * |-------------------------------------------------------------------------|
  9757. * | SW peer ID | VDEV ID | msg type |
  9758. * |-------------------------------------------------------------------------|
  9759. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9760. * |-------------------------------------------------------------------------|
  9761. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9762. * |-------------------------------------------------------------------------|
  9763. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9764. * |-------------------------------------------------------------------------|
  9765. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9766. * |-------------------------------------------------------------------------|
  9767. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9768. * |-------------------------------------------------------------------------|
  9769. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9770. * |-------------------------------------------------------------------------|
  9771. * | Reserved_2 |
  9772. * |-------------------------------------------------------------------------|
  9773. * Where:
  9774. * NH = Next Hop
  9775. * ASTVM = AST valid mask
  9776. * OA = on-chip AST valid bit
  9777. * ASTFM = AST flow mask
  9778. *
  9779. * The following field definitions describe the format of the rx peer map v2
  9780. * messages sent from the target to the host.
  9781. * - MSG_TYPE
  9782. * Bits 7:0
  9783. * Purpose: identifies this as an rx peer map v2 message
  9784. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9785. * - VDEV_ID
  9786. * Bits 15:8
  9787. * Purpose: Indicates which virtual device the peer is associated with.
  9788. * Value: vdev ID (used in the host to look up the vdev object)
  9789. * - SW_PEER_ID
  9790. * Bits 31:16
  9791. * Purpose: The peer ID (index) that WAL is allocating
  9792. * Value: (rx) peer ID
  9793. * - MAC_ADDR_L32
  9794. * Bits 31:0
  9795. * Purpose: Identifies which peer node the peer ID is for.
  9796. * Value: lower 4 bytes of peer node's MAC address
  9797. * - MAC_ADDR_U16
  9798. * Bits 15:0
  9799. * Purpose: Identifies which peer node the peer ID is for.
  9800. * Value: upper 2 bytes of peer node's MAC address
  9801. * - HW_PEER_ID / AST_INDEX_0
  9802. * Bits 31:16
  9803. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9804. * address, so for rx frames marked for rx --> tx forwarding, the
  9805. * host can determine from the HW peer ID provided as meta-data with
  9806. * the rx frame which peer the frame is supposed to be forwarded to.
  9807. * Value: ID used by the MAC HW to identify the peer
  9808. * - AST_HASH_VALUE
  9809. * Bits 15:0
  9810. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9811. * override feature.
  9812. * - NEXT_HOP
  9813. * Bit 16
  9814. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9815. * (Wireless Distribution System).
  9816. * - AST_VALID_MASK
  9817. * Bits 19:17
  9818. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9819. * - ONCHIP_AST_VALID_FLAG
  9820. * Bit 20
  9821. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9822. * is valid.
  9823. * - AST_INDEX_1
  9824. * Bits 15:0
  9825. * Purpose: indicate the second AST index for this peer
  9826. * - AST_0_FLOW_MASK
  9827. * Bits 19:16
  9828. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9829. * - AST_1_FLOW_MASK
  9830. * Bits 23:20
  9831. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9832. * - AST_2_FLOW_MASK
  9833. * Bits 27:24
  9834. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9835. * - AST_3_FLOW_MASK
  9836. * Bits 31:28
  9837. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9838. * - AST_INDEX_2
  9839. * Bits 15:0
  9840. * Purpose: indicate the third AST index for this peer
  9841. * - TID_VALID_HI_PRI
  9842. * Bits 23:16
  9843. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9844. * - TID_VALID_LOW_PRI
  9845. * Bits 31:24
  9846. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9847. * - AST_INDEX_3
  9848. * Bits 15:0
  9849. * Purpose: indicate the fourth AST index for this peer
  9850. * - ONCHIP_AST_IDX / RESERVED
  9851. * Bits 31:16
  9852. * Purpose: This field is valid only when split AST feature is enabled.
  9853. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9854. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9855. * address, this ast_idx is used for LMAC modules for RXPCU.
  9856. * Value: ID used by the LMAC HW to identify the peer
  9857. */
  9858. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9859. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9860. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9861. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9862. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9863. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9864. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9865. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9866. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9867. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9868. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9869. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9870. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9871. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9872. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9873. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9874. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9875. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9876. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9877. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9878. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9879. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9880. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9881. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9882. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9883. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9884. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9885. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9886. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9887. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9888. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9889. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9890. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9891. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9892. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9893. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9894. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9895. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9896. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9897. do { \
  9898. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9899. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9900. } while (0)
  9901. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9902. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9903. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9904. do { \
  9905. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9906. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9907. } while (0)
  9908. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9909. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9910. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9911. do { \
  9912. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9913. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9914. } while (0)
  9915. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9916. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9917. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9918. do { \
  9919. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9920. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9921. } while (0)
  9922. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9923. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9924. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9925. do { \
  9926. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9927. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9928. } while (0)
  9929. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9930. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9931. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9932. do { \
  9933. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9934. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9935. } while (0)
  9936. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9937. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9938. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9939. do { \
  9940. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9941. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9942. } while (0)
  9943. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9944. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9945. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9946. do { \
  9947. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9948. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9949. } while (0)
  9950. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9951. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9952. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9953. do { \
  9954. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9955. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9956. } while (0)
  9957. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9958. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9959. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9960. do { \
  9961. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9962. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9963. } while (0)
  9964. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9965. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9966. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9967. do { \
  9968. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9969. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9970. } while (0)
  9971. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9972. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9973. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9974. do { \
  9975. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9976. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9977. } while (0)
  9978. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9979. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9980. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9981. do { \
  9982. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9983. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9984. } while (0)
  9985. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9986. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9987. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9988. do { \
  9989. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9990. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9991. } while (0)
  9992. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9993. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9994. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9995. do { \
  9996. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9997. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9998. } while (0)
  9999. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10000. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10001. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10002. do { \
  10003. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10004. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10005. } while (0)
  10006. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10007. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10008. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10011. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10012. } while (0)
  10013. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10014. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10015. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10016. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10019. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10020. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10021. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10023. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10024. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10025. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10026. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10027. /**
  10028. * @brief target -> host rx peer map V3 message definition
  10029. *
  10030. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10031. *
  10032. * @details
  10033. * The following diagram shows the format of the rx peer map v3 message sent
  10034. * from the target to the host.
  10035. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10036. * This layout assumes the target operates as little-endian.
  10037. *
  10038. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10039. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10040. * | SW peer ID | VDEV ID | msg type |
  10041. * |-----------------+--------------------+-----------------+-----------------|
  10042. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10043. * |-----------------+--------------------+-----------------+-----------------|
  10044. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10045. * |-----------------+--------+-----------+-----------------+-----------------|
  10046. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10047. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10048. * | (8bits) | | (4bits) | |
  10049. * |-----------------+--------+--+--+--+--------------------------------------|
  10050. * | RESERVED |E |O | | |
  10051. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10052. * | |V |V | | |
  10053. * |-----------------+--------------------+-----------------------------------|
  10054. * | HTT_MSDU_IDX_ | RESERVED | |
  10055. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10056. * | (8bits) | | |
  10057. * |-----------------+--------------------+-----------------------------------|
  10058. * | Reserved_2 |
  10059. * |--------------------------------------------------------------------------|
  10060. * | Reserved_3 |
  10061. * |--------------------------------------------------------------------------|
  10062. *
  10063. * Where:
  10064. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10065. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10066. * NH = Next Hop
  10067. * The following field definitions describe the format of the rx peer map v3
  10068. * messages sent from the target to the host.
  10069. * - MSG_TYPE
  10070. * Bits 7:0
  10071. * Purpose: identifies this as a peer map v3 message
  10072. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10073. * - VDEV_ID
  10074. * Bits 15:8
  10075. * Purpose: Indicates which virtual device the peer is associated with.
  10076. * - SW_PEER_ID
  10077. * Bits 31:16
  10078. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10079. * - MAC_ADDR_L32
  10080. * Bits 31:0
  10081. * Purpose: Identifies which peer node the peer ID is for.
  10082. * Value: lower 4 bytes of peer node's MAC address
  10083. * - MAC_ADDR_U16
  10084. * Bits 15:0
  10085. * Purpose: Identifies which peer node the peer ID is for.
  10086. * Value: upper 2 bytes of peer node's MAC address
  10087. * - MULTICAST_SW_PEER_ID
  10088. * Bits 31:16
  10089. * Purpose: The multicast peer ID (index)
  10090. * Value: set to HTT_INVALID_PEER if not valid
  10091. * - HW_PEER_ID / AST_INDEX
  10092. * Bits 15:0
  10093. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10094. * address, so for rx frames marked for rx --> tx forwarding, the
  10095. * host can determine from the HW peer ID provided as meta-data with
  10096. * the rx frame which peer the frame is supposed to be forwarded to.
  10097. * - CACHE_SET_NUM
  10098. * Bits 19:16
  10099. * Purpose: Cache Set Number for AST_INDEX
  10100. * Cache set number that should be used to cache the index based
  10101. * search results, for address and flow search.
  10102. * This value should be equal to LSB 4 bits of the hash value
  10103. * of match data, in case of search index points to an entry which
  10104. * may be used in content based search also. The value can be
  10105. * anything when the entry pointed by search index will not be
  10106. * used for content based search.
  10107. * - HTT_MSDU_IDX_VALID_MASK
  10108. * Bits 31:24
  10109. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10110. * - ONCHIP_AST_IDX / RESERVED
  10111. * Bits 15:0
  10112. * Purpose: This field is valid only when split AST feature is enabled.
  10113. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10114. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10115. * address, this ast_idx is used for LMAC modules for RXPCU.
  10116. * - NEXT_HOP
  10117. * Bits 16
  10118. * Purpose: Flag indicates next_hop AST entry used for WDS
  10119. * (Wireless Distribution System).
  10120. * - ONCHIP_AST_VALID
  10121. * Bits 17
  10122. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10123. * - EXT_AST_VALID
  10124. * Bits 18
  10125. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10126. * - EXT_AST_INDEX
  10127. * Bits 15:0
  10128. * Purpose: This field describes Extended AST index
  10129. * Valid if EXT_AST_VALID flag set
  10130. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10131. * Bits 31:24
  10132. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10133. */
  10134. /* dword 0 */
  10135. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10136. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10137. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10138. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10139. /* dword 1 */
  10140. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10141. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10142. /* dword 2 */
  10143. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10144. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10145. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10146. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10147. /* dword 3 */
  10148. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10149. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10150. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10151. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10152. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10153. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10154. /* dword 4 */
  10155. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10156. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10157. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10158. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10159. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10160. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10161. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10162. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10163. /* dword 5 */
  10164. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10165. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10166. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10167. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10168. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10169. do { \
  10170. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10171. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10172. } while (0)
  10173. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10174. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10175. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10176. do { \
  10177. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10178. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10179. } while (0)
  10180. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10181. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10182. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10183. do { \
  10184. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10185. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10186. } while (0)
  10187. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10188. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10189. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10190. do { \
  10191. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10192. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10193. } while (0)
  10194. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10195. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10196. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10197. do { \
  10198. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10199. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10200. } while (0)
  10201. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10202. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10203. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10204. do { \
  10205. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10206. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10207. } while (0)
  10208. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10209. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10210. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10211. do { \
  10212. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10213. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10214. } while (0)
  10215. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10216. (((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)
  10217. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10218. do { \
  10219. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10220. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10221. } while (0)
  10222. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10223. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10224. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10225. do { \
  10226. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10227. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10228. } while (0)
  10229. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10230. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10231. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10232. do { \
  10233. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10234. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10235. } while (0)
  10236. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10237. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10238. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10239. do { \
  10240. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10241. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10242. } while (0)
  10243. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10244. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10245. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10246. do { \
  10247. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10248. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10249. } while (0)
  10250. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10251. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10252. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10253. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10254. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10255. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10256. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10257. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10258. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10259. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10260. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10261. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10262. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10263. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10264. /**
  10265. * @brief target -> host rx peer unmap V2 message definition
  10266. *
  10267. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10268. *
  10269. * The following diagram shows the format of the rx peer unmap message sent
  10270. * from the target to the host.
  10271. *
  10272. * |31 24|23 16|15 8|7 0|
  10273. * |-----------------------------------------------------------------------|
  10274. * | SW peer ID | VDEV ID | msg type |
  10275. * |-----------------------------------------------------------------------|
  10276. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10277. * |-----------------------------------------------------------------------|
  10278. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10279. * |-----------------------------------------------------------------------|
  10280. * | Peer Delete Duration |
  10281. * |-----------------------------------------------------------------------|
  10282. * | Reserved_0 | WDS Free Count |
  10283. * |-----------------------------------------------------------------------|
  10284. * | Reserved_1 |
  10285. * |-----------------------------------------------------------------------|
  10286. * | Reserved_2 |
  10287. * |-----------------------------------------------------------------------|
  10288. *
  10289. *
  10290. * The following field definitions describe the format of the rx peer unmap
  10291. * messages sent from the target to the host.
  10292. * - MSG_TYPE
  10293. * Bits 7:0
  10294. * Purpose: identifies this as an rx peer unmap v2 message
  10295. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10296. * - VDEV_ID
  10297. * Bits 15:8
  10298. * Purpose: Indicates which virtual device the peer is associated
  10299. * with.
  10300. * Value: vdev ID (used in the host to look up the vdev object)
  10301. * - SW_PEER_ID
  10302. * Bits 31:16
  10303. * Purpose: The peer ID (index) that WAL is freeing
  10304. * Value: (rx) peer ID
  10305. * - MAC_ADDR_L32
  10306. * Bits 31:0
  10307. * Purpose: Identifies which peer node the peer ID is for.
  10308. * Value: lower 4 bytes of peer node's MAC address
  10309. * - MAC_ADDR_U16
  10310. * Bits 15:0
  10311. * Purpose: Identifies which peer node the peer ID is for.
  10312. * Value: upper 2 bytes of peer node's MAC address
  10313. * - NEXT_HOP
  10314. * Bits 16
  10315. * Purpose: Bit indicates next_hop AST entry used for WDS
  10316. * (Wireless Distribution System).
  10317. * - PEER_DELETE_DURATION
  10318. * Bits 31:0
  10319. * Purpose: Time taken to delete peer, in msec,
  10320. * Used for monitoring / debugging PEER delete response delay
  10321. * - PEER_WDS_FREE_COUNT
  10322. * Bits 15:0
  10323. * Purpose: Count of WDS entries deleted associated to peer deleted
  10324. */
  10325. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10326. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10327. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10328. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10329. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10330. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10331. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10332. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10333. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10334. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10335. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10336. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10337. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10338. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10339. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10340. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10341. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10342. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10343. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10344. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10345. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10346. do { \
  10347. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10348. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10349. } while (0)
  10350. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10351. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10352. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10353. do { \
  10354. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10355. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10356. } while (0)
  10357. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10358. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10359. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10360. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10361. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10362. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10363. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10364. /**
  10365. * @brief target -> host rx peer mlo map message definition
  10366. *
  10367. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10368. *
  10369. * @details
  10370. * The following diagram shows the format of the rx mlo peer map message sent
  10371. * from the target to the host. This layout assumes the target operates
  10372. * as little-endian.
  10373. *
  10374. * MCC:
  10375. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10376. *
  10377. * WIN:
  10378. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10379. * It will be sent on the Assoc Link.
  10380. *
  10381. * This message always contains a MLO peer ID. The main purpose of the
  10382. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10383. * with, so that the host can use that MLO peer ID to determine which peer
  10384. * transmitted the rx frame.
  10385. *
  10386. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10387. * |-------------------------------------------------------------------------|
  10388. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10389. * |-------------------------------------------------------------------------|
  10390. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10391. * |-------------------------------------------------------------------------|
  10392. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10393. * |-------------------------------------------------------------------------|
  10394. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10395. * |-------------------------------------------------------------------------|
  10396. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10397. * |-------------------------------------------------------------------------|
  10398. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10399. * |-------------------------------------------------------------------------|
  10400. * |RSVD |
  10401. * |-------------------------------------------------------------------------|
  10402. * |RSVD |
  10403. * |-------------------------------------------------------------------------|
  10404. * | htt_tlv_hdr_t |
  10405. * |-------------------------------------------------------------------------|
  10406. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10407. * |-------------------------------------------------------------------------|
  10408. * | htt_tlv_hdr_t |
  10409. * |-------------------------------------------------------------------------|
  10410. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10411. * |-------------------------------------------------------------------------|
  10412. * | htt_tlv_hdr_t |
  10413. * |-------------------------------------------------------------------------|
  10414. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10415. * |-------------------------------------------------------------------------|
  10416. *
  10417. * Where:
  10418. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10419. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10420. * V (valid) - 1 Bit Bit17
  10421. * CHIPID - 3 Bits
  10422. * TIDMASK - 8 Bits
  10423. * CACHE_SET_NUM - 8 Bits
  10424. *
  10425. * The following field definitions describe the format of the rx MLO peer map
  10426. * messages sent from the target to the host.
  10427. * - MSG_TYPE
  10428. * Bits 7:0
  10429. * Purpose: identifies this as an rx mlo peer map message
  10430. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10431. *
  10432. * - MLO_PEER_ID
  10433. * Bits 23:8
  10434. * Purpose: The MLO peer ID (index).
  10435. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10436. * Value: MLO peer ID
  10437. *
  10438. * - NUMLINK
  10439. * Bits: 26:24 (3Bits)
  10440. * Purpose: Indicate the max number of logical links supported per client.
  10441. * Value: number of logical links
  10442. *
  10443. * - PRC
  10444. * Bits: 29:27 (3Bits)
  10445. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10446. * if there is migration of the primary chip.
  10447. * Value: Primary REO CHIPID
  10448. *
  10449. * - MAC_ADDR_L32
  10450. * Bits 31:0
  10451. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10452. * Value: lower 4 bytes of peer node's MAC address
  10453. *
  10454. * - MAC_ADDR_U16
  10455. * Bits 15:0
  10456. * Purpose: Identifies which peer node the peer ID is for.
  10457. * Value: upper 2 bytes of peer node's MAC address
  10458. *
  10459. * - PRIMARY_TCL_AST_IDX
  10460. * Bits 15:0
  10461. * Purpose: Primary TCL AST index for this peer.
  10462. *
  10463. * - V
  10464. * 1 Bit Position 16
  10465. * Purpose: If the ast idx is valid.
  10466. *
  10467. * - CHIPID
  10468. * Bits 19:17
  10469. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10470. *
  10471. * - TIDMASK
  10472. * Bits 27:20
  10473. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10474. *
  10475. * - CACHE_SET_NUM
  10476. * Bits 31:28
  10477. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10478. * Cache set number that should be used to cache the index based
  10479. * search results, for address and flow search.
  10480. * This value should be equal to LSB four bits of the hash value
  10481. * of match data, in case of search index points to an entry which
  10482. * may be used in content based search also. The value can be
  10483. * anything when the entry pointed by search index will not be
  10484. * used for content based search.
  10485. *
  10486. * - htt_tlv_hdr_t
  10487. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10488. *
  10489. * Bits 11:0
  10490. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10491. *
  10492. * Bits 23:12
  10493. * Purpose: Length, Length of the value that follows the header
  10494. *
  10495. * Bits 31:28
  10496. * Purpose: Reserved.
  10497. *
  10498. *
  10499. * - SW_PEER_ID
  10500. * Bits 15:0
  10501. * Purpose: The peer ID (index) that WAL is allocating
  10502. * Value: (rx) peer ID
  10503. *
  10504. * - VDEV_ID
  10505. * Bits 23:16
  10506. * Purpose: Indicates which virtual device the peer is associated with.
  10507. * Value: vdev ID (used in the host to look up the vdev object)
  10508. *
  10509. * - CHIPID
  10510. * Bits 26:24
  10511. * Purpose: Indicates which Chip id the peer is associated with.
  10512. * Value: chip ID (Provided by Host as part of QMI exchange)
  10513. */
  10514. typedef enum {
  10515. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10516. } MLO_PEER_MAP_TLV_TAG_ID;
  10517. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10518. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10519. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10520. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10521. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10522. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10523. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10524. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10525. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10526. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10527. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10528. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10529. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10530. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10531. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10532. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10533. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10534. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10535. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10536. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10537. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10538. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10539. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10540. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10541. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10542. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10543. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10544. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10545. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10546. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10547. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10548. do { \
  10549. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10550. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10551. } while (0)
  10552. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10553. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10554. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10555. do { \
  10556. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10557. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10558. } while (0)
  10559. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10560. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10561. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10562. do { \
  10563. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10564. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10565. } while (0)
  10566. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10567. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10568. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10569. do { \
  10570. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10571. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10572. } while (0)
  10573. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10574. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10575. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10576. do { \
  10577. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10578. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10579. } while (0)
  10580. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10581. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10582. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10583. do { \
  10584. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10585. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10586. } while (0)
  10587. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10588. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10589. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10590. do { \
  10591. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10592. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10593. } while (0)
  10594. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10595. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10596. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10597. do { \
  10598. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10599. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10600. } while (0)
  10601. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10602. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10603. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10604. do { \
  10605. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10606. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10607. } while (0)
  10608. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10609. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10610. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10611. do { \
  10612. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10613. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10614. } while (0)
  10615. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10616. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10617. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10618. do { \
  10619. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10620. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10621. } while (0)
  10622. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10623. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10624. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10625. do { \
  10626. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10627. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10628. } while (0)
  10629. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10630. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10631. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10632. do { \
  10633. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10634. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10635. } while (0)
  10636. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10637. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10638. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10639. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10640. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10641. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10642. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10643. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10644. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10645. *
  10646. * The following diagram shows the format of the rx mlo peer unmap message sent
  10647. * from the target to the host.
  10648. *
  10649. * |31 24|23 16|15 8|7 0|
  10650. * |-----------------------------------------------------------------------|
  10651. * | RSVD_24_31 | MLO peer ID | msg type |
  10652. * |-----------------------------------------------------------------------|
  10653. */
  10654. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10655. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10656. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10657. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10658. /**
  10659. * @brief target -> host message specifying security parameters
  10660. *
  10661. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10662. *
  10663. * @details
  10664. * The following diagram shows the format of the security specification
  10665. * message sent from the target to the host.
  10666. * This security specification message tells the host whether a PN check is
  10667. * necessary on rx data frames, and if so, how large the PN counter is.
  10668. * This message also tells the host about the security processing to apply
  10669. * to defragmented rx frames - specifically, whether a Message Integrity
  10670. * Check is required, and the Michael key to use.
  10671. *
  10672. * |31 24|23 16|15|14 8|7 0|
  10673. * |-----------------------------------------------------------------------|
  10674. * | peer ID | U| security type | msg type |
  10675. * |-----------------------------------------------------------------------|
  10676. * | Michael Key K0 |
  10677. * |-----------------------------------------------------------------------|
  10678. * | Michael Key K1 |
  10679. * |-----------------------------------------------------------------------|
  10680. * | WAPI RSC Low0 |
  10681. * |-----------------------------------------------------------------------|
  10682. * | WAPI RSC Low1 |
  10683. * |-----------------------------------------------------------------------|
  10684. * | WAPI RSC Hi0 |
  10685. * |-----------------------------------------------------------------------|
  10686. * | WAPI RSC Hi1 |
  10687. * |-----------------------------------------------------------------------|
  10688. *
  10689. * The following field definitions describe the format of the security
  10690. * indication message sent from the target to the host.
  10691. * - MSG_TYPE
  10692. * Bits 7:0
  10693. * Purpose: identifies this as a security specification message
  10694. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10695. * - SEC_TYPE
  10696. * Bits 14:8
  10697. * Purpose: specifies which type of security applies to the peer
  10698. * Value: htt_sec_type enum value
  10699. * - UNICAST
  10700. * Bit 15
  10701. * Purpose: whether this security is applied to unicast or multicast data
  10702. * Value: 1 -> unicast, 0 -> multicast
  10703. * - PEER_ID
  10704. * Bits 31:16
  10705. * Purpose: The ID number for the peer the security specification is for
  10706. * Value: peer ID
  10707. * - MICHAEL_KEY_K0
  10708. * Bits 31:0
  10709. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10710. * Value: Michael Key K0 (if security type is TKIP)
  10711. * - MICHAEL_KEY_K1
  10712. * Bits 31:0
  10713. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10714. * Value: Michael Key K1 (if security type is TKIP)
  10715. * - WAPI_RSC_LOW0
  10716. * Bits 31:0
  10717. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10718. * Value: WAPI RSC Low0 (if security type is WAPI)
  10719. * - WAPI_RSC_LOW1
  10720. * Bits 31:0
  10721. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10722. * Value: WAPI RSC Low1 (if security type is WAPI)
  10723. * - WAPI_RSC_HI0
  10724. * Bits 31:0
  10725. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10726. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10727. * - WAPI_RSC_HI1
  10728. * Bits 31:0
  10729. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10730. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10731. */
  10732. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10733. #define HTT_SEC_IND_SEC_TYPE_S 8
  10734. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10735. #define HTT_SEC_IND_UNICAST_S 15
  10736. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10737. #define HTT_SEC_IND_PEER_ID_S 16
  10738. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10739. do { \
  10740. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10741. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10742. } while (0)
  10743. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10744. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10745. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10746. do { \
  10747. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10748. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10749. } while (0)
  10750. #define HTT_SEC_IND_UNICAST_GET(word) \
  10751. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10752. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10753. do { \
  10754. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10755. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10756. } while (0)
  10757. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10758. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10759. #define HTT_SEC_IND_BYTES 28
  10760. /**
  10761. * @brief target -> host rx ADDBA / DELBA message definitions
  10762. *
  10763. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10764. *
  10765. * @details
  10766. * The following diagram shows the format of the rx ADDBA message sent
  10767. * from the target to the host:
  10768. *
  10769. * |31 20|19 16|15 8|7 0|
  10770. * |---------------------------------------------------------------------|
  10771. * | peer ID | TID | window size | msg type |
  10772. * |---------------------------------------------------------------------|
  10773. *
  10774. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10775. *
  10776. * The following diagram shows the format of the rx DELBA message sent
  10777. * from the target to the host:
  10778. *
  10779. * |31 20|19 16|15 10|9 8|7 0|
  10780. * |---------------------------------------------------------------------|
  10781. * | peer ID | TID | window size | IR| msg type |
  10782. * |---------------------------------------------------------------------|
  10783. *
  10784. * The following field definitions describe the format of the rx ADDBA
  10785. * and DELBA messages sent from the target to the host.
  10786. * - MSG_TYPE
  10787. * Bits 7:0
  10788. * Purpose: identifies this as an rx ADDBA or DELBA message
  10789. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10790. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10791. * - IR (initiator / recipient)
  10792. * Bits 9:8 (DELBA only)
  10793. * Purpose: specify whether the DELBA handshake was initiated by the
  10794. * local STA/AP, or by the peer STA/AP
  10795. * Value:
  10796. * 0 - unspecified
  10797. * 1 - initiator (a.k.a. originator)
  10798. * 2 - recipient (a.k.a. responder)
  10799. * 3 - unused / reserved
  10800. * - WIN_SIZE
  10801. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10802. * Purpose: Specifies the length of the block ack window (max = 64).
  10803. * Value:
  10804. * block ack window length specified by the received ADDBA/DELBA
  10805. * management message.
  10806. * - TID
  10807. * Bits 19:16
  10808. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10809. * Value:
  10810. * TID specified by the received ADDBA or DELBA management message.
  10811. * - PEER_ID
  10812. * Bits 31:20
  10813. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10814. * Value:
  10815. * ID (hash value) used by the host for fast, direct lookup of
  10816. * host SW peer info, including rx reorder states.
  10817. */
  10818. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10819. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10820. #define HTT_RX_ADDBA_TID_M 0xf0000
  10821. #define HTT_RX_ADDBA_TID_S 16
  10822. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10823. #define HTT_RX_ADDBA_PEER_ID_S 20
  10824. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10825. do { \
  10826. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10827. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10828. } while (0)
  10829. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10830. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10831. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10832. do { \
  10833. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10834. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10835. } while (0)
  10836. #define HTT_RX_ADDBA_TID_GET(word) \
  10837. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10838. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10839. do { \
  10840. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10841. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10842. } while (0)
  10843. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10844. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10845. #define HTT_RX_ADDBA_BYTES 4
  10846. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10847. #define HTT_RX_DELBA_INITIATOR_S 8
  10848. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10849. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10850. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10851. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10852. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10853. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10854. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10855. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10856. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10857. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10858. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10859. do { \
  10860. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10861. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10862. } while (0)
  10863. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10864. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10865. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10866. do { \
  10867. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10868. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10869. } while (0)
  10870. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10871. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10872. #define HTT_RX_DELBA_BYTES 4
  10873. /**
  10874. * @brief tx queue group information element definition
  10875. *
  10876. * @details
  10877. * The following diagram shows the format of the tx queue group
  10878. * information element, which can be included in target --> host
  10879. * messages to specify the number of tx "credits" (tx descriptors
  10880. * for LL, or tx buffers for HL) available to a particular group
  10881. * of host-side tx queues, and which host-side tx queues belong to
  10882. * the group.
  10883. *
  10884. * |31|30 24|23 16|15|14|13 0|
  10885. * |------------------------------------------------------------------------|
  10886. * | X| reserved | tx queue grp ID | A| S| credit count |
  10887. * |------------------------------------------------------------------------|
  10888. * | vdev ID mask | AC mask |
  10889. * |------------------------------------------------------------------------|
  10890. *
  10891. * The following definitions describe the fields within the tx queue group
  10892. * information element:
  10893. * - credit_count
  10894. * Bits 13:1
  10895. * Purpose: specify how many tx credits are available to the tx queue group
  10896. * Value: An absolute or relative, positive or negative credit value
  10897. * The 'A' bit specifies whether the value is absolute or relative.
  10898. * The 'S' bit specifies whether the value is positive or negative.
  10899. * A negative value can only be relative, not absolute.
  10900. * An absolute value replaces any prior credit value the host has for
  10901. * the tx queue group in question.
  10902. * A relative value is added to the prior credit value the host has for
  10903. * the tx queue group in question.
  10904. * - sign
  10905. * Bit 14
  10906. * Purpose: specify whether the credit count is positive or negative
  10907. * Value: 0 -> positive, 1 -> negative
  10908. * - absolute
  10909. * Bit 15
  10910. * Purpose: specify whether the credit count is absolute or relative
  10911. * Value: 0 -> relative, 1 -> absolute
  10912. * - txq_group_id
  10913. * Bits 23:16
  10914. * Purpose: indicate which tx queue group's credit and/or membership are
  10915. * being specified
  10916. * Value: 0 to max_tx_queue_groups-1
  10917. * - reserved
  10918. * Bits 30:16
  10919. * Value: 0x0
  10920. * - eXtension
  10921. * Bit 31
  10922. * Purpose: specify whether another tx queue group info element follows
  10923. * Value: 0 -> no more tx queue group information elements
  10924. * 1 -> another tx queue group information element immediately follows
  10925. * - ac_mask
  10926. * Bits 15:0
  10927. * Purpose: specify which Access Categories belong to the tx queue group
  10928. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10929. * the tx queue group.
  10930. * The AC bit-mask values are obtained by left-shifting by the
  10931. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10932. * - vdev_id_mask
  10933. * Bits 31:16
  10934. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10935. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10936. * belong to the tx queue group.
  10937. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10938. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10939. */
  10940. PREPACK struct htt_txq_group {
  10941. A_UINT32
  10942. credit_count: 14,
  10943. sign: 1,
  10944. absolute: 1,
  10945. tx_queue_group_id: 8,
  10946. reserved0: 7,
  10947. extension: 1;
  10948. A_UINT32
  10949. ac_mask: 16,
  10950. vdev_id_mask: 16;
  10951. } POSTPACK;
  10952. /* first word */
  10953. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10954. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10955. #define HTT_TXQ_GROUP_SIGN_S 14
  10956. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10957. #define HTT_TXQ_GROUP_ABS_S 15
  10958. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10959. #define HTT_TXQ_GROUP_ID_S 16
  10960. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10961. #define HTT_TXQ_GROUP_EXT_S 31
  10962. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10963. /* second word */
  10964. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10965. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10966. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10967. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10968. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10969. do { \
  10970. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10971. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10972. } while (0)
  10973. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10974. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10975. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10976. do { \
  10977. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10978. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10979. } while (0)
  10980. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10981. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10982. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10983. do { \
  10984. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10985. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10986. } while (0)
  10987. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10988. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10989. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10990. do { \
  10991. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10992. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10993. } while (0)
  10994. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10995. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10996. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10997. do { \
  10998. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10999. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11000. } while (0)
  11001. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11002. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11003. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11004. do { \
  11005. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11006. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11007. } while (0)
  11008. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11009. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11010. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11011. do { \
  11012. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11013. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11014. } while (0)
  11015. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11016. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11017. /**
  11018. * @brief target -> host TX completion indication message definition
  11019. *
  11020. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11021. *
  11022. * @details
  11023. * The following diagram shows the format of the TX completion indication sent
  11024. * from the target to the host
  11025. *
  11026. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11027. * |-------------------------------------------------------------------|
  11028. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11029. * |-------------------------------------------------------------------|
  11030. * payload:| MSDU1 ID | MSDU0 ID |
  11031. * |-------------------------------------------------------------------|
  11032. * : MSDU3 ID | MSDU2 ID :
  11033. * |-------------------------------------------------------------------|
  11034. * | struct htt_tx_compl_ind_append_retries |
  11035. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11036. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11037. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11038. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11039. * |-------------------------------------------------------------------|
  11040. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11041. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11042. * | MSDU0 tx_tsf64_low |
  11043. * |-------------------------------------------------------------------|
  11044. * | MSDU0 tx_tsf64_high |
  11045. * |-------------------------------------------------------------------|
  11046. * | MSDU1 tx_tsf64_low |
  11047. * |-------------------------------------------------------------------|
  11048. * | MSDU1 tx_tsf64_high |
  11049. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11050. * | phy_timestamp |
  11051. * |-------------------------------------------------------------------|
  11052. * | rate specs (see below) |
  11053. * |-------------------------------------------------------------------|
  11054. * | seqctrl | framectrl |
  11055. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11056. * Where:
  11057. * A0 = append (a.k.a. append0)
  11058. * A1 = append1
  11059. * TP = MSDU tx power presence
  11060. * A2 = append2
  11061. * A3 = append3
  11062. * A4 = append4
  11063. *
  11064. * The following field definitions describe the format of the TX completion
  11065. * indication sent from the target to the host
  11066. * Header fields:
  11067. * - msg_type
  11068. * Bits 7:0
  11069. * Purpose: identifies this as HTT TX completion indication
  11070. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11071. * - status
  11072. * Bits 10:8
  11073. * Purpose: the TX completion status of payload fragmentations descriptors
  11074. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11075. * - tid
  11076. * Bits 14:11
  11077. * Purpose: the tid associated with those fragmentation descriptors. It is
  11078. * valid or not, depending on the tid_invalid bit.
  11079. * Value: 0 to 15
  11080. * - tid_invalid
  11081. * Bits 15:15
  11082. * Purpose: this bit indicates whether the tid field is valid or not
  11083. * Value: 0 indicates valid; 1 indicates invalid
  11084. * - num
  11085. * Bits 23:16
  11086. * Purpose: the number of payload in this indication
  11087. * Value: 1 to 255
  11088. * - append (a.k.a. append0)
  11089. * Bits 24:24
  11090. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11091. * the number of tx retries for one MSDU at the end of this message
  11092. * Value: 0 indicates no appending; 1 indicates appending
  11093. * - append1
  11094. * Bits 25:25
  11095. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11096. * contains the timestamp info for each TX msdu id in payload.
  11097. * The order of the timestamps matches the order of the MSDU IDs.
  11098. * Note that a big-endian host needs to account for the reordering
  11099. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11100. * conversion) when determining which tx timestamp corresponds to
  11101. * which MSDU ID.
  11102. * Value: 0 indicates no appending; 1 indicates appending
  11103. * - msdu_tx_power_presence
  11104. * Bits 26:26
  11105. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11106. * for each MSDU referenced by the TX_COMPL_IND message.
  11107. * The tx power is reported in 0.5 dBm units.
  11108. * The order of the per-MSDU tx power reports matches the order
  11109. * of the MSDU IDs.
  11110. * Note that a big-endian host needs to account for the reordering
  11111. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11112. * conversion) when determining which Tx Power corresponds to
  11113. * which MSDU ID.
  11114. * Value: 0 indicates MSDU tx power reports are not appended,
  11115. * 1 indicates MSDU tx power reports are appended
  11116. * - append2
  11117. * Bits 27:27
  11118. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11119. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11120. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11121. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11122. * for each MSDU, for convenience.
  11123. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11124. * this append2 bit is set).
  11125. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11126. * dB above the noise floor.
  11127. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11128. * 1 indicates MSDU ACK RSSI values are appended.
  11129. * - append3
  11130. * Bits 28:28
  11131. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11132. * contains the tx tsf info based on wlan global TSF for
  11133. * each TX msdu id in payload.
  11134. * The order of the tx tsf matches the order of the MSDU IDs.
  11135. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11136. * values to indicate the the lower 32 bits and higher 32 bits of
  11137. * the tx tsf.
  11138. * The tx_tsf64 here represents the time MSDU was acked and the
  11139. * tx_tsf64 has microseconds units.
  11140. * Value: 0 indicates no appending; 1 indicates appending
  11141. * - append4
  11142. * Bits 29:29
  11143. * Purpose: Indicate whether data frame control fields and fields required
  11144. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11145. * message. The order of the this message matches the order of
  11146. * the MSDU IDs.
  11147. * Value: 0 indicates frame control fields and fields required for
  11148. * radio tap header values are not appended,
  11149. * 1 indicates frame control fields and fields required for
  11150. * radio tap header values are appended.
  11151. * Payload fields:
  11152. * - hmsdu_id
  11153. * Bits 15:0
  11154. * Purpose: this ID is used to track the Tx buffer in host
  11155. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11156. */
  11157. PREPACK struct htt_tx_data_hdr_information {
  11158. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11159. A_UINT32 /* word 1 */
  11160. /* preamble:
  11161. * 0-OFDM,
  11162. * 1-CCk,
  11163. * 2-HT,
  11164. * 3-VHT
  11165. */
  11166. preamble: 2, /* [1:0] */
  11167. /* mcs:
  11168. * In case of HT preamble interpret
  11169. * MCS along with NSS.
  11170. * Valid values for HT are 0 to 7.
  11171. * HT mcs 0 with NSS 2 is mcs 8.
  11172. * Valid values for VHT are 0 to 9.
  11173. */
  11174. mcs: 4, /* [5:2] */
  11175. /* rate:
  11176. * This is applicable only for
  11177. * CCK and OFDM preamble type
  11178. * rate 0: OFDM 48 Mbps,
  11179. * 1: OFDM 24 Mbps,
  11180. * 2: OFDM 12 Mbps
  11181. * 3: OFDM 6 Mbps
  11182. * 4: OFDM 54 Mbps
  11183. * 5: OFDM 36 Mbps
  11184. * 6: OFDM 18 Mbps
  11185. * 7: OFDM 9 Mbps
  11186. * rate 0: CCK 11 Mbps Long
  11187. * 1: CCK 5.5 Mbps Long
  11188. * 2: CCK 2 Mbps Long
  11189. * 3: CCK 1 Mbps Long
  11190. * 4: CCK 11 Mbps Short
  11191. * 5: CCK 5.5 Mbps Short
  11192. * 6: CCK 2 Mbps Short
  11193. */
  11194. rate : 3, /* [ 8: 6] */
  11195. rssi : 8, /* [16: 9] units=dBm */
  11196. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11197. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11198. stbc : 1, /* [22] */
  11199. sgi : 1, /* [23] */
  11200. ldpc : 1, /* [24] */
  11201. beamformed: 1, /* [25] */
  11202. /* tx_retry_cnt:
  11203. * Indicates retry count of data tx frames provided by the host.
  11204. */
  11205. tx_retry_cnt: 6; /* [31:26] */
  11206. A_UINT32 /* word 2 */
  11207. framectrl:16, /* [15: 0] */
  11208. seqno:16; /* [31:16] */
  11209. } POSTPACK;
  11210. #define HTT_TX_COMPL_IND_STATUS_S 8
  11211. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11212. #define HTT_TX_COMPL_IND_TID_S 11
  11213. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11214. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11215. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11216. #define HTT_TX_COMPL_IND_NUM_S 16
  11217. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11218. #define HTT_TX_COMPL_IND_APPEND_S 24
  11219. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11220. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11221. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11222. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11223. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11224. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11225. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11226. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11227. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11228. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11229. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11230. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11231. do { \
  11232. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11233. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11234. } while (0)
  11235. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11236. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11237. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11238. do { \
  11239. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11240. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11241. } while (0)
  11242. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11243. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11244. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11245. do { \
  11246. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11247. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11248. } while (0)
  11249. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11250. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11251. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11252. do { \
  11253. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11254. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11255. } while (0)
  11256. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11257. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11258. HTT_TX_COMPL_IND_TID_INV_S)
  11259. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11260. do { \
  11261. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11262. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11263. } while (0)
  11264. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11265. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11266. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11267. do { \
  11268. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11269. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11270. } while (0)
  11271. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11272. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11273. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11274. do { \
  11275. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11276. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11277. } while (0)
  11278. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11279. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11280. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11281. do { \
  11282. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11283. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11284. } while (0)
  11285. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11286. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11287. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11288. do { \
  11289. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11290. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11291. } while (0)
  11292. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11293. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11294. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11295. do { \
  11296. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11297. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11298. } while (0)
  11299. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11300. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11301. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11302. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11303. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11304. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11305. #define HTT_TX_COMPL_IND_STAT_OK 0
  11306. /* DISCARD:
  11307. * current meaning:
  11308. * MSDUs were queued for transmission but filtered by HW or SW
  11309. * without any over the air attempts
  11310. * legacy meaning (HL Rome):
  11311. * MSDUs were discarded by the target FW without any over the air
  11312. * attempts due to lack of space
  11313. */
  11314. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11315. /* NO_ACK:
  11316. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11317. */
  11318. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11319. /* POSTPONE:
  11320. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11321. * be downloaded again later (in the appropriate order), when they are
  11322. * deliverable.
  11323. */
  11324. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11325. /*
  11326. * The PEER_DEL tx completion status is used for HL cases
  11327. * where the peer the frame is for has been deleted.
  11328. * The host has already discarded its copy of the frame, but
  11329. * it still needs the tx completion to restore its credit.
  11330. */
  11331. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11332. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11333. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11334. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11335. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11336. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11337. PREPACK struct htt_tx_compl_ind_base {
  11338. A_UINT32 hdr;
  11339. A_UINT16 payload[1/*or more*/];
  11340. } POSTPACK;
  11341. PREPACK struct htt_tx_compl_ind_append_retries {
  11342. A_UINT16 msdu_id;
  11343. A_UINT8 tx_retries;
  11344. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11345. 0: this is the last append_retries struct */
  11346. } POSTPACK;
  11347. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11348. A_UINT32 timestamp[1/*or more*/];
  11349. } POSTPACK;
  11350. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11351. A_UINT32 tx_tsf64_low;
  11352. A_UINT32 tx_tsf64_high;
  11353. } POSTPACK;
  11354. /* htt_tx_data_hdr_information payload extension fields: */
  11355. /* DWORD zero */
  11356. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11357. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11358. /* DWORD one */
  11359. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11360. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11361. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11362. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11363. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11364. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11365. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11366. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11367. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11368. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11369. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11370. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11371. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11372. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11373. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11374. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11375. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11376. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11377. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11378. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11379. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11380. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11381. /* DWORD two */
  11382. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11383. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11384. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11385. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11386. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11387. do { \
  11388. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11389. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11390. } while (0)
  11391. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11392. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11393. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11394. do { \
  11395. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11396. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11397. } while (0)
  11398. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11399. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11400. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11401. do { \
  11402. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11403. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11404. } while (0)
  11405. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11406. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11407. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11408. do { \
  11409. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11410. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11411. } while (0)
  11412. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11413. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11414. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11415. do { \
  11416. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11417. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11418. } while (0)
  11419. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11420. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11421. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11422. do { \
  11423. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11424. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11425. } while (0)
  11426. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11427. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11428. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11429. do { \
  11430. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11431. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11432. } while (0)
  11433. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11434. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11435. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11436. do { \
  11437. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11438. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11439. } while (0)
  11440. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11441. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11442. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11443. do { \
  11444. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11445. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11446. } while (0)
  11447. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11448. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11449. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11450. do { \
  11451. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11452. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11453. } while (0)
  11454. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11455. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11456. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11457. do { \
  11458. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11459. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11460. } while (0)
  11461. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11462. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11463. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11464. do { \
  11465. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11466. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11467. } while (0)
  11468. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11469. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11470. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11471. do { \
  11472. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11473. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11474. } while (0)
  11475. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11476. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11477. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11478. do { \
  11479. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11480. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11481. } while (0)
  11482. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11483. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11484. /**
  11485. * @brief target -> host rate-control update indication message
  11486. *
  11487. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11488. *
  11489. * @details
  11490. * The following diagram shows the format of the RC Update message
  11491. * sent from the target to the host, while processing the tx-completion
  11492. * of a transmitted PPDU.
  11493. *
  11494. * |31 24|23 16|15 8|7 0|
  11495. * |-------------------------------------------------------------|
  11496. * | peer ID | vdev ID | msg_type |
  11497. * |-------------------------------------------------------------|
  11498. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11499. * |-------------------------------------------------------------|
  11500. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11501. * |-------------------------------------------------------------|
  11502. * | : |
  11503. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11504. * | : |
  11505. * |-------------------------------------------------------------|
  11506. * | : |
  11507. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11508. * | : |
  11509. * |-------------------------------------------------------------|
  11510. * : :
  11511. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11512. *
  11513. */
  11514. typedef struct {
  11515. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11516. A_UINT32 rate_code_flags;
  11517. A_UINT32 flags; /* Encodes information such as excessive
  11518. retransmission, aggregate, some info
  11519. from .11 frame control,
  11520. STBC, LDPC, (SGI and Tx Chain Mask
  11521. are encoded in ptx_rc->flags field),
  11522. AMPDU truncation (BT/time based etc.),
  11523. RTS/CTS attempt */
  11524. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11525. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11526. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11527. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11528. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11529. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11530. } HTT_RC_TX_DONE_PARAMS;
  11531. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11532. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11533. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11534. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11535. #define HTT_RC_UPDATE_VDEVID_S 8
  11536. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11537. #define HTT_RC_UPDATE_PEERID_S 16
  11538. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11539. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11540. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11541. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11542. do { \
  11543. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11544. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11545. } while (0)
  11546. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11547. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11548. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11549. do { \
  11550. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11551. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11552. } while (0)
  11553. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11554. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11555. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11556. do { \
  11557. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11558. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11559. } while (0)
  11560. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11561. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11562. /**
  11563. * @brief target -> host rx fragment indication message definition
  11564. *
  11565. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11566. *
  11567. * @details
  11568. * The following field definitions describe the format of the rx fragment
  11569. * indication message sent from the target to the host.
  11570. * The rx fragment indication message shares the format of the
  11571. * rx indication message, but not all fields from the rx indication message
  11572. * are relevant to the rx fragment indication message.
  11573. *
  11574. *
  11575. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11576. * |-----------+-------------------+---------------------+-------------|
  11577. * | peer ID | |FV| ext TID | msg type |
  11578. * |-------------------------------------------------------------------|
  11579. * | | flush | flush |
  11580. * | | end | start |
  11581. * | | seq num | seq num |
  11582. * |-------------------------------------------------------------------|
  11583. * | reserved | FW rx desc bytes |
  11584. * |-------------------------------------------------------------------|
  11585. * | | FW MSDU Rx |
  11586. * | | desc B0 |
  11587. * |-------------------------------------------------------------------|
  11588. * Header fields:
  11589. * - MSG_TYPE
  11590. * Bits 7:0
  11591. * Purpose: identifies this as an rx fragment indication message
  11592. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11593. * - EXT_TID
  11594. * Bits 12:8
  11595. * Purpose: identify the traffic ID of the rx data, including
  11596. * special "extended" TID values for multicast, broadcast, and
  11597. * non-QoS data frames
  11598. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11599. * - FLUSH_VALID (FV)
  11600. * Bit 13
  11601. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11602. * is valid
  11603. * Value:
  11604. * 1 -> flush IE is valid and needs to be processed
  11605. * 0 -> flush IE is not valid and should be ignored
  11606. * - PEER_ID
  11607. * Bits 31:16
  11608. * Purpose: Identify, by ID, which peer sent the rx data
  11609. * Value: ID of the peer who sent the rx data
  11610. * - FLUSH_SEQ_NUM_START
  11611. * Bits 5:0
  11612. * Purpose: Indicate the start of a series of MPDUs to flush
  11613. * Not all MPDUs within this series are necessarily valid - the host
  11614. * must check each sequence number within this range to see if the
  11615. * corresponding MPDU is actually present.
  11616. * This field is only valid if the FV bit is set.
  11617. * Value:
  11618. * The sequence number for the first MPDUs to check to flush.
  11619. * The sequence number is masked by 0x3f.
  11620. * - FLUSH_SEQ_NUM_END
  11621. * Bits 11:6
  11622. * Purpose: Indicate the end of a series of MPDUs to flush
  11623. * Value:
  11624. * The sequence number one larger than the sequence number of the
  11625. * last MPDU to check to flush.
  11626. * The sequence number is masked by 0x3f.
  11627. * Not all MPDUs within this series are necessarily valid - the host
  11628. * must check each sequence number within this range to see if the
  11629. * corresponding MPDU is actually present.
  11630. * This field is only valid if the FV bit is set.
  11631. * Rx descriptor fields:
  11632. * - FW_RX_DESC_BYTES
  11633. * Bits 15:0
  11634. * Purpose: Indicate how many bytes in the Rx indication are used for
  11635. * FW Rx descriptors
  11636. * Value: 1
  11637. */
  11638. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11639. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11640. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11641. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11642. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11643. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11644. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11645. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11646. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11647. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11648. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11649. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11650. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11651. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11652. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11653. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11654. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11655. #define HTT_RX_FRAG_IND_BYTES \
  11656. (4 /* msg hdr */ + \
  11657. 4 /* flush spec */ + \
  11658. 4 /* (unused) FW rx desc bytes spec */ + \
  11659. 4 /* FW rx desc */)
  11660. /**
  11661. * @brief target -> host test message definition
  11662. *
  11663. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11664. *
  11665. * @details
  11666. * The following field definitions describe the format of the test
  11667. * message sent from the target to the host.
  11668. * The message consists of a 4-octet header, followed by a variable
  11669. * number of 32-bit integer values, followed by a variable number
  11670. * of 8-bit character values.
  11671. *
  11672. * |31 16|15 8|7 0|
  11673. * |-----------------------------------------------------------|
  11674. * | num chars | num ints | msg type |
  11675. * |-----------------------------------------------------------|
  11676. * | int 0 |
  11677. * |-----------------------------------------------------------|
  11678. * | int 1 |
  11679. * |-----------------------------------------------------------|
  11680. * | ... |
  11681. * |-----------------------------------------------------------|
  11682. * | char 3 | char 2 | char 1 | char 0 |
  11683. * |-----------------------------------------------------------|
  11684. * | | | ... | char 4 |
  11685. * |-----------------------------------------------------------|
  11686. * - MSG_TYPE
  11687. * Bits 7:0
  11688. * Purpose: identifies this as a test message
  11689. * Value: HTT_MSG_TYPE_TEST
  11690. * - NUM_INTS
  11691. * Bits 15:8
  11692. * Purpose: indicate how many 32-bit integers follow the message header
  11693. * - NUM_CHARS
  11694. * Bits 31:16
  11695. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11696. */
  11697. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11698. #define HTT_RX_TEST_NUM_INTS_S 8
  11699. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11700. #define HTT_RX_TEST_NUM_CHARS_S 16
  11701. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11702. do { \
  11703. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11704. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11705. } while (0)
  11706. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11707. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11708. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11709. do { \
  11710. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11711. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11712. } while (0)
  11713. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11714. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11715. /**
  11716. * @brief target -> host packet log message
  11717. *
  11718. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11719. *
  11720. * @details
  11721. * The following field definitions describe the format of the packet log
  11722. * message sent from the target to the host.
  11723. * The message consists of a 4-octet header,followed by a variable number
  11724. * of 32-bit character values.
  11725. *
  11726. * |31 16|15 12|11 10|9 8|7 0|
  11727. * |------------------------------------------------------------------|
  11728. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11729. * |------------------------------------------------------------------|
  11730. * | payload |
  11731. * |------------------------------------------------------------------|
  11732. * - MSG_TYPE
  11733. * Bits 7:0
  11734. * Purpose: identifies this as a pktlog message
  11735. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11736. * - mac_id
  11737. * Bits 9:8
  11738. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11739. * Value: 0-3
  11740. * - pdev_id
  11741. * Bits 11:10
  11742. * Purpose: pdev_id
  11743. * Value: 0-3
  11744. * 0 (for rings at SOC level),
  11745. * 1/2/3 PDEV -> 0/1/2
  11746. * - payload_size
  11747. * Bits 31:16
  11748. * Purpose: explicitly specify the payload size
  11749. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11750. */
  11751. PREPACK struct htt_pktlog_msg {
  11752. A_UINT32 header;
  11753. A_UINT32 payload[1/* or more */];
  11754. } POSTPACK;
  11755. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11756. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11757. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11758. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11759. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11760. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11761. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11762. do { \
  11763. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11764. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11765. } while (0)
  11766. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11767. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11768. HTT_T2H_PKTLOG_MAC_ID_S)
  11769. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11770. do { \
  11771. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11772. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11773. } while (0)
  11774. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11775. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11776. HTT_T2H_PKTLOG_PDEV_ID_S)
  11777. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11778. do { \
  11779. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11780. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11781. } while (0)
  11782. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11783. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11784. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11785. /*
  11786. * Rx reorder statistics
  11787. * NB: all the fields must be defined in 4 octets size.
  11788. */
  11789. struct rx_reorder_stats {
  11790. /* Non QoS MPDUs received */
  11791. A_UINT32 deliver_non_qos;
  11792. /* MPDUs received in-order */
  11793. A_UINT32 deliver_in_order;
  11794. /* Flush due to reorder timer expired */
  11795. A_UINT32 deliver_flush_timeout;
  11796. /* Flush due to move out of window */
  11797. A_UINT32 deliver_flush_oow;
  11798. /* Flush due to DELBA */
  11799. A_UINT32 deliver_flush_delba;
  11800. /* MPDUs dropped due to FCS error */
  11801. A_UINT32 fcs_error;
  11802. /* MPDUs dropped due to monitor mode non-data packet */
  11803. A_UINT32 mgmt_ctrl;
  11804. /* Unicast-data MPDUs dropped due to invalid peer */
  11805. A_UINT32 invalid_peer;
  11806. /* MPDUs dropped due to duplication (non aggregation) */
  11807. A_UINT32 dup_non_aggr;
  11808. /* MPDUs dropped due to processed before */
  11809. A_UINT32 dup_past;
  11810. /* MPDUs dropped due to duplicate in reorder queue */
  11811. A_UINT32 dup_in_reorder;
  11812. /* Reorder timeout happened */
  11813. A_UINT32 reorder_timeout;
  11814. /* invalid bar ssn */
  11815. A_UINT32 invalid_bar_ssn;
  11816. /* reorder reset due to bar ssn */
  11817. A_UINT32 ssn_reset;
  11818. /* Flush due to delete peer */
  11819. A_UINT32 deliver_flush_delpeer;
  11820. /* Flush due to offload*/
  11821. A_UINT32 deliver_flush_offload;
  11822. /* Flush due to out of buffer*/
  11823. A_UINT32 deliver_flush_oob;
  11824. /* MPDUs dropped due to PN check fail */
  11825. A_UINT32 pn_fail;
  11826. /* MPDUs dropped due to unable to allocate memory */
  11827. A_UINT32 store_fail;
  11828. /* Number of times the tid pool alloc succeeded */
  11829. A_UINT32 tid_pool_alloc_succ;
  11830. /* Number of times the MPDU pool alloc succeeded */
  11831. A_UINT32 mpdu_pool_alloc_succ;
  11832. /* Number of times the MSDU pool alloc succeeded */
  11833. A_UINT32 msdu_pool_alloc_succ;
  11834. /* Number of times the tid pool alloc failed */
  11835. A_UINT32 tid_pool_alloc_fail;
  11836. /* Number of times the MPDU pool alloc failed */
  11837. A_UINT32 mpdu_pool_alloc_fail;
  11838. /* Number of times the MSDU pool alloc failed */
  11839. A_UINT32 msdu_pool_alloc_fail;
  11840. /* Number of times the tid pool freed */
  11841. A_UINT32 tid_pool_free;
  11842. /* Number of times the MPDU pool freed */
  11843. A_UINT32 mpdu_pool_free;
  11844. /* Number of times the MSDU pool freed */
  11845. A_UINT32 msdu_pool_free;
  11846. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11847. A_UINT32 msdu_queued;
  11848. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11849. A_UINT32 msdu_recycled;
  11850. /* Number of MPDUs with invalid peer but A2 found in AST */
  11851. A_UINT32 invalid_peer_a2_in_ast;
  11852. /* Number of MPDUs with invalid peer but A3 found in AST */
  11853. A_UINT32 invalid_peer_a3_in_ast;
  11854. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11855. A_UINT32 invalid_peer_bmc_mpdus;
  11856. /* Number of MSDUs with err attention word */
  11857. A_UINT32 rxdesc_err_att;
  11858. /* Number of MSDUs with flag of peer_idx_invalid */
  11859. A_UINT32 rxdesc_err_peer_idx_inv;
  11860. /* Number of MSDUs with flag of peer_idx_timeout */
  11861. A_UINT32 rxdesc_err_peer_idx_to;
  11862. /* Number of MSDUs with flag of overflow */
  11863. A_UINT32 rxdesc_err_ov;
  11864. /* Number of MSDUs with flag of msdu_length_err */
  11865. A_UINT32 rxdesc_err_msdu_len;
  11866. /* Number of MSDUs with flag of mpdu_length_err */
  11867. A_UINT32 rxdesc_err_mpdu_len;
  11868. /* Number of MSDUs with flag of tkip_mic_err */
  11869. A_UINT32 rxdesc_err_tkip_mic;
  11870. /* Number of MSDUs with flag of decrypt_err */
  11871. A_UINT32 rxdesc_err_decrypt;
  11872. /* Number of MSDUs with flag of fcs_err */
  11873. A_UINT32 rxdesc_err_fcs;
  11874. /* Number of Unicast (bc_mc bit is not set in attention word)
  11875. * frames with invalid peer handler
  11876. */
  11877. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11878. /* Number of unicast frame directly (direct bit is set in attention word)
  11879. * to DUT with invalid peer handler
  11880. */
  11881. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11882. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11883. * frames with invalid peer handler
  11884. */
  11885. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11886. /* Number of MSDUs dropped due to no first MSDU flag */
  11887. A_UINT32 rxdesc_no_1st_msdu;
  11888. /* Number of MSDUs droped due to ring overflow */
  11889. A_UINT32 msdu_drop_ring_ov;
  11890. /* Number of MSDUs dropped due to FC mismatch */
  11891. A_UINT32 msdu_drop_fc_mismatch;
  11892. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11893. A_UINT32 msdu_drop_mgmt_remote_ring;
  11894. /* Number of MSDUs dropped due to errors not reported in attention word */
  11895. A_UINT32 msdu_drop_misc;
  11896. /* Number of MSDUs go to offload before reorder */
  11897. A_UINT32 offload_msdu_wal;
  11898. /* Number of data frame dropped by offload after reorder */
  11899. A_UINT32 offload_msdu_reorder;
  11900. /* Number of MPDUs with sequence number in the past and within the BA window */
  11901. A_UINT32 dup_past_within_window;
  11902. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11903. A_UINT32 dup_past_outside_window;
  11904. /* Number of MSDUs with decrypt/MIC error */
  11905. A_UINT32 rxdesc_err_decrypt_mic;
  11906. /* Number of data MSDUs received on both local and remote rings */
  11907. A_UINT32 data_msdus_on_both_rings;
  11908. /* MPDUs never filled */
  11909. A_UINT32 holes_not_filled;
  11910. };
  11911. /*
  11912. * Rx Remote buffer statistics
  11913. * NB: all the fields must be defined in 4 octets size.
  11914. */
  11915. struct rx_remote_buffer_mgmt_stats {
  11916. /* Total number of MSDUs reaped for Rx processing */
  11917. A_UINT32 remote_reaped;
  11918. /* MSDUs recycled within firmware */
  11919. A_UINT32 remote_recycled;
  11920. /* MSDUs stored by Data Rx */
  11921. A_UINT32 data_rx_msdus_stored;
  11922. /* Number of HTT indications from WAL Rx MSDU */
  11923. A_UINT32 wal_rx_ind;
  11924. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11925. A_UINT32 wal_rx_ind_unconsumed;
  11926. /* Number of HTT indications from Data Rx MSDU */
  11927. A_UINT32 data_rx_ind;
  11928. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11929. A_UINT32 data_rx_ind_unconsumed;
  11930. /* Number of HTT indications from ATHBUF */
  11931. A_UINT32 athbuf_rx_ind;
  11932. /* Number of remote buffers requested for refill */
  11933. A_UINT32 refill_buf_req;
  11934. /* Number of remote buffers filled by the host */
  11935. A_UINT32 refill_buf_rsp;
  11936. /* Number of times MAC hw_index = f/w write_index */
  11937. A_INT32 mac_no_bufs;
  11938. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11939. A_INT32 fw_indices_equal;
  11940. /* Number of times f/w finds no buffers to post */
  11941. A_INT32 host_no_bufs;
  11942. };
  11943. /*
  11944. * TXBF MU/SU packets and NDPA statistics
  11945. * NB: all the fields must be defined in 4 octets size.
  11946. */
  11947. struct rx_txbf_musu_ndpa_pkts_stats {
  11948. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11949. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11950. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11951. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11952. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11953. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11954. };
  11955. /*
  11956. * htt_dbg_stats_status -
  11957. * present - The requested stats have been delivered in full.
  11958. * This indicates that either the stats information was contained
  11959. * in its entirety within this message, or else this message
  11960. * completes the delivery of the requested stats info that was
  11961. * partially delivered through earlier STATS_CONF messages.
  11962. * partial - The requested stats have been delivered in part.
  11963. * One or more subsequent STATS_CONF messages with the same
  11964. * cookie value will be sent to deliver the remainder of the
  11965. * information.
  11966. * error - The requested stats could not be delivered, for example due
  11967. * to a shortage of memory to construct a message holding the
  11968. * requested stats.
  11969. * invalid - The requested stat type is either not recognized, or the
  11970. * target is configured to not gather the stats type in question.
  11971. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11972. * series_done - This special value indicates that no further stats info
  11973. * elements are present within a series of stats info elems
  11974. * (within a stats upload confirmation message).
  11975. */
  11976. enum htt_dbg_stats_status {
  11977. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11978. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11979. HTT_DBG_STATS_STATUS_ERROR = 2,
  11980. HTT_DBG_STATS_STATUS_INVALID = 3,
  11981. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11982. };
  11983. /**
  11984. * @brief target -> host statistics upload
  11985. *
  11986. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11987. *
  11988. * @details
  11989. * The following field definitions describe the format of the HTT target
  11990. * to host stats upload confirmation message.
  11991. * The message contains a cookie echoed from the HTT host->target stats
  11992. * upload request, which identifies which request the confirmation is
  11993. * for, and a series of tag-length-value stats information elements.
  11994. * The tag-length header for each stats info element also includes a
  11995. * status field, to indicate whether the request for the stat type in
  11996. * question was fully met, partially met, unable to be met, or invalid
  11997. * (if the stat type in question is disabled in the target).
  11998. * A special value of all 1's in this status field is used to indicate
  11999. * the end of the series of stats info elements.
  12000. *
  12001. *
  12002. * |31 16|15 8|7 5|4 0|
  12003. * |------------------------------------------------------------|
  12004. * | reserved | msg type |
  12005. * |------------------------------------------------------------|
  12006. * | cookie LSBs |
  12007. * |------------------------------------------------------------|
  12008. * | cookie MSBs |
  12009. * |------------------------------------------------------------|
  12010. * | stats entry length | reserved | S |stat type|
  12011. * |------------------------------------------------------------|
  12012. * | |
  12013. * | type-specific stats info |
  12014. * | |
  12015. * |------------------------------------------------------------|
  12016. * | stats entry length | reserved | S |stat type|
  12017. * |------------------------------------------------------------|
  12018. * | |
  12019. * | type-specific stats info |
  12020. * | |
  12021. * |------------------------------------------------------------|
  12022. * | n/a | reserved | 111 | n/a |
  12023. * |------------------------------------------------------------|
  12024. * Header fields:
  12025. * - MSG_TYPE
  12026. * Bits 7:0
  12027. * Purpose: identifies this is a statistics upload confirmation message
  12028. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12029. * - COOKIE_LSBS
  12030. * Bits 31:0
  12031. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12032. * message with its preceding host->target stats request message.
  12033. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12034. * - COOKIE_MSBS
  12035. * Bits 31:0
  12036. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12037. * message with its preceding host->target stats request message.
  12038. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12039. *
  12040. * Stats Information Element tag-length header fields:
  12041. * - STAT_TYPE
  12042. * Bits 4:0
  12043. * Purpose: identifies the type of statistics info held in the
  12044. * following information element
  12045. * Value: htt_dbg_stats_type
  12046. * - STATUS
  12047. * Bits 7:5
  12048. * Purpose: indicate whether the requested stats are present
  12049. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12050. * the completion of the stats entry series
  12051. * - LENGTH
  12052. * Bits 31:16
  12053. * Purpose: indicate the stats information size
  12054. * Value: This field specifies the number of bytes of stats information
  12055. * that follows the element tag-length header.
  12056. * It is expected but not required that this length is a multiple of
  12057. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12058. * subsequent stats entry header will begin on a 4-byte aligned
  12059. * boundary.
  12060. */
  12061. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12062. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12063. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12064. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12065. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12066. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12067. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12068. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12069. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12070. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12071. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12074. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12075. } while (0)
  12076. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12077. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12078. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12079. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12082. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12083. } while (0)
  12084. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12085. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12086. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12087. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12088. do { \
  12089. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12090. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12091. } while (0)
  12092. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12093. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12094. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12095. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12096. #define HTT_MAX_AGGR 64
  12097. #define HTT_HL_MAX_AGGR 18
  12098. /**
  12099. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12100. *
  12101. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12102. *
  12103. * @details
  12104. * The following field definitions describe the format of the HTT host
  12105. * to target frag_desc/msdu_ext bank configuration message.
  12106. * The message contains the based address and the min and max id of the
  12107. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12108. * MSDU_EXT/FRAG_DESC.
  12109. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12110. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12111. * the hardware does the mapping/translation.
  12112. *
  12113. * Total banks that can be configured is configured to 16.
  12114. *
  12115. * This should be called before any TX has be initiated by the HTT
  12116. *
  12117. * |31 16|15 8|7 5|4 0|
  12118. * |------------------------------------------------------------|
  12119. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12120. * |------------------------------------------------------------|
  12121. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12122. #if HTT_PADDR64
  12123. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12124. #endif
  12125. * |------------------------------------------------------------|
  12126. * | ... |
  12127. * |------------------------------------------------------------|
  12128. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12129. #if HTT_PADDR64
  12130. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12131. #endif
  12132. * |------------------------------------------------------------|
  12133. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12134. * |------------------------------------------------------------|
  12135. * | ... |
  12136. * |------------------------------------------------------------|
  12137. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12138. * |------------------------------------------------------------|
  12139. * Header fields:
  12140. * - MSG_TYPE
  12141. * Bits 7:0
  12142. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12143. * for systems with 64-bit format for bus addresses:
  12144. * - BANKx_BASE_ADDRESS_LO
  12145. * Bits 31:0
  12146. * Purpose: Provide a mechanism to specify the base address of the
  12147. * MSDU_EXT bank physical/bus address.
  12148. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12149. * - BANKx_BASE_ADDRESS_HI
  12150. * Bits 31:0
  12151. * Purpose: Provide a mechanism to specify the base address of the
  12152. * MSDU_EXT bank physical/bus address.
  12153. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12154. * for systems with 32-bit format for bus addresses:
  12155. * - BANKx_BASE_ADDRESS
  12156. * Bits 31:0
  12157. * Purpose: Provide a mechanism to specify the base address of the
  12158. * MSDU_EXT bank physical/bus address.
  12159. * Value: MSDU_EXT bank physical / bus address
  12160. * - BANKx_MIN_ID
  12161. * Bits 15:0
  12162. * Purpose: Provide a mechanism to specify the min index that needs to
  12163. * mapped.
  12164. * - BANKx_MAX_ID
  12165. * Bits 31:16
  12166. * Purpose: Provide a mechanism to specify the max index that needs to
  12167. * mapped.
  12168. *
  12169. */
  12170. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12171. * safe value.
  12172. * @note MAX supported banks is 16.
  12173. */
  12174. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12175. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12176. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12177. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12178. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12179. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12180. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12181. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12182. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12183. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12184. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12185. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12186. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12187. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12188. do { \
  12189. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12190. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12191. } while (0)
  12192. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12193. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12194. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12195. do { \
  12196. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12197. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12198. } while (0)
  12199. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12200. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12201. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12202. do { \
  12203. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12204. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12205. } while (0)
  12206. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12207. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12208. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12209. do { \
  12210. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12211. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12212. } while (0)
  12213. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12214. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12215. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12216. do { \
  12217. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12218. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12219. } while (0)
  12220. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12221. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12222. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12223. do { \
  12224. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12225. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12226. } while (0)
  12227. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12228. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12229. /*
  12230. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12231. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12232. * addresses are stored in a XXX-bit field.
  12233. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12234. * htt_tx_frag_desc64_bank_cfg_t structs.
  12235. */
  12236. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12237. _paddr_bits_, \
  12238. _paddr__bank_base_address_) \
  12239. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12240. /** word 0 \
  12241. * msg_type: 8, \
  12242. * pdev_id: 2, \
  12243. * swap: 1, \
  12244. * reserved0: 5, \
  12245. * num_banks: 8, \
  12246. * desc_size: 8; \
  12247. */ \
  12248. A_UINT32 word0; \
  12249. /* \
  12250. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12251. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12252. * the second A_UINT32). \
  12253. */ \
  12254. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12255. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12256. } POSTPACK
  12257. /* define htt_tx_frag_desc32_bank_cfg_t */
  12258. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12259. /* define htt_tx_frag_desc64_bank_cfg_t */
  12260. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12261. /*
  12262. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12263. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12264. */
  12265. #if HTT_PADDR64
  12266. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12267. #else
  12268. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12269. #endif
  12270. /**
  12271. * @brief target -> host HTT TX Credit total count update message definition
  12272. *
  12273. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12274. *
  12275. *|31 16|15|14 9| 8 |7 0 |
  12276. *|---------------------+--+----------+-------+----------|
  12277. *|cur htt credit delta | Q| reserved | sign | msg type |
  12278. *|------------------------------------------------------|
  12279. *
  12280. * Header fields:
  12281. * - MSG_TYPE
  12282. * Bits 7:0
  12283. * Purpose: identifies this as a htt tx credit delta update message
  12284. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12285. * - SIGN
  12286. * Bits 8
  12287. * identifies whether credit delta is positive or negative
  12288. * Value:
  12289. * - 0x0: credit delta is positive, rebalance in some buffers
  12290. * - 0x1: credit delta is negative, rebalance out some buffers
  12291. * - reserved
  12292. * Bits 14:9
  12293. * Value: 0x0
  12294. * - TXQ_GRP
  12295. * Bit 15
  12296. * Purpose: indicates whether any tx queue group information elements
  12297. * are appended to the tx credit update message
  12298. * Value: 0 -> no tx queue group information element is present
  12299. * 1 -> a tx queue group information element immediately follows
  12300. * - DELTA_COUNT
  12301. * Bits 31:16
  12302. * Purpose: Specify current htt credit delta absolute count
  12303. */
  12304. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12305. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12306. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12307. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12308. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12309. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12310. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12311. do { \
  12312. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12313. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12314. } while (0)
  12315. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12316. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12317. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12318. do { \
  12319. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12320. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12321. } while (0)
  12322. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12323. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12324. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12325. do { \
  12326. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12327. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12328. } while (0)
  12329. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12330. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12331. #define HTT_TX_CREDIT_MSG_BYTES 4
  12332. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12333. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12334. /**
  12335. * @brief HTT WDI_IPA Operation Response Message
  12336. *
  12337. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12338. *
  12339. * @details
  12340. * HTT WDI_IPA Operation Response message is sent by target
  12341. * to host confirming suspend or resume operation.
  12342. * |31 24|23 16|15 8|7 0|
  12343. * |----------------+----------------+----------------+----------------|
  12344. * | op_code | Rsvd | msg_type |
  12345. * |-------------------------------------------------------------------|
  12346. * | Rsvd | Response len |
  12347. * |-------------------------------------------------------------------|
  12348. * | |
  12349. * | Response-type specific info |
  12350. * | |
  12351. * | |
  12352. * |-------------------------------------------------------------------|
  12353. * Header fields:
  12354. * - MSG_TYPE
  12355. * Bits 7:0
  12356. * Purpose: Identifies this as WDI_IPA Operation Response message
  12357. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12358. * - OP_CODE
  12359. * Bits 31:16
  12360. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12361. * value: = enum htt_wdi_ipa_op_code
  12362. * - RSP_LEN
  12363. * Bits 16:0
  12364. * Purpose: length for the response-type specific info
  12365. * value: = length in bytes for response-type specific info
  12366. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12367. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12368. */
  12369. PREPACK struct htt_wdi_ipa_op_response_t
  12370. {
  12371. /* DWORD 0: flags and meta-data */
  12372. A_UINT32
  12373. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12374. reserved1: 8,
  12375. op_code: 16;
  12376. A_UINT32
  12377. rsp_len: 16,
  12378. reserved2: 16;
  12379. } POSTPACK;
  12380. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12381. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12382. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12383. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12384. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12385. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12386. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12387. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12388. do { \
  12389. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12390. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12391. } while (0)
  12392. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12393. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12394. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12395. do { \
  12396. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12397. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12398. } while (0)
  12399. enum htt_phy_mode {
  12400. htt_phy_mode_11a = 0,
  12401. htt_phy_mode_11g = 1,
  12402. htt_phy_mode_11b = 2,
  12403. htt_phy_mode_11g_only = 3,
  12404. htt_phy_mode_11na_ht20 = 4,
  12405. htt_phy_mode_11ng_ht20 = 5,
  12406. htt_phy_mode_11na_ht40 = 6,
  12407. htt_phy_mode_11ng_ht40 = 7,
  12408. htt_phy_mode_11ac_vht20 = 8,
  12409. htt_phy_mode_11ac_vht40 = 9,
  12410. htt_phy_mode_11ac_vht80 = 10,
  12411. htt_phy_mode_11ac_vht20_2g = 11,
  12412. htt_phy_mode_11ac_vht40_2g = 12,
  12413. htt_phy_mode_11ac_vht80_2g = 13,
  12414. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12415. htt_phy_mode_11ac_vht160 = 15,
  12416. htt_phy_mode_max,
  12417. };
  12418. /**
  12419. * @brief target -> host HTT channel change indication
  12420. *
  12421. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12422. *
  12423. * @details
  12424. * Specify when a channel change occurs.
  12425. * This allows the host to precisely determine which rx frames arrived
  12426. * on the old channel and which rx frames arrived on the new channel.
  12427. *
  12428. *|31 |7 0 |
  12429. *|-------------------------------------------+----------|
  12430. *| reserved | msg type |
  12431. *|------------------------------------------------------|
  12432. *| primary_chan_center_freq_mhz |
  12433. *|------------------------------------------------------|
  12434. *| contiguous_chan1_center_freq_mhz |
  12435. *|------------------------------------------------------|
  12436. *| contiguous_chan2_center_freq_mhz |
  12437. *|------------------------------------------------------|
  12438. *| phy_mode |
  12439. *|------------------------------------------------------|
  12440. *
  12441. * Header fields:
  12442. * - MSG_TYPE
  12443. * Bits 7:0
  12444. * Purpose: identifies this as a htt channel change indication message
  12445. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12446. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12447. * Bits 31:0
  12448. * Purpose: identify the (center of the) new 20 MHz primary channel
  12449. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12450. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12451. * Bits 31:0
  12452. * Purpose: identify the (center of the) contiguous frequency range
  12453. * comprising the new channel.
  12454. * For example, if the new channel is a 80 MHz channel extending
  12455. * 60 MHz beyond the primary channel, this field would be 30 larger
  12456. * than the primary channel center frequency field.
  12457. * Value: center frequency of the contiguous frequency range comprising
  12458. * the full channel in MHz units
  12459. * (80+80 channels also use the CONTIG_CHAN2 field)
  12460. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12461. * Bits 31:0
  12462. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12463. * within a VHT 80+80 channel.
  12464. * This field is only relevant for VHT 80+80 channels.
  12465. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12466. * channel (arbitrary value for cases besides VHT 80+80)
  12467. * - PHY_MODE
  12468. * Bits 31:0
  12469. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12470. * and band
  12471. * Value: htt_phy_mode enum value
  12472. */
  12473. PREPACK struct htt_chan_change_t
  12474. {
  12475. /* DWORD 0: flags and meta-data */
  12476. A_UINT32
  12477. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12478. reserved1: 24;
  12479. A_UINT32 primary_chan_center_freq_mhz;
  12480. A_UINT32 contig_chan1_center_freq_mhz;
  12481. A_UINT32 contig_chan2_center_freq_mhz;
  12482. A_UINT32 phy_mode;
  12483. } POSTPACK;
  12484. /*
  12485. * Due to historical / backwards-compatibility reasons, maintain the
  12486. * below htt_chan_change_msg struct definition, which needs to be
  12487. * consistent with the above htt_chan_change_t struct definition
  12488. * (aside from the htt_chan_change_t definition including the msg_type
  12489. * dword within the message, and the htt_chan_change_msg only containing
  12490. * the payload of the message that follows the msg_type dword).
  12491. */
  12492. PREPACK struct htt_chan_change_msg {
  12493. A_UINT32 chan_mhz; /* frequency in mhz */
  12494. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12495. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12496. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12497. } POSTPACK;
  12498. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12499. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12500. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12501. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12502. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12503. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12504. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12505. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12506. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12507. do { \
  12508. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12509. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12510. } while (0)
  12511. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12512. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12513. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12514. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12515. do { \
  12516. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12517. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12518. } while (0)
  12519. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12520. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12521. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12522. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12523. do { \
  12524. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12525. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12526. } while (0)
  12527. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12528. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12529. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12530. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12531. do { \
  12532. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12533. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12534. } while (0)
  12535. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12536. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12537. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12538. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12539. /**
  12540. * @brief rx offload packet error message
  12541. *
  12542. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12543. *
  12544. * @details
  12545. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12546. * of target payload like mic err.
  12547. *
  12548. * |31 24|23 16|15 8|7 0|
  12549. * |----------------+----------------+----------------+----------------|
  12550. * | tid | vdev_id | msg_sub_type | msg_type |
  12551. * |-------------------------------------------------------------------|
  12552. * : (sub-type dependent content) :
  12553. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12554. * Header fields:
  12555. * - msg_type
  12556. * Bits 7:0
  12557. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12558. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12559. * - msg_sub_type
  12560. * Bits 15:8
  12561. * Purpose: Identifies which type of rx error is reported by this message
  12562. * value: htt_rx_ofld_pkt_err_type
  12563. * - vdev_id
  12564. * Bits 23:16
  12565. * Purpose: Identifies which vdev received the erroneous rx frame
  12566. * value:
  12567. * - tid
  12568. * Bits 31:24
  12569. * Purpose: Identifies the traffic type of the rx frame
  12570. * value:
  12571. *
  12572. * - The payload fields used if the sub-type == MIC error are shown below.
  12573. * Note - MIC err is per MSDU, while PN is per MPDU.
  12574. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12575. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12576. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12577. * instead of sending separate HTT messages for each wrong MSDU within
  12578. * the MPDU.
  12579. *
  12580. * |31 24|23 16|15 8|7 0|
  12581. * |----------------+----------------+----------------+----------------|
  12582. * | Rsvd | key_id | peer_id |
  12583. * |-------------------------------------------------------------------|
  12584. * | receiver MAC addr 31:0 |
  12585. * |-------------------------------------------------------------------|
  12586. * | Rsvd | receiver MAC addr 47:32 |
  12587. * |-------------------------------------------------------------------|
  12588. * | transmitter MAC addr 31:0 |
  12589. * |-------------------------------------------------------------------|
  12590. * | Rsvd | transmitter MAC addr 47:32 |
  12591. * |-------------------------------------------------------------------|
  12592. * | PN 31:0 |
  12593. * |-------------------------------------------------------------------|
  12594. * | Rsvd | PN 47:32 |
  12595. * |-------------------------------------------------------------------|
  12596. * - peer_id
  12597. * Bits 15:0
  12598. * Purpose: identifies which peer is frame is from
  12599. * value:
  12600. * - key_id
  12601. * Bits 23:16
  12602. * Purpose: identifies key_id of rx frame
  12603. * value:
  12604. * - RA_31_0 (receiver MAC addr 31:0)
  12605. * Bits 31:0
  12606. * Purpose: identifies by MAC address which vdev received the frame
  12607. * value: MAC address lower 4 bytes
  12608. * - RA_47_32 (receiver MAC addr 47:32)
  12609. * Bits 15:0
  12610. * Purpose: identifies by MAC address which vdev received the frame
  12611. * value: MAC address upper 2 bytes
  12612. * - TA_31_0 (transmitter MAC addr 31:0)
  12613. * Bits 31:0
  12614. * Purpose: identifies by MAC address which peer transmitted the frame
  12615. * value: MAC address lower 4 bytes
  12616. * - TA_47_32 (transmitter MAC addr 47:32)
  12617. * Bits 15:0
  12618. * Purpose: identifies by MAC address which peer transmitted the frame
  12619. * value: MAC address upper 2 bytes
  12620. * - PN_31_0
  12621. * Bits 31:0
  12622. * Purpose: Identifies pn of rx frame
  12623. * value: PN lower 4 bytes
  12624. * - PN_47_32
  12625. * Bits 15:0
  12626. * Purpose: Identifies pn of rx frame
  12627. * value:
  12628. * TKIP or CCMP: PN upper 2 bytes
  12629. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12630. */
  12631. enum htt_rx_ofld_pkt_err_type {
  12632. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12633. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12634. };
  12635. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12636. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12637. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12638. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12639. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12640. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12641. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12642. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12643. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12644. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12645. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12646. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12647. do { \
  12648. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12649. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12650. } while (0)
  12651. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12652. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12653. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12654. do { \
  12655. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12656. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12657. } while (0)
  12658. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12659. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12660. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12661. do { \
  12662. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12663. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12664. } while (0)
  12665. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12673. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12674. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12675. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12676. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12679. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12682. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12684. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12685. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12687. do { \
  12688. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12689. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12690. } while (0)
  12691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12692. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12693. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12695. do { \
  12696. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12697. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12698. } while (0)
  12699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12700. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12701. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12703. do { \
  12704. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12705. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12706. } while (0)
  12707. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12708. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12709. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12711. do { \
  12712. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12713. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12714. } while (0)
  12715. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12716. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12717. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12719. do { \
  12720. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12721. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12722. } while (0)
  12723. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12724. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12725. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12727. do { \
  12728. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12729. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12730. } while (0)
  12731. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12732. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12733. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12734. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12735. do { \
  12736. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12737. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12738. } while (0)
  12739. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12740. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12741. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12742. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12743. do { \
  12744. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12745. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12746. } while (0)
  12747. /**
  12748. * @brief target -> host peer rate report message
  12749. *
  12750. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12751. *
  12752. * @details
  12753. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12754. * justified rate of all the peers.
  12755. *
  12756. * |31 24|23 16|15 8|7 0|
  12757. * |----------------+----------------+----------------+----------------|
  12758. * | peer_count | | msg_type |
  12759. * |-------------------------------------------------------------------|
  12760. * : Payload (variant number of peer rate report) :
  12761. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12762. * Header fields:
  12763. * - msg_type
  12764. * Bits 7:0
  12765. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12766. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12767. * - reserved
  12768. * Bits 15:8
  12769. * Purpose:
  12770. * value:
  12771. * - peer_count
  12772. * Bits 31:16
  12773. * Purpose: Specify how many peer rate report elements are present in the payload.
  12774. * value:
  12775. *
  12776. * Payload:
  12777. * There are variant number of peer rate report follow the first 32 bits.
  12778. * The peer rate report is defined as follows.
  12779. *
  12780. * |31 20|19 16|15 0|
  12781. * |-----------------------+---------+---------------------------------|-
  12782. * | reserved | phy | peer_id | \
  12783. * |-------------------------------------------------------------------| -> report #0
  12784. * | rate | /
  12785. * |-----------------------+---------+---------------------------------|-
  12786. * | reserved | phy | peer_id | \
  12787. * |-------------------------------------------------------------------| -> report #1
  12788. * | rate | /
  12789. * |-----------------------+---------+---------------------------------|-
  12790. * | reserved | phy | peer_id | \
  12791. * |-------------------------------------------------------------------| -> report #2
  12792. * | rate | /
  12793. * |-------------------------------------------------------------------|-
  12794. * : :
  12795. * : :
  12796. * : :
  12797. * :-------------------------------------------------------------------:
  12798. *
  12799. * - peer_id
  12800. * Bits 15:0
  12801. * Purpose: identify the peer
  12802. * value:
  12803. * - phy
  12804. * Bits 19:16
  12805. * Purpose: identify which phy is in use
  12806. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12807. * Please see enum htt_peer_report_phy_type for detail.
  12808. * - reserved
  12809. * Bits 31:20
  12810. * Purpose:
  12811. * value:
  12812. * - rate
  12813. * Bits 31:0
  12814. * Purpose: represent the justified rate of the peer specified by peer_id
  12815. * value:
  12816. */
  12817. enum htt_peer_rate_report_phy_type {
  12818. HTT_PEER_RATE_REPORT_11B = 0,
  12819. HTT_PEER_RATE_REPORT_11A_G,
  12820. HTT_PEER_RATE_REPORT_11N,
  12821. HTT_PEER_RATE_REPORT_11AC,
  12822. };
  12823. #define HTT_PEER_RATE_REPORT_SIZE 8
  12824. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12825. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12826. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12827. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12828. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12829. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12830. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12831. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12832. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12833. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12834. do { \
  12835. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12836. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12837. } while (0)
  12838. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12839. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12840. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12841. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12842. do { \
  12843. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12844. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12845. } while (0)
  12846. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12847. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12848. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12849. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12850. do { \
  12851. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12852. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12853. } while (0)
  12854. /**
  12855. * @brief target -> host flow pool map message
  12856. *
  12857. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12858. *
  12859. * @details
  12860. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12861. * a flow of descriptors.
  12862. *
  12863. * This message is in TLV format and indicates the parameters to be setup a
  12864. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12865. * receive descriptors from a specified pool.
  12866. *
  12867. * The message would appear as follows:
  12868. *
  12869. * |31 24|23 16|15 8|7 0|
  12870. * |----------------+----------------+----------------+----------------|
  12871. * header | reserved | num_flows | msg_type |
  12872. * |-------------------------------------------------------------------|
  12873. * | |
  12874. * : payload :
  12875. * | |
  12876. * |-------------------------------------------------------------------|
  12877. *
  12878. * The header field is one DWORD long and is interpreted as follows:
  12879. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12880. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12881. * this message
  12882. * b'16-31 - reserved: These bits are reserved for future use
  12883. *
  12884. * Payload:
  12885. * The payload would contain multiple objects of the following structure. Each
  12886. * object represents a flow.
  12887. *
  12888. * |31 24|23 16|15 8|7 0|
  12889. * |----------------+----------------+----------------+----------------|
  12890. * header | reserved | num_flows | msg_type |
  12891. * |-------------------------------------------------------------------|
  12892. * payload0| flow_type |
  12893. * |-------------------------------------------------------------------|
  12894. * | flow_id |
  12895. * |-------------------------------------------------------------------|
  12896. * | reserved0 | flow_pool_id |
  12897. * |-------------------------------------------------------------------|
  12898. * | reserved1 | flow_pool_size |
  12899. * |-------------------------------------------------------------------|
  12900. * | reserved2 |
  12901. * |-------------------------------------------------------------------|
  12902. * payload1| flow_type |
  12903. * |-------------------------------------------------------------------|
  12904. * | flow_id |
  12905. * |-------------------------------------------------------------------|
  12906. * | reserved0 | flow_pool_id |
  12907. * |-------------------------------------------------------------------|
  12908. * | reserved1 | flow_pool_size |
  12909. * |-------------------------------------------------------------------|
  12910. * | reserved2 |
  12911. * |-------------------------------------------------------------------|
  12912. * | . |
  12913. * | . |
  12914. * | . |
  12915. * |-------------------------------------------------------------------|
  12916. *
  12917. * Each payload is 5 DWORDS long and is interpreted as follows:
  12918. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12919. * this flow is associated. It can be VDEV, peer,
  12920. * or tid (AC). Based on enum htt_flow_type.
  12921. *
  12922. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12923. * object. For flow_type vdev it is set to the
  12924. * vdevid, for peer it is peerid and for tid, it is
  12925. * tid_num.
  12926. *
  12927. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12928. * in the host for this flow
  12929. * b'16:31 - reserved0: This field in reserved for the future. In case
  12930. * we have a hierarchical implementation (HCM) of
  12931. * pools, it can be used to indicate the ID of the
  12932. * parent-pool.
  12933. *
  12934. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12935. * Descriptors for this flow will be
  12936. * allocated from this pool in the host.
  12937. * b'16:31 - reserved1: This field in reserved for the future. In case
  12938. * we have a hierarchical implementation of pools,
  12939. * it can be used to indicate the max number of
  12940. * descriptors in the pool. The b'0:15 can be used
  12941. * to indicate min number of descriptors in the
  12942. * HCM scheme.
  12943. *
  12944. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12945. * we have a hierarchical implementation of pools,
  12946. * b'0:15 can be used to indicate the
  12947. * priority-based borrowing (PBB) threshold of
  12948. * the flow's pool. The b'16:31 are still left
  12949. * reserved.
  12950. */
  12951. enum htt_flow_type {
  12952. FLOW_TYPE_VDEV = 0,
  12953. /* Insert new flow types above this line */
  12954. };
  12955. PREPACK struct htt_flow_pool_map_payload_t {
  12956. A_UINT32 flow_type;
  12957. A_UINT32 flow_id;
  12958. A_UINT32 flow_pool_id:16,
  12959. reserved0:16;
  12960. A_UINT32 flow_pool_size:16,
  12961. reserved1:16;
  12962. A_UINT32 reserved2;
  12963. } POSTPACK;
  12964. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12965. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12966. (sizeof(struct htt_flow_pool_map_payload_t))
  12967. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12968. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12969. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12970. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12971. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12972. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12973. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12974. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12975. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12976. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12977. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12978. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12979. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12980. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12981. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12982. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12983. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12984. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12985. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12986. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12987. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12988. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12989. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12990. do { \
  12991. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12992. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12993. } while (0)
  12994. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12995. do { \
  12996. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12997. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12998. } while (0)
  12999. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13000. do { \
  13001. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13002. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13003. } while (0)
  13004. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13005. do { \
  13006. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13007. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13008. } while (0)
  13009. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13010. do { \
  13011. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13012. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13013. } while (0)
  13014. /**
  13015. * @brief target -> host flow pool unmap message
  13016. *
  13017. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13018. *
  13019. * @details
  13020. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13021. * down a flow of descriptors.
  13022. * This message indicates that for the flow (whose ID is provided) is wanting
  13023. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13024. * pool of descriptors from where descriptors are being allocated for this
  13025. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13026. * be unmapped by the host.
  13027. *
  13028. * The message would appear as follows:
  13029. *
  13030. * |31 24|23 16|15 8|7 0|
  13031. * |----------------+----------------+----------------+----------------|
  13032. * | reserved0 | msg_type |
  13033. * |-------------------------------------------------------------------|
  13034. * | flow_type |
  13035. * |-------------------------------------------------------------------|
  13036. * | flow_id |
  13037. * |-------------------------------------------------------------------|
  13038. * | reserved1 | flow_pool_id |
  13039. * |-------------------------------------------------------------------|
  13040. *
  13041. * The message is interpreted as follows:
  13042. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13043. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13044. * b'8:31 - reserved0: Reserved for future use
  13045. *
  13046. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13047. * this flow is associated. It can be VDEV, peer,
  13048. * or tid (AC). Based on enum htt_flow_type.
  13049. *
  13050. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13051. * object. For flow_type vdev it is set to the
  13052. * vdevid, for peer it is peerid and for tid, it is
  13053. * tid_num.
  13054. *
  13055. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13056. * used in the host for this flow
  13057. * b'16:31 - reserved0: This field in reserved for the future.
  13058. *
  13059. */
  13060. PREPACK struct htt_flow_pool_unmap_t {
  13061. A_UINT32 msg_type:8,
  13062. reserved0:24;
  13063. A_UINT32 flow_type;
  13064. A_UINT32 flow_id;
  13065. A_UINT32 flow_pool_id:16,
  13066. reserved1:16;
  13067. } POSTPACK;
  13068. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13069. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13070. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13071. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13072. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13073. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13074. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13075. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13076. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13077. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13078. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13079. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13080. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13081. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13082. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13083. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13084. do { \
  13085. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13086. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13087. } while (0)
  13088. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13089. do { \
  13090. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13091. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13092. } while (0)
  13093. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13094. do { \
  13095. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13096. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13097. } while (0)
  13098. /**
  13099. * @brief target -> host SRING setup done message
  13100. *
  13101. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13102. *
  13103. * @details
  13104. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13105. * SRNG ring setup is done
  13106. *
  13107. * This message indicates whether the last setup operation is successful.
  13108. * It will be sent to host when host set respose_required bit in
  13109. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13110. * The message would appear as follows:
  13111. *
  13112. * |31 24|23 16|15 8|7 0|
  13113. * |--------------- +----------------+----------------+----------------|
  13114. * | setup_status | ring_id | pdev_id | msg_type |
  13115. * |-------------------------------------------------------------------|
  13116. *
  13117. * The message is interpreted as follows:
  13118. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13119. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13120. * b'8:15 - pdev_id:
  13121. * 0 (for rings at SOC/UMAC level),
  13122. * 1/2/3 mac id (for rings at LMAC level)
  13123. * b'16:23 - ring_id: Identify the ring which is set up
  13124. * More details can be got from enum htt_srng_ring_id
  13125. * b'24:31 - setup_status: Indicate status of setup operation
  13126. * Refer to htt_ring_setup_status
  13127. */
  13128. PREPACK struct htt_sring_setup_done_t {
  13129. A_UINT32 msg_type: 8,
  13130. pdev_id: 8,
  13131. ring_id: 8,
  13132. setup_status: 8;
  13133. } POSTPACK;
  13134. enum htt_ring_setup_status {
  13135. htt_ring_setup_status_ok = 0,
  13136. htt_ring_setup_status_error,
  13137. };
  13138. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13139. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13140. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13141. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13142. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13143. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13144. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13145. do { \
  13146. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13147. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13148. } while (0)
  13149. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13150. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13151. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13152. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13153. HTT_SRING_SETUP_DONE_RING_ID_S)
  13154. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13155. do { \
  13156. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13157. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13158. } while (0)
  13159. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13160. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13161. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13162. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13163. HTT_SRING_SETUP_DONE_STATUS_S)
  13164. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13165. do { \
  13166. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13167. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13168. } while (0)
  13169. /**
  13170. * @brief target -> flow map flow info
  13171. *
  13172. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13173. *
  13174. * @details
  13175. * HTT TX map flow entry with tqm flow pointer
  13176. * Sent from firmware to host to add tqm flow pointer in corresponding
  13177. * flow search entry. Flow metadata is replayed back to host as part of this
  13178. * struct to enable host to find the specific flow search entry
  13179. *
  13180. * The message would appear as follows:
  13181. *
  13182. * |31 28|27 18|17 14|13 8|7 0|
  13183. * |-------+------------------------------------------+----------------|
  13184. * | rsvd0 | fse_hsh_idx | msg_type |
  13185. * |-------------------------------------------------------------------|
  13186. * | rsvd1 | tid | peer_id |
  13187. * |-------------------------------------------------------------------|
  13188. * | tqm_flow_pntr_lo |
  13189. * |-------------------------------------------------------------------|
  13190. * | tqm_flow_pntr_hi |
  13191. * |-------------------------------------------------------------------|
  13192. * | fse_meta_data |
  13193. * |-------------------------------------------------------------------|
  13194. *
  13195. * The message is interpreted as follows:
  13196. *
  13197. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13198. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13199. *
  13200. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13201. * for this flow entry
  13202. *
  13203. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13204. *
  13205. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13206. *
  13207. * dword1 - b'14:17 - tid
  13208. *
  13209. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13210. *
  13211. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13212. *
  13213. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13214. *
  13215. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13216. * given by host
  13217. */
  13218. PREPACK struct htt_tx_map_flow_info {
  13219. A_UINT32
  13220. msg_type: 8,
  13221. fse_hsh_idx: 20,
  13222. rsvd0: 4;
  13223. A_UINT32
  13224. peer_id: 14,
  13225. tid: 4,
  13226. rsvd1: 14;
  13227. A_UINT32 tqm_flow_pntr_lo;
  13228. A_UINT32 tqm_flow_pntr_hi;
  13229. struct htt_tx_flow_metadata fse_meta_data;
  13230. } POSTPACK;
  13231. /* DWORD 0 */
  13232. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13233. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13234. /* DWORD 1 */
  13235. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13236. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13237. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13238. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13239. /* DWORD 0 */
  13240. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13241. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13242. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13243. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13244. do { \
  13245. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13246. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13247. } while (0)
  13248. /* DWORD 1 */
  13249. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13250. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13251. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13252. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13253. do { \
  13254. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13255. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13256. } while (0)
  13257. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13258. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13259. HTT_TX_MAP_FLOW_INFO_TID_S)
  13260. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13261. do { \
  13262. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13263. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13264. } while (0)
  13265. /*
  13266. * htt_dbg_ext_stats_status -
  13267. * present - The requested stats have been delivered in full.
  13268. * This indicates that either the stats information was contained
  13269. * in its entirety within this message, or else this message
  13270. * completes the delivery of the requested stats info that was
  13271. * partially delivered through earlier STATS_CONF messages.
  13272. * partial - The requested stats have been delivered in part.
  13273. * One or more subsequent STATS_CONF messages with the same
  13274. * cookie value will be sent to deliver the remainder of the
  13275. * information.
  13276. * error - The requested stats could not be delivered, for example due
  13277. * to a shortage of memory to construct a message holding the
  13278. * requested stats.
  13279. * invalid - The requested stat type is either not recognized, or the
  13280. * target is configured to not gather the stats type in question.
  13281. */
  13282. enum htt_dbg_ext_stats_status {
  13283. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13284. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13285. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13286. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13287. };
  13288. /**
  13289. * @brief target -> host ppdu stats upload
  13290. *
  13291. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13292. *
  13293. * @details
  13294. * The following field definitions describe the format of the HTT target
  13295. * to host ppdu stats indication message.
  13296. *
  13297. *
  13298. * |31 16|15 12|11 10|9 8|7 0 |
  13299. * |----------------------------------------------------------------------|
  13300. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13301. * |----------------------------------------------------------------------|
  13302. * | ppdu_id |
  13303. * |----------------------------------------------------------------------|
  13304. * | Timestamp in us |
  13305. * |----------------------------------------------------------------------|
  13306. * | reserved |
  13307. * |----------------------------------------------------------------------|
  13308. * | type-specific stats info |
  13309. * | (see htt_ppdu_stats.h) |
  13310. * |----------------------------------------------------------------------|
  13311. * Header fields:
  13312. * - MSG_TYPE
  13313. * Bits 7:0
  13314. * Purpose: Identifies this is a PPDU STATS indication
  13315. * message.
  13316. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13317. * - mac_id
  13318. * Bits 9:8
  13319. * Purpose: mac_id of this ppdu_id
  13320. * Value: 0-3
  13321. * - pdev_id
  13322. * Bits 11:10
  13323. * Purpose: pdev_id of this ppdu_id
  13324. * Value: 0-3
  13325. * 0 (for rings at SOC level),
  13326. * 1/2/3 PDEV -> 0/1/2
  13327. * - payload_size
  13328. * Bits 31:16
  13329. * Purpose: total tlv size
  13330. * Value: payload_size in bytes
  13331. */
  13332. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13333. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13334. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13335. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13336. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13337. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13338. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13339. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13340. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13341. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13342. do { \
  13343. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13344. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13345. } while (0)
  13346. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13347. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13348. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13349. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13350. do { \
  13351. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13352. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13353. } while (0)
  13354. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13355. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13356. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13357. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13358. do { \
  13359. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13360. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13361. } while (0)
  13362. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13363. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13364. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13365. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13366. do { \
  13367. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13368. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13369. } while (0)
  13370. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13371. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13372. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13373. /* htt_t2h_ppdu_stats_ind_hdr_t
  13374. * This struct contains the fields within the header of the
  13375. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13376. * stats info.
  13377. * This struct assumes little-endian layout, and thus is only
  13378. * suitable for use within processors known to be little-endian
  13379. * (such as the target).
  13380. * In contrast, the above macros provide endian-portable methods
  13381. * to get and set the bitfields within this PPDU_STATS_IND header.
  13382. */
  13383. typedef struct {
  13384. A_UINT32 msg_type: 8, /* bits 7:0 */
  13385. mac_id: 2, /* bits 9:8 */
  13386. pdev_id: 2, /* bits 11:10 */
  13387. reserved1: 4, /* bits 15:12 */
  13388. payload_size: 16; /* bits 31:16 */
  13389. A_UINT32 ppdu_id;
  13390. A_UINT32 timestamp_us;
  13391. A_UINT32 reserved2;
  13392. } htt_t2h_ppdu_stats_ind_hdr_t;
  13393. /**
  13394. * @brief target -> host extended statistics upload
  13395. *
  13396. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13397. *
  13398. * @details
  13399. * The following field definitions describe the format of the HTT target
  13400. * to host stats upload confirmation message.
  13401. * The message contains a cookie echoed from the HTT host->target stats
  13402. * upload request, which identifies which request the confirmation is
  13403. * for, and a single stats can span over multiple HTT stats indication
  13404. * due to the HTT message size limitation so every HTT ext stats indication
  13405. * will have tag-length-value stats information elements.
  13406. * The tag-length header for each HTT stats IND message also includes a
  13407. * status field, to indicate whether the request for the stat type in
  13408. * question was fully met, partially met, unable to be met, or invalid
  13409. * (if the stat type in question is disabled in the target).
  13410. * A Done bit 1's indicate the end of the of stats info elements.
  13411. *
  13412. *
  13413. * |31 16|15 12|11|10 8|7 5|4 0|
  13414. * |--------------------------------------------------------------|
  13415. * | reserved | msg type |
  13416. * |--------------------------------------------------------------|
  13417. * | cookie LSBs |
  13418. * |--------------------------------------------------------------|
  13419. * | cookie MSBs |
  13420. * |--------------------------------------------------------------|
  13421. * | stats entry length | rsvd | D| S | stat type |
  13422. * |--------------------------------------------------------------|
  13423. * | type-specific stats info |
  13424. * | (see htt_stats.h) |
  13425. * |--------------------------------------------------------------|
  13426. * Header fields:
  13427. * - MSG_TYPE
  13428. * Bits 7:0
  13429. * Purpose: Identifies this is a extended statistics upload confirmation
  13430. * message.
  13431. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13432. * - COOKIE_LSBS
  13433. * Bits 31:0
  13434. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13435. * message with its preceding host->target stats request message.
  13436. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13437. * - COOKIE_MSBS
  13438. * Bits 31:0
  13439. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13440. * message with its preceding host->target stats request message.
  13441. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13442. *
  13443. * Stats Information Element tag-length header fields:
  13444. * - STAT_TYPE
  13445. * Bits 7:0
  13446. * Purpose: identifies the type of statistics info held in the
  13447. * following information element
  13448. * Value: htt_dbg_ext_stats_type
  13449. * - STATUS
  13450. * Bits 10:8
  13451. * Purpose: indicate whether the requested stats are present
  13452. * Value: htt_dbg_ext_stats_status
  13453. * - DONE
  13454. * Bits 11
  13455. * Purpose:
  13456. * Indicates the completion of the stats entry, this will be the last
  13457. * stats conf HTT segment for the requested stats type.
  13458. * Value:
  13459. * 0 -> the stats retrieval is ongoing
  13460. * 1 -> the stats retrieval is complete
  13461. * - LENGTH
  13462. * Bits 31:16
  13463. * Purpose: indicate the stats information size
  13464. * Value: This field specifies the number of bytes of stats information
  13465. * that follows the element tag-length header.
  13466. * It is expected but not required that this length is a multiple of
  13467. * 4 bytes.
  13468. */
  13469. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13470. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13471. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13472. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13473. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13474. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13475. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13476. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13477. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13478. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13479. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13480. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13481. do { \
  13482. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13483. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13484. } while (0)
  13485. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13486. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13487. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13488. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13489. do { \
  13490. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13491. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13492. } while (0)
  13493. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13494. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13495. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13496. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13497. do { \
  13498. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13499. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13500. } while (0)
  13501. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13502. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13503. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13504. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13505. do { \
  13506. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13507. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13508. } while (0)
  13509. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13510. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13511. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13512. typedef enum {
  13513. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13514. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13515. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13516. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13517. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13518. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13519. /* Reserved from 128 - 255 for target internal use.*/
  13520. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13521. } HTT_PEER_TYPE;
  13522. /** macro to convert MAC address from char array to HTT word format */
  13523. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13524. (phtt_mac_addr)->mac_addr31to0 = \
  13525. (((c_macaddr)[0] << 0) | \
  13526. ((c_macaddr)[1] << 8) | \
  13527. ((c_macaddr)[2] << 16) | \
  13528. ((c_macaddr)[3] << 24)); \
  13529. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13530. } while (0)
  13531. /**
  13532. * @brief target -> host monitor mac header indication message
  13533. *
  13534. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13535. *
  13536. * @details
  13537. * The following diagram shows the format of the monitor mac header message
  13538. * sent from the target to the host.
  13539. * This message is primarily sent when promiscuous rx mode is enabled.
  13540. * One message is sent per rx PPDU.
  13541. *
  13542. * |31 24|23 16|15 8|7 0|
  13543. * |-------------------------------------------------------------|
  13544. * | peer_id | reserved0 | msg_type |
  13545. * |-------------------------------------------------------------|
  13546. * | reserved1 | num_mpdu |
  13547. * |-------------------------------------------------------------|
  13548. * | struct hw_rx_desc |
  13549. * | (see wal_rx_desc.h) |
  13550. * |-------------------------------------------------------------|
  13551. * | struct ieee80211_frame_addr4 |
  13552. * | (see ieee80211_defs.h) |
  13553. * |-------------------------------------------------------------|
  13554. * | struct ieee80211_frame_addr4 |
  13555. * | (see ieee80211_defs.h) |
  13556. * |-------------------------------------------------------------|
  13557. * | ...... |
  13558. * |-------------------------------------------------------------|
  13559. *
  13560. * Header fields:
  13561. * - msg_type
  13562. * Bits 7:0
  13563. * Purpose: Identifies this is a monitor mac header indication message.
  13564. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13565. * - peer_id
  13566. * Bits 31:16
  13567. * Purpose: Software peer id given by host during association,
  13568. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13569. * for rx PPDUs received from unassociated peers.
  13570. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13571. * - num_mpdu
  13572. * Bits 15:0
  13573. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13574. * delivered within the message.
  13575. * Value: 1 to 32
  13576. * num_mpdu is limited to a maximum value of 32, due to buffer
  13577. * size limits. For PPDUs with more than 32 MPDUs, only the
  13578. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13579. * the PPDU will be provided.
  13580. */
  13581. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13582. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13583. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13584. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13585. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13586. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13587. do { \
  13588. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13589. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13590. } while (0)
  13591. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13592. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13593. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13594. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13595. do { \
  13596. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13597. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13598. } while (0)
  13599. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13600. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13601. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13602. /**
  13603. * @brief target -> host flow pool resize Message
  13604. *
  13605. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13606. *
  13607. * @details
  13608. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13609. * the flow pool associated with the specified ID is resized
  13610. *
  13611. * The message would appear as follows:
  13612. *
  13613. * |31 16|15 8|7 0|
  13614. * |---------------------------------+----------------+----------------|
  13615. * | reserved0 | Msg type |
  13616. * |-------------------------------------------------------------------|
  13617. * | flow pool new size | flow pool ID |
  13618. * |-------------------------------------------------------------------|
  13619. *
  13620. * The message is interpreted as follows:
  13621. * b'0:7 - msg_type: This will be set to 0x21
  13622. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13623. *
  13624. * b'0:15 - flow pool ID: Existing flow pool ID
  13625. *
  13626. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13627. *
  13628. */
  13629. PREPACK struct htt_flow_pool_resize_t {
  13630. A_UINT32 msg_type:8,
  13631. reserved0:24;
  13632. A_UINT32 flow_pool_id:16,
  13633. flow_pool_new_size:16;
  13634. } POSTPACK;
  13635. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13636. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13637. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13638. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13639. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13640. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13641. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13642. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13643. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13644. do { \
  13645. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13646. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13647. } while (0)
  13648. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13649. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13650. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13651. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13652. do { \
  13653. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13654. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13655. } while (0)
  13656. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13657. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13658. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13659. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13660. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13661. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13662. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13663. /*
  13664. * The read and write indices point to the data within the host buffer.
  13665. * Because the first 4 bytes of the host buffer is used for the read index and
  13666. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13667. * The read index and write index are the byte offsets from the base of the
  13668. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13669. * Refer the ASCII text picture below.
  13670. */
  13671. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13672. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13673. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13674. /*
  13675. ***************************************************************************
  13676. *
  13677. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13678. *
  13679. ***************************************************************************
  13680. *
  13681. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13682. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13683. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13684. * written into the Host memory region mentioned below.
  13685. *
  13686. * Read index is updated by the Host. At any point of time, the read index will
  13687. * indicate the index that will next be read by the Host. The read index is
  13688. * in units of bytes offset from the base of the meta-data buffer.
  13689. *
  13690. * Write index is updated by the FW. At any point of time, the write index will
  13691. * indicate from where the FW can start writing any new data. The write index is
  13692. * in units of bytes offset from the base of the meta-data buffer.
  13693. *
  13694. * If the Host is not fast enough in reading the CFR data, any new capture data
  13695. * would be dropped if there is no space left to write the new captures.
  13696. *
  13697. * The last 4 bytes of the memory region will have the magic pattern
  13698. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13699. * not overrun the host buffer.
  13700. *
  13701. * ,--------------------. read and write indices store the
  13702. * | | byte offset from the base of the
  13703. * | ,--------+--------. meta-data buffer to the next
  13704. * | | | | location within the data buffer
  13705. * | | v v that will be read / written
  13706. * ************************************************************************
  13707. * * Read * Write * * Magic *
  13708. * * index * index * CFR data1 ...... CFR data N * pattern *
  13709. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13710. * ************************************************************************
  13711. * |<---------- data buffer ---------->|
  13712. *
  13713. * |<----------------- meta-data buffer allocated in Host ----------------|
  13714. *
  13715. * Note:
  13716. * - Considering the 4 bytes needed to store the Read index (R) and the
  13717. * Write index (W), the initial value is as follows:
  13718. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13719. * - Buffer empty condition:
  13720. * R = W
  13721. *
  13722. * Regarding CFR data format:
  13723. * --------------------------
  13724. *
  13725. * Each CFR tone is stored in HW as 16-bits with the following format:
  13726. * {bits[15:12], bits[11:6], bits[5:0]} =
  13727. * {unsigned exponent (4 bits),
  13728. * signed mantissa_real (6 bits),
  13729. * signed mantissa_imag (6 bits)}
  13730. *
  13731. * CFR_real = mantissa_real * 2^(exponent-5)
  13732. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13733. *
  13734. *
  13735. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13736. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13737. *
  13738. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13739. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13740. * .
  13741. * .
  13742. * .
  13743. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13744. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13745. */
  13746. /* Bandwidth of peer CFR captures */
  13747. typedef enum {
  13748. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13749. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13750. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13751. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13752. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13753. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13754. } HTT_PEER_CFR_CAPTURE_BW;
  13755. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13756. * was captured
  13757. */
  13758. typedef enum {
  13759. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13760. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13761. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13762. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13763. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13764. } HTT_PEER_CFR_CAPTURE_MODE;
  13765. typedef enum {
  13766. /* This message type is currently used for the below purpose:
  13767. *
  13768. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13769. * wmi_peer_cfr_capture_cmd.
  13770. * If payload_present bit is set to 0 then the associated memory region
  13771. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13772. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13773. * message; the CFR dump will be present at the end of the message,
  13774. * after the chan_phy_mode.
  13775. */
  13776. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13777. /* Always keep this last */
  13778. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13779. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13780. /**
  13781. * @brief target -> host CFR dump completion indication message definition
  13782. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13783. *
  13784. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13785. *
  13786. * @details
  13787. * The following diagram shows the format of the Channel Frequency Response
  13788. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13789. * the channel capture of a peer is copied by Firmware into the Host memory
  13790. *
  13791. * **************************************************************************
  13792. *
  13793. * Message format when the CFR capture message type is
  13794. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13795. *
  13796. * **************************************************************************
  13797. *
  13798. * |31 16|15 |8|7 0|
  13799. * |----------------------------------------------------------------|
  13800. * header: | reserved |P| msg_type |
  13801. * word 0 | | | |
  13802. * |----------------------------------------------------------------|
  13803. * payload: | cfr_capture_msg_type |
  13804. * word 1 | |
  13805. * |----------------------------------------------------------------|
  13806. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13807. * word 2 | | | | | | | | |
  13808. * |----------------------------------------------------------------|
  13809. * | mac_addr31to0 |
  13810. * word 3 | |
  13811. * |----------------------------------------------------------------|
  13812. * | unused / reserved | mac_addr47to32 |
  13813. * word 4 | | |
  13814. * |----------------------------------------------------------------|
  13815. * | index |
  13816. * word 5 | |
  13817. * |----------------------------------------------------------------|
  13818. * | length |
  13819. * word 6 | |
  13820. * |----------------------------------------------------------------|
  13821. * | timestamp |
  13822. * word 7 | |
  13823. * |----------------------------------------------------------------|
  13824. * | counter |
  13825. * word 8 | |
  13826. * |----------------------------------------------------------------|
  13827. * | chan_mhz |
  13828. * word 9 | |
  13829. * |----------------------------------------------------------------|
  13830. * | band_center_freq1 |
  13831. * word 10 | |
  13832. * |----------------------------------------------------------------|
  13833. * | band_center_freq2 |
  13834. * word 11 | |
  13835. * |----------------------------------------------------------------|
  13836. * | chan_phy_mode |
  13837. * word 12 | |
  13838. * |----------------------------------------------------------------|
  13839. * where,
  13840. * P - payload present bit (payload_present explained below)
  13841. * req_id - memory request id (mem_req_id explained below)
  13842. * S - status field (status explained below)
  13843. * capbw - capture bandwidth (capture_bw explained below)
  13844. * mode - mode of capture (mode explained below)
  13845. * sts - space time streams (sts_count explained below)
  13846. * chbw - channel bandwidth (channel_bw explained below)
  13847. * captype - capture type (cap_type explained below)
  13848. *
  13849. * The following field definitions describe the format of the CFR dump
  13850. * completion indication sent from the target to the host
  13851. *
  13852. * Header fields:
  13853. *
  13854. * Word 0
  13855. * - msg_type
  13856. * Bits 7:0
  13857. * Purpose: Identifies this as CFR TX completion indication
  13858. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13859. * - payload_present
  13860. * Bit 8
  13861. * Purpose: Identifies how CFR data is sent to host
  13862. * Value: 0 - If CFR Payload is written to host memory
  13863. * 1 - If CFR Payload is sent as part of HTT message
  13864. * (This is the requirement for SDIO/USB where it is
  13865. * not possible to write CFR data to host memory)
  13866. * - reserved
  13867. * Bits 31:9
  13868. * Purpose: Reserved
  13869. * Value: 0
  13870. *
  13871. * Payload fields:
  13872. *
  13873. * Word 1
  13874. * - cfr_capture_msg_type
  13875. * Bits 31:0
  13876. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13877. * to specify the format used for the remainder of the message
  13878. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13879. * (currently only MSG_TYPE_1 is defined)
  13880. *
  13881. * Word 2
  13882. * - mem_req_id
  13883. * Bits 6:0
  13884. * Purpose: Contain the mem request id of the region where the CFR capture
  13885. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13886. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13887. this value is invalid)
  13888. * - status
  13889. * Bit 7
  13890. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13891. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13892. * - capture_bw
  13893. * Bits 10:8
  13894. * Purpose: Carry the bandwidth of the CFR capture
  13895. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13896. * - mode
  13897. * Bits 13:11
  13898. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13899. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13900. * - sts_count
  13901. * Bits 16:14
  13902. * Purpose: Carry the number of space time streams
  13903. * Value: Number of space time streams
  13904. * - channel_bw
  13905. * Bits 19:17
  13906. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13907. * measurement
  13908. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13909. * - cap_type
  13910. * Bits 23:20
  13911. * Purpose: Carry the type of the capture
  13912. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13913. * - vdev_id
  13914. * Bits 31:24
  13915. * Purpose: Carry the virtual device id
  13916. * Value: vdev ID
  13917. *
  13918. * Word 3
  13919. * - mac_addr31to0
  13920. * Bits 31:0
  13921. * Purpose: Contain the bits 31:0 of the peer MAC address
  13922. * Value: Bits 31:0 of the peer MAC address
  13923. *
  13924. * Word 4
  13925. * - mac_addr47to32
  13926. * Bits 15:0
  13927. * Purpose: Contain the bits 47:32 of the peer MAC address
  13928. * Value: Bits 47:32 of the peer MAC address
  13929. *
  13930. * Word 5
  13931. * - index
  13932. * Bits 31:0
  13933. * Purpose: Contain the index at which this CFR dump was written in the Host
  13934. * allocated memory. This index is the number of bytes from the base address.
  13935. * Value: Index position
  13936. *
  13937. * Word 6
  13938. * - length
  13939. * Bits 31:0
  13940. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13941. * Value: Length of the CFR capture of the peer
  13942. *
  13943. * Word 7
  13944. * - timestamp
  13945. * Bits 31:0
  13946. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13947. * clock used for this timestamp is private to the target and not visible to
  13948. * the host i.e., Host can interpret only the relative timestamp deltas from
  13949. * one message to the next, but can't interpret the absolute timestamp from a
  13950. * single message.
  13951. * Value: Timestamp in microseconds
  13952. *
  13953. * Word 8
  13954. * - counter
  13955. * Bits 31:0
  13956. * Purpose: Carry the count of the current CFR capture from FW. This is
  13957. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13958. * in host memory)
  13959. * Value: Count of the current CFR capture
  13960. *
  13961. * Word 9
  13962. * - chan_mhz
  13963. * Bits 31:0
  13964. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13965. * Value: Primary 20 channel frequency
  13966. *
  13967. * Word 10
  13968. * - band_center_freq1
  13969. * Bits 31:0
  13970. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13971. * Value: Center frequency 1 in MHz
  13972. *
  13973. * Word 11
  13974. * - band_center_freq2
  13975. * Bits 31:0
  13976. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13977. * the VDEV
  13978. * 80plus80 mode
  13979. * Value: Center frequency 2 in MHz
  13980. *
  13981. * Word 12
  13982. * - chan_phy_mode
  13983. * Bits 31:0
  13984. * Purpose: Carry the phy mode of the channel, of the VDEV
  13985. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13986. */
  13987. PREPACK struct htt_cfr_dump_ind_type_1 {
  13988. A_UINT32 mem_req_id:7,
  13989. status:1,
  13990. capture_bw:3,
  13991. mode:3,
  13992. sts_count:3,
  13993. channel_bw:3,
  13994. cap_type:4,
  13995. vdev_id:8;
  13996. htt_mac_addr addr;
  13997. A_UINT32 index;
  13998. A_UINT32 length;
  13999. A_UINT32 timestamp;
  14000. A_UINT32 counter;
  14001. struct htt_chan_change_msg chan;
  14002. } POSTPACK;
  14003. PREPACK struct htt_cfr_dump_compl_ind {
  14004. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14005. union {
  14006. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14007. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14008. /* If there is a need to change the memory layout and its associated
  14009. * HTT indication format, a new CFR capture message type can be
  14010. * introduced and added into this union.
  14011. */
  14012. };
  14013. } POSTPACK;
  14014. /*
  14015. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14016. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14017. */
  14018. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14019. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14020. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14021. do { \
  14022. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14023. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14024. } while(0)
  14025. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14026. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14027. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14028. /*
  14029. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14030. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14031. */
  14032. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14033. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14034. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14035. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14036. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14037. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14038. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14039. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14040. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14041. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14042. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14043. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14044. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14045. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14046. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14047. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14048. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14049. do { \
  14050. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14051. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14052. } while (0)
  14053. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14054. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14055. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14056. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14057. do { \
  14058. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14059. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14060. } while (0)
  14061. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14062. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14063. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14064. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14065. do { \
  14066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14067. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14068. } while (0)
  14069. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14070. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14071. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14072. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14073. do { \
  14074. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14075. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14076. } while (0)
  14077. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14078. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14079. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14080. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14081. do { \
  14082. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14083. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14084. } while (0)
  14085. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14086. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14087. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14088. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14089. do { \
  14090. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14091. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14092. } while (0)
  14093. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14094. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14095. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14096. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14097. do { \
  14098. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14099. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14100. } while (0)
  14101. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14102. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14103. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14104. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14105. do { \
  14106. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14107. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14108. } while (0)
  14109. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14110. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14111. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14112. /**
  14113. * @brief target -> host peer (PPDU) stats message
  14114. *
  14115. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14116. *
  14117. * @details
  14118. * This message is generated by FW when FW is sending stats to host
  14119. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14120. * This message is sent autonomously by the target rather than upon request
  14121. * by the host.
  14122. * The following field definitions describe the format of the HTT target
  14123. * to host peer stats indication message.
  14124. *
  14125. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14126. * or more PPDU stats records.
  14127. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14128. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14129. * then the message would start with the
  14130. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14131. * below.
  14132. *
  14133. * |31 16|15|14|13 11|10 9|8|7 0|
  14134. * |-------------------------------------------------------------|
  14135. * | reserved |MSG_TYPE |
  14136. * |-------------------------------------------------------------|
  14137. * rec 0 | TLV header |
  14138. * rec 0 |-------------------------------------------------------------|
  14139. * rec 0 | ppdu successful bytes |
  14140. * rec 0 |-------------------------------------------------------------|
  14141. * rec 0 | ppdu retry bytes |
  14142. * rec 0 |-------------------------------------------------------------|
  14143. * rec 0 | ppdu failed bytes |
  14144. * rec 0 |-------------------------------------------------------------|
  14145. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14146. * rec 0 |-------------------------------------------------------------|
  14147. * rec 0 | retried MSDUs | successful MSDUs |
  14148. * rec 0 |-------------------------------------------------------------|
  14149. * rec 0 | TX duration | failed MSDUs |
  14150. * rec 0 |-------------------------------------------------------------|
  14151. * ...
  14152. * |-------------------------------------------------------------|
  14153. * rec N | TLV header |
  14154. * rec N |-------------------------------------------------------------|
  14155. * rec N | ppdu successful bytes |
  14156. * rec N |-------------------------------------------------------------|
  14157. * rec N | ppdu retry bytes |
  14158. * rec N |-------------------------------------------------------------|
  14159. * rec N | ppdu failed bytes |
  14160. * rec N |-------------------------------------------------------------|
  14161. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14162. * rec N |-------------------------------------------------------------|
  14163. * rec N | retried MSDUs | successful MSDUs |
  14164. * rec N |-------------------------------------------------------------|
  14165. * rec N | TX duration | failed MSDUs |
  14166. * rec N |-------------------------------------------------------------|
  14167. *
  14168. * where:
  14169. * A = is A-MPDU flag
  14170. * BA = block-ack failure flags
  14171. * BW = bandwidth spec
  14172. * SG = SGI enabled spec
  14173. * S = skipped rate ctrl
  14174. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14175. *
  14176. * Header
  14177. * ------
  14178. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14179. * dword0 - b'8:31 - reserved : Reserved for future use
  14180. *
  14181. * payload include below peer_stats information
  14182. * --------------------------------------------
  14183. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14184. * @tx_success_bytes : total successful bytes in the PPDU.
  14185. * @tx_retry_bytes : total retried bytes in the PPDU.
  14186. * @tx_failed_bytes : total failed bytes in the PPDU.
  14187. * @tx_ratecode : rate code used for the PPDU.
  14188. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14189. * @ba_ack_failed : BA/ACK failed for this PPDU
  14190. * b00 -> BA received
  14191. * b01 -> BA failed once
  14192. * b10 -> BA failed twice, when HW retry is enabled.
  14193. * @bw : BW
  14194. * b00 -> 20 MHz
  14195. * b01 -> 40 MHz
  14196. * b10 -> 80 MHz
  14197. * b11 -> 160 MHz (or 80+80)
  14198. * @sg : SGI enabled
  14199. * @s : skipped ratectrl
  14200. * @peer_id : peer id
  14201. * @tx_success_msdus : successful MSDUs
  14202. * @tx_retry_msdus : retried MSDUs
  14203. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14204. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14205. */
  14206. /**
  14207. * @brief target -> host backpressure event
  14208. *
  14209. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14210. *
  14211. * @details
  14212. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14213. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14214. * This message will only be sent if the backpressure condition has existed
  14215. * continuously for an initial period (100 ms).
  14216. * Repeat messages with updated information will be sent after each
  14217. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14218. * This message indicates the ring id along with current head and tail index
  14219. * locations (i.e. write and read indices).
  14220. * The backpressure time indicates the time in ms for which continous
  14221. * backpressure has been observed in the ring.
  14222. *
  14223. * The message format is as follows:
  14224. *
  14225. * |31 24|23 16|15 8|7 0|
  14226. * |----------------+----------------+----------------+----------------|
  14227. * | ring_id | ring_type | pdev_id | msg_type |
  14228. * |-------------------------------------------------------------------|
  14229. * | tail_idx | head_idx |
  14230. * |-------------------------------------------------------------------|
  14231. * | backpressure_time_ms |
  14232. * |-------------------------------------------------------------------|
  14233. *
  14234. * The message is interpreted as follows:
  14235. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14236. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14237. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14238. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14239. the msg is for LMAC ring.
  14240. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14241. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14242. * htt_backpressure_lmac_ring_id. This represents
  14243. * the ring id for which continous backpressure is seen
  14244. *
  14245. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14246. * the ring indicated by the ring_id
  14247. *
  14248. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14249. * the ring indicated by the ring id
  14250. *
  14251. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14252. * backpressure has been seen in the ring
  14253. * indicated by the ring_id.
  14254. * Units = milliseconds
  14255. */
  14256. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14257. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14258. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14259. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14260. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14261. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14262. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14263. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14264. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14265. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14266. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14267. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14268. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14269. do { \
  14270. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14271. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14272. } while (0)
  14273. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14274. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14275. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14276. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14277. do { \
  14278. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14279. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14280. } while (0)
  14281. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14282. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14283. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14284. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14285. do { \
  14286. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14287. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14288. } while (0)
  14289. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14290. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14291. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14292. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14293. do { \
  14294. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14295. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14296. } while (0)
  14297. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14298. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14299. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14300. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14301. do { \
  14302. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14303. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14304. } while (0)
  14305. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14306. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14307. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14308. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14309. do { \
  14310. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14311. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14312. } while (0)
  14313. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14314. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14315. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14316. enum htt_backpressure_ring_type {
  14317. HTT_SW_RING_TYPE_UMAC,
  14318. HTT_SW_RING_TYPE_LMAC,
  14319. HTT_SW_RING_TYPE_MAX,
  14320. };
  14321. /* Ring id for which the message is sent to host */
  14322. enum htt_backpressure_umac_ringid {
  14323. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14324. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14325. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14326. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14327. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14328. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14329. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14330. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14331. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14332. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14333. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14334. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14335. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14336. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14337. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14338. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14339. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14340. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14341. HTT_SW_UMAC_RING_IDX_MAX,
  14342. };
  14343. enum htt_backpressure_lmac_ringid {
  14344. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14345. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14346. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14347. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14348. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14349. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14350. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14351. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14352. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14353. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14354. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14355. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14356. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14357. HTT_SW_LMAC_RING_IDX_MAX,
  14358. };
  14359. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14360. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14361. pdev_id: 8,
  14362. ring_type: 8, /* htt_backpressure_ring_type */
  14363. /*
  14364. * ring_id holds an enum value from either
  14365. * htt_backpressure_umac_ringid or
  14366. * htt_backpressure_lmac_ringid, based on
  14367. * the ring_type setting.
  14368. */
  14369. ring_id: 8;
  14370. A_UINT16 head_idx;
  14371. A_UINT16 tail_idx;
  14372. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14373. } POSTPACK;
  14374. /*
  14375. * Defines two 32 bit words that can be used by the target to indicate a per
  14376. * user RU allocation and rate information.
  14377. *
  14378. * This information is currently provided in the "sw_response_reference_ptr"
  14379. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14380. * "rx_ppdu_end_user_stats" TLV.
  14381. *
  14382. * VALID:
  14383. * The consumer of these words must explicitly check the valid bit,
  14384. * and only attempt interpretation of any of the remaining fields if
  14385. * the valid bit is set to 1.
  14386. *
  14387. * VERSION:
  14388. * The consumer of these words must also explicitly check the version bit,
  14389. * and only use the V0 definition if the VERSION field is set to 0.
  14390. *
  14391. * Version 1 is currently undefined, with the exception of the VALID and
  14392. * VERSION fields.
  14393. *
  14394. * Version 0:
  14395. *
  14396. * The fields below are duplicated per BW.
  14397. *
  14398. * The consumer must determine which BW field to use, based on the UL OFDMA
  14399. * PPDU BW indicated by HW.
  14400. *
  14401. * RU_START: RU26 start index for the user.
  14402. * Note that this is always using the RU26 index, regardless
  14403. * of the actual RU assigned to the user
  14404. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14405. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14406. *
  14407. * For example, 20MHz (the value in the top row is RU_START)
  14408. *
  14409. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14410. * RU Size 1 (52): | | | | | |
  14411. * RU Size 2 (106): | | | |
  14412. * RU Size 3 (242): | |
  14413. *
  14414. * RU_SIZE: Indicates the RU size, as defined by enum
  14415. * htt_ul_ofdma_user_info_ru_size.
  14416. *
  14417. * LDPC: LDPC enabled (if 0, BCC is used)
  14418. *
  14419. * DCM: DCM enabled
  14420. *
  14421. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14422. * |---------------------------------+--------------------------------|
  14423. * |Ver|Valid| FW internal |
  14424. * |---------------------------------+--------------------------------|
  14425. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14426. * |---------------------------------+--------------------------------|
  14427. */
  14428. enum htt_ul_ofdma_user_info_ru_size {
  14429. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14430. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14431. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14432. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14433. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14434. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14435. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14436. };
  14437. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14438. struct htt_ul_ofdma_user_info_v0 {
  14439. A_UINT32 word0;
  14440. A_UINT32 word1;
  14441. };
  14442. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14443. A_UINT32 w0_fw_rsvd:30; \
  14444. A_UINT32 w0_valid:1; \
  14445. A_UINT32 w0_version:1;
  14446. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14447. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14448. };
  14449. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14450. A_UINT32 w1_nss:3; \
  14451. A_UINT32 w1_mcs:4; \
  14452. A_UINT32 w1_ldpc:1; \
  14453. A_UINT32 w1_dcm:1; \
  14454. A_UINT32 w1_ru_start:7; \
  14455. A_UINT32 w1_ru_size:3; \
  14456. A_UINT32 w1_trig_type:4; \
  14457. A_UINT32 w1_unused:9;
  14458. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14459. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14460. };
  14461. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14462. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14463. union {
  14464. A_UINT32 word0;
  14465. struct {
  14466. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14467. };
  14468. };
  14469. union {
  14470. A_UINT32 word1;
  14471. struct {
  14472. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14473. };
  14474. };
  14475. } POSTPACK;
  14476. enum HTT_UL_OFDMA_TRIG_TYPE {
  14477. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14478. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14479. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14480. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14481. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14482. };
  14483. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14484. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14485. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14486. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14487. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14488. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14489. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14490. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14491. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14492. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14493. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14494. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14495. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14496. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14497. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14499. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14501. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14502. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14503. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14504. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14505. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14506. /*--- word 0 ---*/
  14507. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14508. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14509. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14510. do { \
  14511. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14512. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14513. } while (0)
  14514. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14515. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14516. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14517. do { \
  14518. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14519. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14520. } while (0)
  14521. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14522. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14523. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14524. do { \
  14525. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14526. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14527. } while (0)
  14528. /*--- word 1 ---*/
  14529. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14530. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14531. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14532. do { \
  14533. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14534. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14535. } while (0)
  14536. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14537. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14538. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14539. do { \
  14540. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14541. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14542. } while (0)
  14543. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14544. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14545. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14546. do { \
  14547. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14548. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14549. } while (0)
  14550. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14551. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14552. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14553. do { \
  14554. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14555. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14556. } while (0)
  14557. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14558. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14559. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14560. do { \
  14561. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14562. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14563. } while (0)
  14564. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14565. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14566. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14567. do { \
  14568. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14569. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14570. } while (0)
  14571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14572. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14574. do { \
  14575. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14576. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14577. } while (0)
  14578. /**
  14579. * @brief target -> host channel calibration data message
  14580. *
  14581. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14582. *
  14583. * @brief host -> target channel calibration data message
  14584. *
  14585. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14586. *
  14587. * @details
  14588. * The following field definitions describe the format of the channel
  14589. * calibration data message sent from the target to the host when
  14590. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14591. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14592. * The message is defined as htt_chan_caldata_msg followed by a variable
  14593. * number of 32-bit character values.
  14594. *
  14595. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14596. * |------------------------------------------------------------------|
  14597. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14598. * |------------------------------------------------------------------|
  14599. * | payload size | mhz |
  14600. * |------------------------------------------------------------------|
  14601. * | center frequency 2 | center frequency 1 |
  14602. * |------------------------------------------------------------------|
  14603. * | check sum |
  14604. * |------------------------------------------------------------------|
  14605. * | payload |
  14606. * |------------------------------------------------------------------|
  14607. * message info field:
  14608. * - MSG_TYPE
  14609. * Bits 7:0
  14610. * Purpose: identifies this as a channel calibration data message
  14611. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14612. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14613. * - SUB_TYPE
  14614. * Bits 11:8
  14615. * Purpose: T2H: indicates whether target is providing chan cal data
  14616. * to the host to store, or requesting that the host
  14617. * download previously-stored data.
  14618. * H2T: indicates whether the host is providing the requested
  14619. * channel cal data, or if it is rejecting the data
  14620. * request because it does not have the requested data.
  14621. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14622. * - CHKSUM_VALID
  14623. * Bit 12
  14624. * Purpose: indicates if the checksum field is valid
  14625. * value:
  14626. * - FRAG
  14627. * Bit 19:16
  14628. * Purpose: indicates the fragment index for message
  14629. * value: 0 for first fragment, 1 for second fragment, ...
  14630. * - APPEND
  14631. * Bit 20
  14632. * Purpose: indicates if this is the last fragment
  14633. * value: 0 = final fragment, 1 = more fragments will be appended
  14634. *
  14635. * channel and payload size field
  14636. * - MHZ
  14637. * Bits 15:0
  14638. * Purpose: indicates the channel primary frequency
  14639. * Value:
  14640. * - PAYLOAD_SIZE
  14641. * Bits 31:16
  14642. * Purpose: indicates the bytes of calibration data in payload
  14643. * Value:
  14644. *
  14645. * center frequency field
  14646. * - CENTER FREQUENCY 1
  14647. * Bits 15:0
  14648. * Purpose: indicates the channel center frequency
  14649. * Value: channel center frequency, in MHz units
  14650. * - CENTER FREQUENCY 2
  14651. * Bits 31:16
  14652. * Purpose: indicates the secondary channel center frequency,
  14653. * only for 11acvht 80plus80 mode
  14654. * Value: secondary channel center frequeny, in MHz units, if applicable
  14655. *
  14656. * checksum field
  14657. * - CHECK_SUM
  14658. * Bits 31:0
  14659. * Purpose: check the payload data, it is just for this fragment.
  14660. * This is intended for the target to check that the channel
  14661. * calibration data returned by the host is the unmodified data
  14662. * that was previously provided to the host by the target.
  14663. * value: checksum of fragment payload
  14664. */
  14665. PREPACK struct htt_chan_caldata_msg {
  14666. /* DWORD 0: message info */
  14667. A_UINT32
  14668. msg_type: 8,
  14669. sub_type: 4 ,
  14670. chksum_valid: 1, /** 1:valid, 0:invalid */
  14671. reserved1: 3,
  14672. frag_idx: 4, /** fragment index for calibration data */
  14673. appending: 1, /** 0: no fragment appending,
  14674. * 1: extra fragment appending */
  14675. reserved2: 11;
  14676. /* DWORD 1: channel and payload size */
  14677. A_UINT32
  14678. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14679. payload_size: 16; /** unit: bytes */
  14680. /* DWORD 2: center frequency */
  14681. A_UINT32
  14682. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14683. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14684. * valid only for 11acvht 80plus80 mode */
  14685. /* DWORD 3: check sum */
  14686. A_UINT32 chksum;
  14687. /* variable length for calibration data */
  14688. A_UINT32 payload[1/* or more */];
  14689. } POSTPACK;
  14690. /* T2H SUBTYPE */
  14691. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14692. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14693. /* H2T SUBTYPE */
  14694. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14695. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14696. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14697. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14698. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14699. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14700. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14701. do { \
  14702. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14703. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14704. } while (0)
  14705. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14706. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14707. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14708. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14709. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14710. do { \
  14711. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14712. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14713. } while (0)
  14714. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14715. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14716. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14717. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14718. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14719. do { \
  14720. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14721. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14722. } while (0)
  14723. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14724. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14725. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14726. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14727. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14728. do { \
  14729. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14730. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14731. } while (0)
  14732. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14733. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14734. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14735. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14736. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14737. do { \
  14738. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14739. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14740. } while (0)
  14741. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14742. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14743. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14744. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14745. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14746. do { \
  14747. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14748. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14749. } while (0)
  14750. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14751. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14752. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14753. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14754. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14755. do { \
  14756. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14757. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14758. } while (0)
  14759. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14760. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14761. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14762. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14763. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14764. do { \
  14765. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14766. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14767. } while (0)
  14768. /**
  14769. * @brief target -> host FSE CMEM based send
  14770. *
  14771. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14772. *
  14773. * @details
  14774. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14775. * FSE placement in CMEM is enabled.
  14776. *
  14777. * This message sends the non-secure CMEM base address.
  14778. * It will be sent to host in response to message
  14779. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14780. * The message would appear as follows:
  14781. *
  14782. * |31 24|23 16|15 8|7 0|
  14783. * |----------------+----------------+----------------+----------------|
  14784. * | reserved | num_entries | msg_type |
  14785. * |----------------+----------------+----------------+----------------|
  14786. * | base_address_lo |
  14787. * |----------------+----------------+----------------+----------------|
  14788. * | base_address_hi |
  14789. * |-------------------------------------------------------------------|
  14790. *
  14791. * The message is interpreted as follows:
  14792. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14793. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14794. * b'8:15 - number_entries: Indicated the number of entries
  14795. * programmed.
  14796. * b'16:31 - reserved.
  14797. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14798. * CMEM base address
  14799. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14800. * CMEM base address
  14801. */
  14802. PREPACK struct htt_cmem_base_send_t {
  14803. A_UINT32 msg_type: 8,
  14804. num_entries: 8,
  14805. reserved: 16;
  14806. A_UINT32 base_address_lo;
  14807. A_UINT32 base_address_hi;
  14808. } POSTPACK;
  14809. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14810. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14811. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14812. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14813. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14814. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14815. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14816. do { \
  14817. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14818. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14819. } while (0)
  14820. /**
  14821. * @brief - HTT PPDU ID format
  14822. *
  14823. * @details
  14824. * The following field definitions describe the format of the PPDU ID.
  14825. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14826. *
  14827. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14828. * +--------------------------------------------------------------------------
  14829. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14830. * +--------------------------------------------------------------------------
  14831. *
  14832. * sch id :Schedule command id
  14833. * Bits [11 : 0] : monotonically increasing counter to track the
  14834. * PPDU posted to a specific transmit queue.
  14835. *
  14836. * hwq_id: Hardware Queue ID.
  14837. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14838. *
  14839. * mac_id: MAC ID
  14840. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14841. *
  14842. * seq_idx: Sequence index.
  14843. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14844. * a particular TXOP.
  14845. *
  14846. * tqm_cmd: HWSCH/TQM flag.
  14847. * Bit [23] : Always set to 0.
  14848. *
  14849. * seq_cmd_type: Sequence command type.
  14850. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14851. * Refer to enum HTT_STATS_FTYPE for values.
  14852. */
  14853. PREPACK struct htt_ppdu_id {
  14854. A_UINT32
  14855. sch_id: 12,
  14856. hwq_id: 5,
  14857. mac_id: 2,
  14858. seq_idx: 2,
  14859. reserved1: 2,
  14860. tqm_cmd: 1,
  14861. seq_cmd_type: 6,
  14862. reserved2: 2;
  14863. } POSTPACK;
  14864. #define HTT_PPDU_ID_SCH_ID_S 0
  14865. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14866. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14867. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14868. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14869. do { \
  14870. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14871. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14872. } while (0)
  14873. #define HTT_PPDU_ID_HWQ_ID_S 12
  14874. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14875. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14876. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14877. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14878. do { \
  14879. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14880. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14881. } while (0)
  14882. #define HTT_PPDU_ID_MAC_ID_S 17
  14883. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14884. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14885. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14886. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14887. do { \
  14888. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14889. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14890. } while (0)
  14891. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14892. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14893. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14894. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14895. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14896. do { \
  14897. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14898. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14899. } while (0)
  14900. #define HTT_PPDU_ID_TQM_CMD_S 23
  14901. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14902. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14903. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14904. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14905. do { \
  14906. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14907. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14908. } while (0)
  14909. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14910. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14911. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14912. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14913. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14914. do { \
  14915. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14916. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14917. } while (0)
  14918. /**
  14919. * @brief target -> RX PEER METADATA V0 format
  14920. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14921. * message from target, and will confirm to the target which peer metadata
  14922. * version to use in the wmi_init message.
  14923. *
  14924. * The following diagram shows the format of the RX PEER METADATA.
  14925. *
  14926. * |31 24|23 16|15 8|7 0|
  14927. * |-----------------------------------------------------------------------|
  14928. * | Reserved | VDEV ID | PEER ID |
  14929. * |-----------------------------------------------------------------------|
  14930. */
  14931. PREPACK struct htt_rx_peer_metadata_v0 {
  14932. A_UINT32
  14933. peer_id: 16,
  14934. vdev_id: 8,
  14935. reserved1: 8;
  14936. } POSTPACK;
  14937. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14938. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14939. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14940. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14941. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14942. do { \
  14943. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14944. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14945. } while (0)
  14946. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14947. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14948. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14949. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14950. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14951. do { \
  14952. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14953. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14954. } while (0)
  14955. /**
  14956. * @brief target -> RX PEER METADATA V1 format
  14957. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14958. * message from target, and will confirm to the target which peer metadata
  14959. * version to use in the wmi_init message.
  14960. *
  14961. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14962. *
  14963. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14964. * |-----------------------------------------------------------------------|
  14965. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14966. * |-----------------------------------------------------------------------|
  14967. */
  14968. PREPACK struct htt_rx_peer_metadata_v1 {
  14969. A_UINT32
  14970. peer_id: 13,
  14971. ml_peer_valid: 1,
  14972. reserved1: 2,
  14973. vdev_id: 8,
  14974. lmac_id: 2,
  14975. chip_id: 3,
  14976. reserved2: 3;
  14977. } POSTPACK;
  14978. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14979. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14980. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14981. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14982. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14983. do { \
  14984. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14985. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14986. } while (0)
  14987. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14988. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14989. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14990. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14991. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14992. do { \
  14993. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14994. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14995. } while (0)
  14996. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14997. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14998. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14999. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15000. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15001. do { \
  15002. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15003. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15004. } while (0)
  15005. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15006. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15007. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15008. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15009. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15010. do { \
  15011. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15012. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15013. } while (0)
  15014. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15015. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15016. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15017. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15018. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15019. do { \
  15020. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15021. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15022. } while (0)
  15023. /*
  15024. * In some systems, the host SW wants to specify priorities between
  15025. * different MSDU / flow queues within the same peer-TID.
  15026. * The below enums are used for the host to identify to the target
  15027. * which MSDU queue's priority it wants to adjust.
  15028. */
  15029. /*
  15030. * The MSDUQ index describe index of TCL HW, where each index is
  15031. * used for queuing particular types of MSDUs.
  15032. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15033. */
  15034. enum HTT_MSDUQ_INDEX {
  15035. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15036. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15037. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15038. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15039. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15040. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15041. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15042. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15043. HTT_MSDUQ_MAX_INDEX,
  15044. };
  15045. /* MSDU qtype definition */
  15046. enum HTT_MSDU_QTYPE {
  15047. /*
  15048. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15049. * relative priority. Instead, the relative priority of CRIT_0 versus
  15050. * CRIT_1 is controlled by the FW, through the configuration parameters
  15051. * it applies to the queues.
  15052. */
  15053. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15054. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15055. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15056. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15057. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15058. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15059. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15060. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15061. /* New MSDU_QTYPE should be added above this line */
  15062. /*
  15063. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15064. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15065. * any host/target message definitions. The QTYPE_MAX value can
  15066. * only be used internally within the host or within the target.
  15067. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15068. * it must regard the unexpected value as a default qtype value,
  15069. * or ignore it.
  15070. */
  15071. HTT_MSDU_QTYPE_MAX,
  15072. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15073. };
  15074. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15075. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15076. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15077. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15078. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15079. };
  15080. /**
  15081. * @brief target -> host mlo timestamp offset indication
  15082. *
  15083. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15084. *
  15085. * @details
  15086. * The following field definitions describe the format of the HTT target
  15087. * to host mlo timestamp offset indication message.
  15088. *
  15089. *
  15090. * |31 16|15 12|11 10|9 8|7 0 |
  15091. * |----------------------------------------------------------------------|
  15092. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15093. * |----------------------------------------------------------------------|
  15094. * | Sync time stamp lo in us |
  15095. * |----------------------------------------------------------------------|
  15096. * | Sync time stamp hi in us |
  15097. * |----------------------------------------------------------------------|
  15098. * | mlo time stamp offset lo in us |
  15099. * |----------------------------------------------------------------------|
  15100. * | mlo time stamp offset hi in us |
  15101. * |----------------------------------------------------------------------|
  15102. * | mlo time stamp offset clocks in clock ticks |
  15103. * |----------------------------------------------------------------------|
  15104. * |31 26|25 16|15 0 |
  15105. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15106. * | | compensation in clks | |
  15107. * |----------------------------------------------------------------------|
  15108. * |31 22|21 0 |
  15109. * | rsvd 3 | mlo time stamp comp timer period |
  15110. * |----------------------------------------------------------------------|
  15111. * The message is interpreted as follows:
  15112. *
  15113. * dword0 - b'0:7 - msg_type: This will be set to
  15114. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15115. * value: 0x28
  15116. *
  15117. * dword0 - b'9:8 - pdev_id
  15118. *
  15119. * dword0 - b'11:10 - chip_id
  15120. *
  15121. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15122. *
  15123. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15124. *
  15125. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15126. * which last sync interrupt was received
  15127. *
  15128. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15129. * which last sync interrupt was received
  15130. *
  15131. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15132. *
  15133. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15134. *
  15135. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15136. *
  15137. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15138. *
  15139. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15140. * for sub us resolution
  15141. *
  15142. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15143. *
  15144. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15145. * is applied, in us
  15146. *
  15147. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15148. */
  15149. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15150. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15151. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15152. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15153. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15154. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15155. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15156. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15157. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15158. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15159. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15160. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15161. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15162. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15163. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15164. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15165. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15166. do { \
  15167. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15168. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15169. } while (0)
  15170. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15171. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15172. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15173. do { \
  15174. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15175. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15176. } while (0)
  15177. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15178. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15179. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15180. do { \
  15181. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15182. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15183. } while (0)
  15184. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15185. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15186. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15187. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15188. do { \
  15189. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15190. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15191. } while (0)
  15192. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15193. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15194. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15195. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15196. do { \
  15197. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15198. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15199. } while (0)
  15200. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15201. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15202. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15203. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15204. do { \
  15205. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15206. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15207. } while (0)
  15208. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15209. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15210. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15211. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15212. do { \
  15213. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15214. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15215. } while (0)
  15216. typedef struct {
  15217. A_UINT32 msg_type: 8, /* bits 7:0 */
  15218. pdev_id: 2, /* bits 9:8 */
  15219. chip_id: 2, /* bits 11:10 */
  15220. reserved1: 4, /* bits 15:12 */
  15221. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15222. A_UINT32 sync_timestamp_lo_us;
  15223. A_UINT32 sync_timestamp_hi_us;
  15224. A_UINT32 mlo_timestamp_offset_lo_us;
  15225. A_UINT32 mlo_timestamp_offset_hi_us;
  15226. A_UINT32 mlo_timestamp_offset_clks;
  15227. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15228. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15229. reserved2: 6; /* bits 31:26 */
  15230. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15231. reserved3: 10; /* bits 31:22 */
  15232. } htt_t2h_mlo_offset_ind_t;
  15233. /*
  15234. * @brief target -> host VDEV TX RX STATS
  15235. *
  15236. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15237. *
  15238. * @details
  15239. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15240. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15241. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15242. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15243. * periodically by target even in the absence of any further HTT request
  15244. * messages from host.
  15245. *
  15246. * The message is formatted as follows:
  15247. *
  15248. * |31 16|15 8|7 0|
  15249. * |---------------------------------+----------------+----------------|
  15250. * | payload_size | pdev_id | msg_type |
  15251. * |---------------------------------+----------------+----------------|
  15252. * | reserved0 |
  15253. * |-------------------------------------------------------------------|
  15254. * | reserved1 |
  15255. * |-------------------------------------------------------------------|
  15256. * | reserved2 |
  15257. * |-------------------------------------------------------------------|
  15258. * | |
  15259. * | VDEV specific Tx Rx stats info |
  15260. * | |
  15261. * |-------------------------------------------------------------------|
  15262. *
  15263. * The message is interpreted as follows:
  15264. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15265. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15266. * b'8:15 - pdev_id
  15267. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15268. * message header fields (msg_type through reserved2)
  15269. * dword1 - b'0:31 - reserved0.
  15270. * dword2 - b'0:31 - reserved1.
  15271. * dword3 - b'0:31 - reserved2.
  15272. */
  15273. typedef struct {
  15274. A_UINT32 msg_type: 8,
  15275. pdev_id: 8,
  15276. payload_size: 16;
  15277. A_UINT32 reserved0;
  15278. A_UINT32 reserved1;
  15279. A_UINT32 reserved2;
  15280. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15281. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15282. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15283. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15284. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15285. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15286. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15287. do { \
  15288. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15289. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15290. } while (0)
  15291. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15292. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15293. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15294. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15295. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15296. do { \
  15297. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15298. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15299. } while (0)
  15300. /* SOC related stats */
  15301. typedef struct {
  15302. htt_tlv_hdr_t tlv_hdr;
  15303. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15304. * This can be due to either the peer is deleted or deletion is ongoing
  15305. * */
  15306. A_UINT32 inv_peers_msdu_drop_count_lo;
  15307. A_UINT32 inv_peers_msdu_drop_count_hi;
  15308. } htt_t2h_soc_txrx_stats_common_tlv;
  15309. /* VDEV HW Tx/Rx stats */
  15310. typedef struct {
  15311. htt_tlv_hdr_t tlv_hdr;
  15312. A_UINT32 vdev_id;
  15313. /* Rx msdu byte cnt */
  15314. A_UINT32 rx_msdu_byte_cnt_lo;
  15315. A_UINT32 rx_msdu_byte_cnt_hi;
  15316. /* Rx msdu cnt */
  15317. A_UINT32 rx_msdu_cnt_lo;
  15318. A_UINT32 rx_msdu_cnt_hi;
  15319. /* tx msdu byte cnt */
  15320. A_UINT32 tx_msdu_byte_cnt_lo;
  15321. A_UINT32 tx_msdu_byte_cnt_hi;
  15322. /* tx msdu cnt */
  15323. A_UINT32 tx_msdu_cnt_lo;
  15324. A_UINT32 tx_msdu_cnt_hi;
  15325. /* tx excessive retry discarded msdu cnt*/
  15326. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15327. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15328. /* TX congestion ctrl msdu drop cnt */
  15329. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15330. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15331. /* discarded tx msdus cnt coz of time to live expiry */
  15332. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15333. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15334. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15335. #endif